Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dispatch.py @ 22164:efd65e51bc0b
alias: exit from bad definition by Abort
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 13 Aug 2014 22:22:24 +0900 |
parents | 01ef4347e4ab |
children | b13b99d39a46 |
line wrap: on
line diff
--- a/mercurial/dispatch.py Wed Aug 13 22:18:28 2014 +0900 +++ b/mercurial/dispatch.py Wed Aug 13 22:22:24 2014 +0900 @@ -443,16 +443,15 @@ def __call__(self, ui, *args, **opts): if self.badalias: - ui.warn(self.badalias + '\n') + hint = None if self.unknowncmd: try: # check if the command is in a disabled extension cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2] - ui.warn(_("'%s' is provided by '%s' extension\n") - % (cmd, ext)) + hint = _("'%s' is provided by '%s' extension") % (cmd, ext) except error.UnknownCommand: pass - return -1 + raise util.Abort(self.badalias, hint=hint) if self.shadows: ui.debug("alias '%s' shadows command '%s'\n" % (self.name, self.cmdname))