changeset 47414:7954ee2d7cf7

rhg: propogate error coming from HgError::Abort to CommandError Differential Revision: https://phab.mercurial-scm.org/D10839
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 07 Jun 2021 17:29:32 +0530
parents 6e49769b7f97
children 0ef8231e413f
files rust/rhg/src/error.rs tests/test-globalopts.t
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: