( )⚙ D10253 rhg: add support for detailed exit code for ConfigParseError

This is an archive of the discontinued Mercurial Phabricator instance.

rhg: add support for detailed exit code for ConfigParseError
ClosedPublic

Authored by pulkit on Mar 23 2021, 4:39 PM.

Details

Summary

This patch adds basic support for detailed exit code to rhg with support for
ConfigParseError.

For now, if parsing the config results in error, we silently fallbacks to
false. The python version in this case emits a traceback.

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

pulkit created this revision.Mar 23 2021, 4:39 PM
SimonSapin accepted this revision.Mar 25 2021, 7:23 AM
SimonSapin added a subscriber: SimonSapin.

Looks good, thanks!

rust/rhg/src/error.rs
47

No need to change this unless you want to, but this line can be just detailed_exit_code,

(This is syntactic sugar in a struct literal when a field is initialized with a local variable of the same name.)

pulkit updated this revision to Diff 26575.Mar 25 2021, 5:01 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.