comparison mercurial/commands.py @ 1849:360d0f8d9d6f

Show ambiguous aliases, if they are not simple abbreviations. Sort output.
author Thomas Arendsen Hein <thomas@intevation.de>
date Tue, 07 Mar 2006 08:41:13 +0100
parents bb70ffebe77b
children 05f6c0d1bad8
comparison
equal deleted inserted replaced
1848:bb70ffebe77b 1849:360d0f8d9d6f
2687 if a.startswith(cmd): 2687 if a.startswith(cmd):
2688 choice.append([aliases, table[e]]) 2688 choice.append([aliases, table[e]])
2689 break 2689 break
2690 2690
2691 if len(choice) > 1: 2691 if len(choice) > 1:
2692 clist = [x[0][0] for x in choice] 2692 clist = []
2693 for aliases, table_e in choice:
2694 if aliases[0].startswith(cmd):
2695 clist.append(aliases[0])
2696 for a in aliases[1:]:
2697 if a.startswith(cmd) and not aliases[0].startswith(a):
2698 clist.append(a)
2699 clist.sort()
2693 raise AmbiguousCommand(cmd, clist) 2700 raise AmbiguousCommand(cmd, clist)
2694 2701
2695 if choice: 2702 if choice:
2696 return choice[0] 2703 return choice[0]
2697 2704