diff -r 2555f441a32f -r 36d7a0c7505f mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Dec 01 01:42:03 2011 -0600 +++ b/mercurial/cmdutil.py Thu Dec 01 15:57:10 2011 -0600 @@ -23,7 +23,14 @@ """ choice = {} debugchoice = {} - for e in table.keys(): + + if cmd in table: + # short-circuit exact matches, "log" alias beats "^log|history" + keys = [cmd] + else: + keys = table.keys() + + for e in keys: aliases = parsealiases(e) found = None if cmd in aliases: