rhg: propogate error coming from HgError::Abort to CommandError
Differential Revision: https://phab.mercurial-scm.org/D10839
--- a/rust/rhg/src/error.rs Mon Jun 07 17:27:49 2021 +0530
+++ b/rust/rhg/src/error.rs Mon Jun 07 17:29:32 2021 +0530
@@ -69,6 +69,12 @@
HgError::UnsupportedFeature(message) => {
CommandError::unsupported(message)
}
+ HgError::Abort {
+ message,
+ detailed_exit_code,
+ } => {
+ CommandError::abort_with_exit_code(message, detailed_exit_code)
+ }
_ => CommandError::abort(error.to_string()),
}
}
--- a/tests/test-globalopts.t Mon Jun 07 17:27:49 2021 +0530
+++ b/tests/test-globalopts.t Mon Jun 07 17:29:32 2021 +0530
@@ -220,7 +220,6 @@
$ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
quuxfoo
TODO: add rhg support for detailed exit codes
-#if no-rhg
$ hg --cwd c --config '' tip -q
abort: malformed --config option: '' (use --config section.name=value)
[10]
@@ -236,7 +235,6 @@
$ hg --cwd c --config .b= tip -q
abort: malformed --config option: '.b=' (use --config section.name=value)
[10]
-#endif
Testing --debug: