##// END OF EJS Templates
errors: name arguments to UnknownCommand constructor...
Martin von Zweigbergk -
r46272:bb1a988e default
parent child Browse files
Show More
@@ -504,19 +504,19 def _callcatch(ui, func):
504 504 _formatparse(ui.warn, inst)
505 505 return -1
506 506 except error.UnknownCommand as inst:
507 nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.args[0]
507 nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.command
508 508 try:
509 509 # check if the command is in a disabled extension
510 510 # (but don't check for extensions themselves)
511 511 formatted = help.formattedhelp(
512 ui, commands, inst.args[0], unknowncmd=True
512 ui, commands, inst.command, unknowncmd=True
513 513 )
514 514 ui.warn(nocmdmsg)
515 515 ui.write(formatted)
516 516 except (error.UnknownCommand, error.Abort):
517 517 suggested = False
518 if len(inst.args) == 2:
519 sim = _getsimilar(inst.args[1], inst.args[0])
518 if inst.all_commands:
519 sim = _getsimilar(inst.all_commands, inst.command)
520 520 if sim:
521 521 ui.warn(nocmdmsg)
522 522 _reportsimilar(ui.warn, sim)
@@ -111,6 +111,11 class CommandError(Exception):
111 111 class UnknownCommand(Exception):
112 112 """Exception raised if command is not in the command table."""
113 113
114 def __init__(self, command, all_commands=None):
115 self.command = command
116 self.all_commands = all_commands
117 super(UnknownCommand, self).__init__()
118
114 119 __bytes__ = _tobytes
115 120
116 121
General Comments 0
You need to be logged in to leave comments. Login now