[Updated] D9311: errors: set detailed exit code to 30 for config errors

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Nov 17 06:11:36 UTC 2020


Closed by commit rHGbff719525815: errors: set detailed exit code to 30 for config errors (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9311?vs=23491&id=23522

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

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

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-add.t
  tests/test-convert-git.t
  tests/test-merge1.t
  tests/test-phases.t
  tests/test-repo-compengines.t

CHANGE DETAILS

diff --git a/tests/test-repo-compengines.t b/tests/test-repo-compengines.t
--- a/tests/test-repo-compengines.t
+++ b/tests/test-repo-compengines.t
@@ -131,7 +131,7 @@
   $ commitone zlib-level-invalid
   abort: storage.revlog.zlib.level is not a valid integer ('foobar')
   abort: storage.revlog.zlib.level is not a valid integer ('foobar')
-  [255]
+  [30]
 
   $ hg init zlib-level-out-of-range
   $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc
@@ -188,7 +188,7 @@
   $ commitone zstd-level-invalid
   abort: storage.revlog.zstd.level is not a valid integer ('foobar')
   abort: storage.revlog.zstd.level is not a valid integer ('foobar')
-  [255]
+  [30]
 
   $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd
   $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc
diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -513,7 +513,7 @@
   transaction abort!
   rollback completed
   abort: phases.new-commit: not a valid phase name ('babar')
-  [255]
+  [30]
 Test phase command
 ===================
 
diff --git a/tests/test-merge1.t b/tests/test-merge1.t
--- a/tests/test-merge1.t
+++ b/tests/test-merge1.t
@@ -139,7 +139,7 @@
 bad config
   $ hg merge 1 --config merge.checkunknown=x
   abort: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn')
-  [255]
+  [30]
 this merge should fail
   $ hg merge 1 --config merge.checkunknown=abort
   b: untracked file differs
diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -333,7 +333,7 @@
 input validation
   $ hg convert --config convert.git.similarity=foo --datesort git-repo2 fullrepo
   abort: convert.git.similarity is not a valid integer ('foo')
-  [255]
+  [30]
   $ hg convert --config convert.git.similarity=-1 --datesort git-repo2 fullrepo
   abort: similarity must be between 0 and 100
   [255]
diff --git a/tests/test-add.t b/tests/test-add.t
--- a/tests/test-add.t
+++ b/tests/test-add.t
@@ -45,7 +45,7 @@
   $ echo foo > con.xml
   $ hg --config ui.portablefilenames=jump add con.xml
   abort: ui.portablefilenames value is invalid ('jump')
-  [255]
+  [30]
   $ hg --config ui.portablefilenames=abort add con.xml
   abort: filename contains 'con', which is reserved on Windows: con.xml
   [255]
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -226,6 +226,8 @@
             detailed_exit_code = 10
         elif isinstance(inst, error.StateError):
             detailed_exit_code = 20
+        elif isinstance(inst, error.ConfigError):
+            detailed_exit_code = 30
         ui.error(_(b"abort: %s\n") % inst.message)
         if inst.hint:
             ui.error(_(b"(%s)\n") % inst.hint)



To: martinvonz, #hg-reviewers, mharbison72
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201117/254c5f6b/attachment-0002.html>


More information about the Mercurial-patches mailing list