comparison mercurial/cmdutil.py @ 15600:195dbd1cef0c stable 2.0.1

alias: shortcut command matching show shadowing works properly (issue3104) An alias for 'log' was stored in the same command table as '^log|history'. If the hash function happens to give the latter first, the alias is effectively ignored when matching 'log'.
author Matt Mackall <mpm@selenic.com>
date Thu, 01 Dec 2011 15:51:36 -0600
parents cd6f10dccf16
children 36d7a0c7505f cfc15cbecc5e
comparison
equal deleted inserted replaced
15599:c6be93a4c378 15600:195dbd1cef0c
21 for each matching command. 21 for each matching command.
22 Return debug commands (or their aliases) only if no normal command matches. 22 Return debug commands (or their aliases) only if no normal command matches.
23 """ 23 """
24 choice = {} 24 choice = {}
25 debugchoice = {} 25 debugchoice = {}
26 for e in table.keys(): 26
27 if cmd in table:
28 # short-circuit exact matches, "log" alias beats "^log|history"
29 keys = [cmd]
30 else:
31 keys = table.keys()
32
33 for e in keys:
27 aliases = parsealiases(e) 34 aliases = parsealiases(e)
28 found = None 35 found = None
29 if cmd in aliases: 36 if cmd in aliases:
30 found = cmd 37 found = cmd
31 elif not strict: 38 elif not strict: