diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -694,7 +694,7 @@ class cmdalias(object): hint = _(b"'%s' is provided by '%s' extension") % (cmd, ext) except error.UnknownCommand: pass - raise error.Abort(self.badalias, hint=hint) + raise error.ConfigError(self.badalias, hint=hint) if self.shadows: ui.debug( b"alias '%s' shadows command '%s'\n" % (self.name, self.cmdname) diff --git a/tests/test-alias.t b/tests/test-alias.t --- a/tests/test-alias.t +++ b/tests/test-alias.t @@ -208,8 +208,8 @@ help unknown $ hg unknown - abort: alias 'unknown' resolves to unknown command 'bargle' - [255] + config error: alias 'unknown' resolves to unknown command 'bargle' + [30] $ hg help unknown alias 'unknown' resolves to unknown command 'bargle' @@ -217,8 +217,8 @@ unknown ambiguous $ hg ambiguous - abort: alias 'ambiguous' resolves to ambiguous command 's' - [255] + config error: alias 'ambiguous' resolves to ambiguous command 's' + [30] $ hg help ambiguous alias 'ambiguous' resolves to ambiguous command 's' @@ -226,8 +226,8 @@ ambiguous recursive $ hg recursive - abort: alias 'recursive' resolves to unknown command 'recursive' - [255] + config error: alias 'recursive' resolves to unknown command 'recursive' + [30] $ hg help recursive alias 'recursive' resolves to unknown command 'recursive' @@ -235,9 +235,9 @@ recursive disabled $ hg disabled - abort: alias 'disabled' resolves to unknown command 'email' + config error: alias 'disabled' resolves to unknown command 'email' ('email' is provided by 'patchbomb' extension) - [255] + [30] $ hg help disabled alias 'disabled' resolves to unknown command 'email' @@ -251,8 +251,8 @@ disabled no definition $ hg nodef - abort: no definition for alias 'nodefinition' - [255] + config error: no definition for alias 'nodefinition' + [30] $ hg help nodef no definition for alias 'nodefinition' @@ -260,8 +260,8 @@ no definition no closing quotation $ hg noclosing - abort: error in definition for alias 'noclosingquotation': No closing quotation - [255] + config error: error in definition for alias 'noclosingquotation': No closing quotation + [30] $ hg help noclosing error in definition for alias 'noclosingquotation': No closing quotation @@ -275,37 +275,37 @@ no closing quotation invalid options $ hg no--cwd - abort: error in definition for alias 'no--cwd': --cwd may only be given on the command line - [255] + config error: error in definition for alias 'no--cwd': --cwd may only be given on the command line + [30] $ hg help no--cwd error in definition for alias 'no--cwd': --cwd may only be given on the command line $ hg no-R - abort: error in definition for alias 'no-R': -R may only be given on the command line - [255] + config error: error in definition for alias 'no-R': -R may only be given on the command line + [30] $ hg help no-R error in definition for alias 'no-R': -R may only be given on the command line $ hg no--repo - abort: error in definition for alias 'no--repo': --repo may only be given on the command line - [255] + config error: error in definition for alias 'no--repo': --repo may only be given on the command line + [30] $ hg help no--repo error in definition for alias 'no--repo': --repo may only be given on the command line $ hg no--repository - abort: error in definition for alias 'no--repository': --repository may only be given on the command line - [255] + config error: error in definition for alias 'no--repository': --repository may only be given on the command line + [30] $ hg help no--repository error in definition for alias 'no--repository': --repository may only be given on the command line $ hg no--config - abort: error in definition for alias 'no--config': --config may only be given on the command line - [255] + config error: error in definition for alias 'no--config': --config may only be given on the command line + [30] $ hg no --config alias.no='--repo elsewhere --cwd elsewhere status' - abort: error in definition for alias 'no': --repo/--cwd may only be given on the command line - [255] + config error: error in definition for alias 'no': --repo/--cwd may only be given on the command line + [30] $ hg no --config alias.no='--repo elsewhere' - abort: error in definition for alias 'no': --repo may only be given on the command line - [255] + config error: error in definition for alias 'no': --repo may only be given on the command line + [30] optional repository @@ -631,11 +631,11 @@ invalid character in user-specified help $ hg help invalidhelp non-ASCII character in alias definition 'invalidhelp:help' $ hg invaliddoc - abort: non-ASCII character in alias definition 'invaliddoc:doc' - [255] + config error: non-ASCII character in alias definition 'invaliddoc:doc' + [30] $ hg invalidhelp - abort: non-ASCII character in alias definition 'invalidhelp:help' - [255] + config error: non-ASCII character in alias definition 'invalidhelp:help' + [30] invalid arguments