##// END OF EJS Templates
errors: name arguments to AmbiguousCommand constructor...
Martin von Zweigbergk -
r46271:65e2b646 default
parent child Browse files
Show More
@@ -489,7 +489,7 def _callcatch(ui, func):
489 except error.AmbiguousCommand as inst:
489 except error.AmbiguousCommand as inst:
490 ui.warn(
490 ui.warn(
491 _(b"hg: command '%s' is ambiguous:\n %s\n")
491 _(b"hg: command '%s' is ambiguous:\n %s\n")
492 % (inst.args[0], b" ".join(inst.args[1]))
492 % (inst.prefix, b" ".join(inst.matches))
493 )
493 )
494 except error.CommandError as inst:
494 except error.CommandError as inst:
495 if inst.command:
495 if inst.command:
@@ -117,6 +117,11 class UnknownCommand(Exception):
117 class AmbiguousCommand(Exception):
117 class AmbiguousCommand(Exception):
118 """Exception raised if command shortcut matches more than one command."""
118 """Exception raised if command shortcut matches more than one command."""
119
119
120 def __init__(self, prefix, matches):
121 self.prefix = prefix
122 self.matches = matches
123 super(AmbiguousCommand, self).__init__()
124
120 __bytes__ = _tobytes
125 __bytes__ = _tobytes
121
126
122
127
@@ -713,7 +713,7 def help_(
713 except error.AmbiguousCommand as inst:
713 except error.AmbiguousCommand as inst:
714 # py3 fix: except vars can't be used outside the scope of the
714 # py3 fix: except vars can't be used outside the scope of the
715 # except block, nor can be used inside a lambda. python issue4617
715 # except block, nor can be used inside a lambda. python issue4617
716 prefix = inst.args[0]
716 prefix = inst.prefix
717 select = lambda c: cmdutil.parsealiases(c)[0].startswith(prefix)
717 select = lambda c: cmdutil.parsealiases(c)[0].startswith(prefix)
718 rst = helplist(select)
718 rst = helplist(select)
719 return rst
719 return rst
General Comments 0
You need to be logged in to leave comments. Login now