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