[Updated] D10839: rhg: propogate error coming from HgError::Abort to CommandError

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Jun 11 07:46:22 UTC 2021


Closed by commit rHG7954ee2d7cf7: rhg: propogate error coming from HgError::Abort to CommandError (authored by pulkit).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10839?vs=28538&id=28547

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10839/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10839

AFFECTED FILES
  rust/rhg/src/error.rs
  tests/test-globalopts.t

CHANGE DETAILS

diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -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:
 
diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -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()),
         }
     }



To: pulkit, #hg-reviewers, Alphare
Cc: SimonSapin, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210611/176a0da7/attachment-0002.html>


More information about the Mercurial-patches mailing list