comparison mercurial/cmdutil.py @ 10401:6252852b4332

mq: add -Q option to all commands not in norepo
author Brendan Cully <brendan@kublai.com>
date Mon, 08 Feb 2010 10:23:44 +0100
parents 9501cde4c034
children d216fa04e48a
comparison
equal deleted inserted replaced
10400:fb203201ce30 10401:6252852b4332
10 import os, sys, errno, re, glob, tempfile, time 10 import os, sys, errno, re, glob, tempfile, time
11 import mdiff, bdiff, util, templater, patch, error, encoding, templatekw 11 import mdiff, bdiff, util, templater, patch, error, encoding, templatekw
12 import match as _match 12 import match as _match
13 13
14 revrangesep = ':' 14 revrangesep = ':'
15
16 def parsealiases(cmd):
17 return cmd.lstrip("^").split("|")
15 18
16 def findpossible(cmd, table, strict=False): 19 def findpossible(cmd, table, strict=False):
17 """ 20 """
18 Return cmd -> (aliases, command table entry) 21 Return cmd -> (aliases, command table entry)
19 for each matching command. 22 for each matching command.
20 Return debug commands (or their aliases) only if no normal command matches. 23 Return debug commands (or their aliases) only if no normal command matches.
21 """ 24 """
22 choice = {} 25 choice = {}
23 debugchoice = {} 26 debugchoice = {}
24 for e in table.keys(): 27 for e in table.keys():
25 aliases = e.lstrip("^").split("|") 28 aliases = parsealiases(e)
26 found = None 29 found = None
27 if cmd in aliases: 30 if cmd in aliases:
28 found = cmd 31 found = cmd
29 elif not strict: 32 elif not strict:
30 for a in aliases: 33 for a in aliases: