This is an archive of the discontinued Mercurial Phabricator instance.

errors: use InputError in uncommit extension
ClosedPublic

Authored by martinvonz on Jan 29 2021, 7:37 PM.

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.Jan 29 2021, 7:37 PM
pulkit added a subscriber: pulkit.Jan 31 2021, 1:16 PM

I am on edge about whether these should be InputError or StateError.

I am on edge about whether these should be InputError or StateError.

I thought the heuristic was that InputErrors are always wrong (e.g. hg not-a-command not-a-file), and StateErrors mean the command is valid in some cases, but the state of the repo won't let it proceed. The 2 non-file checks here feel like state errors, given that. And the file checks feel like a weird combination of both (because some are for file tracking state, and one is whether the file exists at all).

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.