Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 1062:6d5a62a549fa
pep-0008 cleanup
- Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value.
author | benoit.boissinot@ens-lyon.fr |
---|---|
date | Fri, 26 Aug 2005 13:06:58 +0200 |
parents | 503aaf19a040 |
children | e254bcbfe636 |
comparison
equal
deleted
inserted
replaced
1061:fed8d078840b | 1062:6d5a62a549fa |
---|---|
25 """Raised if a command needs to print an error and exit.""" | 25 """Raised if a command needs to print an error and exit.""" |
26 | 26 |
27 def always(fn): return True | 27 def always(fn): return True |
28 def never(fn): return False | 28 def never(fn): return False |
29 | 29 |
30 def globre(pat, head = '^', tail = '$'): | 30 def globre(pat, head='^', tail='$'): |
31 "convert a glob pattern into a regexp" | 31 "convert a glob pattern into a regexp" |
32 i, n = 0, len(pat) | 32 i, n = 0, len(pat) |
33 res = '' | 33 res = '' |
34 group = False | 34 group = False |
35 def peek(): return i < n and pat[i] | 35 def peek(): return i < n and pat[i] |
96 elif name == repo.root: | 96 elif name == repo.root: |
97 return '' | 97 return '' |
98 else: | 98 else: |
99 raise Abort('%s not under repository root' % myname) | 99 raise Abort('%s not under repository root' % myname) |
100 | 100 |
101 def matcher(repo, cwd, names, inc, exc, head = ''): | 101 def matcher(repo, cwd, names, inc, exc, head=''): |
102 def patkind(name): | 102 def patkind(name): |
103 for prefix in 're:', 'glob:', 'path:', 'relpath:': | 103 for prefix in 're:', 'glob:', 'path:', 'relpath:': |
104 if name.startswith(prefix): return name.split(':', 1) | 104 if name.startswith(prefix): return name.split(':', 1) |
105 for c in name: | 105 for c in name: |
106 if c in _globchars: return 'glob', name | 106 if c in _globchars: return 'glob', name |