This instance will be upgraded to Heptapod 0.21.0rc3 on 2021-04-23 at 10:30 UTC+2 (a few minutes of down time)

Commit ed1b04b0 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

errors: set detailed exit code to 30 for config errors

This is per https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

Differential Revision: https://phab.mercurial-scm.org/D9311
parent 527ce85c2e60
......@@ -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)
......
......@@ -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]
......
......@@ -333,7 +333,7 @@ since bar is not touched in this commit, this copy will not be detected
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]
......
......@@ -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
......
......@@ -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
===================
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment