Show More
@@ -106,6 +106,13 b' class Abort(Exception):' | |||||
106 | def always(fn): return True |
|
106 | def always(fn): return True | |
107 | def never(fn): return False |
|
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 | def globre(pat, head='^', tail='$'): |
|
116 | def globre(pat, head='^', tail='$'): | |
110 | "convert a glob pattern into a regexp" |
|
117 | "convert a glob pattern into a regexp" | |
111 | i, n = 0, len(pat) |
|
118 | i, n = 0, len(pat) | |
@@ -220,11 +227,6 b' def _matcher(canonroot, cwd, names, inc,' | |||||
220 | make head regex a rooted bool |
|
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 | def contains_glob(name): |
|
230 | def contains_glob(name): | |
229 | for c in name: |
|
231 | for c in name: | |
230 | if c in _globchars: return True |
|
232 | if c in _globchars: return True |
General Comments 0
You need to be logged in to leave comments.
Login now