This is an archive of the discontinued Mercurial Phabricator instance.

errors: use exit code 10 for parse errors
ClosedPublic

Authored by martinvonz on Nov 16 2020, 7:27 PM.

Details

Summary

Now that ParseErrors raised while reading the config file has been
converted into ConfigErrors, the remaining parse errors should all
be "input errors" (i.e. exit code 10), according to
https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Nov 16 2020, 7:27 PM
mharbison72 added inline comments.
tests/test-config.t
11

Should these be Configuration/30 like the plan page says? (I'm fine with queueing this and refining it later, since it looks like this is serviced by the same code that is obviously an input error in other cases.) I wondered similar about the .hgsub parse errors above, but that's arguably an input rather than a config file I guess.

martinvonz planned changes to this revision.Nov 19 2020, 12:09 PM
martinvonz added inline comments.
tests/test-config.t
11

Good point. I'll see if I can refactor the code a bit so the ParseError gets converted to a ConfigError if it gets caught in the config code.

martinvonz marked an inline comment as done.Nov 20 2020, 7:29 PM
martinvonz added inline comments.
tests/test-config.t
11

This should now be done. I inserted 12 more patches before this one to handle the config errors.

martinvonz edited the summary of this revision. (Show Details)Nov 21 2020, 1:35 AM
mharbison72 accepted this revision.Nov 21 2020, 3:10 PM
This revision is now accepted and ready to land.Nov 21 2020, 3:10 PM
This revision was automatically updated to reflect the committed changes.