mercurial/commands.py
changeset 6652 ffcf8e82f647
parent 6642 c8c7248f6172
child 6653 a78d8edaeedd
--- a/mercurial/commands.py	Fri Jun 06 18:31:57 2008 +0200
+++ b/mercurial/commands.py	Sat Jun 07 09:49:34 2008 +0200
@@ -1253,7 +1253,14 @@
         if with_version:
             version_(ui)
             ui.write('\n')
-        aliases, i = cmdutil.findcmd(ui, name, table)
+
+        try:
+            aliases, i = cmdutil.findcmd(ui, name, table)
+        except cmdutil.AmbiguousCommand, inst:
+            select = lambda c: c.lstrip('^').startswith(inst.args[0])
+            helplist(_('list of commands:\n\n'), select)
+            return
+
         # synopsis
         ui.write("%s\n" % i[2])