This is an archive of the discontinued Mercurial Phabricator instance.

errors: raise StateError when push fails because it creates new heads
ClosedPublic

Authored by martinvonz on Nov 24 2020, 1:05 PM.

Details

Summary

I decided to raise StateError here because the local and remote
repos are in an incompatible state. I think remote errors (exit code

  1. should be when something goes wrong on the remote and there's

nothing the user can do.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Nov 24 2020, 1:05 PM

I decided to raise InputError here because the user should adapt

I agree that RemoteError isn't great, but isn't this closer to a StateError? e.g. D9392 and D9393 are StateErrors signalling that the user needs to resolve conflicts or commit files before merging.

pulkit requested changes to this revision.Dec 4 2020, 1:45 PM
pulkit added a subscriber: pulkit.

I decided to raise InputError here because the user should adapt

I agree that RemoteError isn't great, but isn't this closer to a StateError? e.g. D9392 and D9393 are StateErrors signalling that the user needs to resolve conflicts or commit files before merging.

I agree with @mharbison72 here that StateError is better than InputError here. Input from the user was perfectly fine, the reason for error is the state of repositories.

This revision now requires changes to proceed.Dec 4 2020, 1:45 PM
martinvonz retitled this revision from errors: raise InputError when push fails because it creates new heads to errors: raise StateError when push fails because it creates new heads.Dec 15 2020, 10:47 AM
martinvonz edited the summary of this revision. (Show Details)
martinvonz updated this revision to Diff 24284.

I decided to raise InputError here because the user should adapt

I agree that RemoteError isn't great, but isn't this closer to a StateError? e.g. D9392 and D9393 are StateErrors signalling that the user needs to resolve conflicts or commit files before merging.

I agree with @mharbison72 here that StateError is better than InputError here. Input from the user was perfectly fine, the reason for error is the state of repositories.

Done. Thanks for your input.

mharbison72 accepted this revision.Dec 15 2020, 10:59 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.