Patchwork D11828: errors: use detailed exit code for detected case-collision

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

Comments

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

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-casecollision.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-casecollision.t b/tests/test-casecollision.t
--- a/tests/test-casecollision.t
+++ b/tests/test-casecollision.t
@@ -12,7 +12,7 @@ 
   ? A
   $ hg add --config ui.portablefilenames=abort A
   abort: possible case-folding collision for A
-  [255]
+  [20]
   $ hg st
   A a
   ? A
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -341,7 +341,7 @@ 
         if fl in self._loweredfiles and f not in self._dirstate:
             msg = _(b'possible case-folding collision for %s') % f
             if self._abort:
-                raise error.Abort(msg)
+                raise error.StateError(msg)
             self._ui.warn(_(b"warning: %s\n") % msg)
         self._loweredfiles.add(fl)
         self._newfiles.add(f)