diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -226,6 +226,8 @@ def callcatch(ui, func): 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) 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 @@ should fail $ 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/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 @@ since bar is not touched in this commit, 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-merge1.t b/tests/test-merge1.t --- a/tests/test-merge1.t +++ b/tests/test-merge1.t @@ -139,7 +139,7 @@ symlinks shouldn't be followed 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-phases.t b/tests/test-phases.t --- a/tests/test-phases.t +++ b/tests/test-phases.t @@ -513,7 +513,7 @@ test invalid phase name transaction abort! rollback completed abort: phases.new-commit: not a valid phase name ('babar') - [255] + [30] Test phase command =================== 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 @@ Test error cases $ 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 @@ Test error cases $ 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