# HG changeset patch # User Thomas Arendsen Hein # Date 1141717579 -3600 # Node ID 05f6c0d1bad8d7393158e8ff477c6a324eace485 # Parent 360d0f8d9d6f8201afd79fbc7619195ed4af3d09 Hide debug commands in ambiguous command list, unless no normal command matches. This will execute diff if 'hg d' is typed and hide rawcommit on 'hg r'. Based on a patch by TK Soh. diff -r 360d0f8d9d6f -r 05f6c0d1bad8 mercurial/commands.py --- a/mercurial/commands.py Tue Mar 07 08:41:13 2006 +0100 +++ b/mercurial/commands.py Tue Mar 07 08:46:19 2006 +0100 @@ -2679,15 +2679,22 @@ def find(cmd): """Return (aliases, command table entry) for command string.""" choice = [] + debugchoice = [] for e in table.keys(): aliases = e.lstrip("^").split("|") if cmd in aliases: return aliases, table[e] for a in aliases: if a.startswith(cmd): - choice.append([aliases, table[e]]) + if aliases[0].startswith("debug"): + debugchoice.append([aliases, table[e]]) + else: + choice.append([aliases, table[e]]) break + if not choice and debugchoice: + choice = debugchoice + if len(choice) > 1: clist = [] for aliases, table_e in choice: