[PATCH 4 of 5] allow help to show a subset of the command list instead of
Johannes Stezenbach
js at sig21.net
Sat May 24 21:11:08 UTC 2008
# HG changeset patch
# User Johannes Stezenbach <js at sig21.net>
# Date 1211660305 -7200
# Node ID 2997131eab6d4a92f4299cb40add962f3c850b03
# Parent fa4fc9c14e654aa2be3e40ba11a75639ba47d61e
allow help to show a subset of the command list instead of
the "command %s is ambiguous" error message
diff -r fa4fc9c14e65 -r 2997131eab6d mercurial/commands.py
--- a/mercurial/commands.py Sat May 24 21:47:07 2008 +0200
+++ b/mercurial/commands.py Sat May 24 22:18:25 2008 +0200
@@ -1254,7 +1254,12 @@
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:
+ helplist(_('list of commands:\n\n'), lambda c: c.lstrip('^') in inst.args[1])
+ return
+
# synopsis
ui.write("%s\n" % i[2])
More information about the Mercurial-devel
mailing list