Mercurial > hg
diff hgext/alias.py @ 7643:9a1ea6587557
error: move UnknownCommand and AmbiguousCommand
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 Jan 2009 11:39:38 -0600 |
parents | b4c035057d34 |
children | a0104303f400 |
line wrap: on
line diff
--- a/hgext/alias.py Mon Jan 12 11:28:30 2009 -0600 +++ b/hgext/alias.py Mon Jan 12 11:39:38 2009 -0600 @@ -9,9 +9,8 @@ mycmd = cmd --args ''' -from mercurial.cmdutil import findcmd, UnknownCommand, AmbiguousCommand -from mercurial import commands from mercurial.i18n import _ +from mercurial import commands, cmdutil, error cmdtable = {} @@ -43,16 +42,16 @@ return try: - self._cmd = findcmd(self._target, commands.table, False)[1] + self._cmd = cmdutil.findcmd(self._target, commands.table, False)[1] if self._cmd == self: raise RecursiveCommand() if self._target in commands.norepo.split(' '): commands.norepo += ' %s' % self._name return - except UnknownCommand: + except error.UnknownCommand: msg = _('*** [alias] %s: command %s is unknown') % \ (self._name, self._target) - except AmbiguousCommand: + except error.AmbiguousCommand: msg = _('*** [alias] %s: command %s is ambiguous') % \ (self._name, self._target) except RecursiveCommand: