Show More
@@ -223,14 +223,15 def make_file(repo, pat, node=None, | |||
|
223 | 223 | pathname), |
|
224 | 224 | mode) |
|
225 | 225 | |
|
226 |
def matchpats(repo, pats=[], opts={}, globbed=False, default= |
|
|
227 | cwd = repo.getcwd() | |
|
228 | return util.cmdmatcher(repo.root, cwd, pats or [], opts.get('include'), | |
|
229 | opts.get('exclude'), globbed=globbed, | |
|
230 | default=default) | |
|
226 | def matchpats(repo, pats=[], opts={}, globbed=False, default='relpath'): | |
|
227 | pats = pats or [] | |
|
228 | if not globbed and default == 'relpath': | |
|
229 | pats = util.expand_glob(pats or []) | |
|
230 | return util.matcher(repo.root, repo.getcwd(), pats, opts.get('include'), | |
|
231 | opts.get('exclude'), None, default) | |
|
231 | 232 | |
|
232 | 233 | def walk(repo, pats=[], opts={}, node=None, badmatch=None, globbed=False, |
|
233 |
default= |
|
|
234 | default='relpath'): | |
|
234 | 235 | files, matchfn, anypats = matchpats(repo, pats, opts, globbed=globbed, |
|
235 | 236 | default=default) |
|
236 | 237 | exact = dict.fromkeys(files) |
@@ -412,17 +412,7 def canonpath(root, cwd, myname): | |||
|
412 | 412 | |
|
413 | 413 | raise Abort('%s not under root' % myname) |
|
414 | 414 | |
|
415 | def matcher(canonroot, cwd='', names=[], inc=[], exc=[], src=None): | |
|
416 | return _matcher(canonroot, cwd, names, inc, exc, 'glob', src) | |
|
417 | ||
|
418 | def cmdmatcher(canonroot, cwd='', names=[], inc=[], exc=[], src=None, | |
|
419 | globbed=False, default=None): | |
|
420 | default = default or 'relpath' | |
|
421 | if default == 'relpath' and not globbed: | |
|
422 | names = expand_glob(names) | |
|
423 | return _matcher(canonroot, cwd, names, inc, exc, default, src) | |
|
424 | ||
|
425 | def _matcher(canonroot, cwd, names, inc, exc, dflt_pat, src): | |
|
415 | def matcher(canonroot, cwd='', names=[], inc=[], exc=[], src=None, dflt_pat='glob'): | |
|
426 | 416 | """build a function to match a set of file patterns |
|
427 | 417 | |
|
428 | 418 | arguments: |
General Comments 0
You need to be logged in to leave comments.
Login now