Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 6595:99a92acafdb9
remove default arg from patkind
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 May 2008 11:37:08 -0500 |
parents | e08e0367ba15 |
children | 33045179d079 |
comparison
equal
deleted
inserted
replaced
6594:fca1688f0459 | 6595:99a92acafdb9 |
---|---|
275 continue | 275 continue |
276 # if we couldn't expand the glob, just keep it around | 276 # if we couldn't expand the glob, just keep it around |
277 ret.append(p) | 277 ret.append(p) |
278 return ret | 278 return ret |
279 | 279 |
280 def patkind(name, dflt_pat='glob'): | 280 def patkind(name, default): |
281 """Split a string into an optional pattern kind prefix and the | 281 """Split a string into an optional pattern kind prefix and the |
282 actual pattern.""" | 282 actual pattern.""" |
283 for prefix in 're', 'glob', 'path', 'relglob', 'relpath', 'relre': | 283 for prefix in 're', 'glob', 'path', 'relglob', 'relpath', 'relre': |
284 if name.startswith(prefix + ':'): return name.split(':', 1) | 284 if name.startswith(prefix + ':'): return name.split(':', 1) |
285 return dflt_pat, name | 285 return default, name |
286 | 286 |
287 def globre(pat, head='^', tail='$'): | 287 def globre(pat, head='^', tail='$'): |
288 "convert a glob pattern into a regexp" | 288 "convert a glob pattern into a regexp" |
289 i, n = 0, len(pat) | 289 i, n = 0, len(pat) |
290 res = '' | 290 res = '' |