Patchwork D11663: narrow: raise StateError when working copy is stale (for detailed exit code)

login
register
mail settings
Submitter phabricator
Date Oct. 14, 2021, 3:58 p.m.
Message ID <differential-rev-PHID-DREV-td6iomqvfitgxivjct77-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49987/
State Superseded
Headers show

Comments

phabricator - Oct. 14, 2021, 3: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/D11663

AFFECTED FILES
  mercurial/narrowspec.py
  tests/test-narrow-share.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-narrow-share.t b/tests/test-narrow-share.t
--- a/tests/test-narrow-share.t
+++ b/tests/test-narrow-share.t
@@ -100,7 +100,7 @@ 
   $ hg -R main files
   abort: working copy's narrowspec is stale
   (run 'hg tracked --update-working-copy')
-  [255]
+  [20]
   $ hg -R main tracked --update-working-copy
   not deleting possibly dirty file d3/f
   not deleting possibly dirty file d3/g
@@ -138,7 +138,7 @@ 
   $ hg -R main files
   abort: working copy's narrowspec is stale
   (run 'hg tracked --update-working-copy')
-  [255]
+  [20]
   $ hg -R main tracked --update-working-copy
 # d1/f, d3/f should be back
   $ hg -R main files
@@ -189,7 +189,7 @@ 
   $ hg ci -Am test
   abort: working copy's narrowspec is stale
   (run 'hg tracked --update-working-copy')
-  [255]
+  [20]
   $ hg tracked --update-working-copy
   $ hg st
   M d1/f
diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -299,7 +299,7 @@ 
     storespec = repo.svfs.tryread(FILENAME)
     wcspec = repo.vfs.tryread(DIRSTATE_FILENAME)
     if wcspec != storespec:
-        raise error.Abort(
+        raise error.StateError(
             _(b"working copy's narrowspec is stale"),
             hint=_(b"run 'hg tracked --update-working-copy'"),
         )