Patchwork D11827: errors: use detailed exit code when trying to merge file outside narrowspec

login
register
mail settings
Submitter phabricator
Date Nov. 29, 2021, 9:58 p.m.
Message ID <differential-rev-PHID-DREV-e6mcc5oq47vwxb2ofq5m-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50152/
State Superseded
Headers show

Comments

phabricator - Nov. 29, 2021, 9:58 p.m.
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/merge.py
  tests/test-narrow-merge.t
  tests/test-narrow-rebase.t

CHANGE DETAILS




To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-narrow-rebase.t b/tests/test-narrow-rebase.t
--- a/tests/test-narrow-rebase.t
+++ b/tests/test-narrow-rebase.t
@@ -96,4 +96,4 @@ 
   $ hg rebase -d 'desc("modify outside/f1")'
   rebasing 4:707c035aadb6 "conflicting outside/f1"
   abort: conflict in file 'outside/f1' is outside narrow clone
-  [255]
+  [20]
diff --git a/tests/test-narrow-merge.t b/tests/test-narrow-merge.t
--- a/tests/test-narrow-merge.t
+++ b/tests/test-narrow-merge.t
@@ -101,4 +101,4 @@ 
   $ hg merge 'desc("conflicting outside/f1")'
   abort: conflict in file 'outside/f1' is outside narrow clone (flat !)
   abort: conflict in file 'outside/' is outside narrow clone (tree !)
-  [255]
+  [20]
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -542,7 +542,7 @@ 
                 hint=_(b'merging in the other direction may work'),
             )
         else:
-            raise error.Abort(
+            raise error.StateError(
                 _(b'conflict in file \'%s\' is outside narrow clone') % f
             )