Show More
@@ -106,6 +106,13 class Abort(Exception): | |||
|
106 | 106 | def always(fn): return True |
|
107 | 107 | def never(fn): return False |
|
108 | 108 | |
|
109 | def patkind(name, dflt_pat='glob'): | |
|
110 | """Split a string into an optional pattern kind prefix and the | |
|
111 | actual pattern.""" | |
|
112 | for prefix in 're', 'glob', 'path', 'relglob', 'relpath', 'relre': | |
|
113 | if name.startswith(prefix + ':'): return name.split(':', 1) | |
|
114 | return dflt_pat, name | |
|
115 | ||
|
109 | 116 | def globre(pat, head='^', tail='$'): |
|
110 | 117 | "convert a glob pattern into a regexp" |
|
111 | 118 | i, n = 0, len(pat) |
@@ -220,11 +227,6 def _matcher(canonroot, cwd, names, inc, | |||
|
220 | 227 | make head regex a rooted bool |
|
221 | 228 | """ |
|
222 | 229 | |
|
223 | def patkind(name, dflt_pat='glob'): | |
|
224 | for prefix in 're', 'glob', 'path', 'relglob', 'relpath', 'relre': | |
|
225 | if name.startswith(prefix + ':'): return name.split(':', 1) | |
|
226 | return dflt_pat, name | |
|
227 | ||
|
228 | 230 | def contains_glob(name): |
|
229 | 231 | for c in name: |
|
230 | 232 | if c in _globchars: return True |
General Comments 0
You need to be logged in to leave comments.
Login now