##// END OF EJS Templates
scmutil: match now accepts a context or a repo
Matt Mackall -
r14670:19197fa4 default
parent child Browse files
Show More
@@ -558,12 +558,19 b' def expandpats(pats):'
558 ret.append(p)
558 ret.append(p)
559 return ret
559 return ret
560
560
561 def match(repo, pats=[], opts={}, globbed=False, default='relpath'):
561 def match(ctxorrepo, pats=[], opts={}, globbed=False, default='relpath'):
562 if pats == ("",):
562 if pats == ("",):
563 pats = []
563 pats = []
564 if not globbed and default == 'relpath':
564 if not globbed and default == 'relpath':
565 pats = expandpats(pats or [])
565 pats = expandpats(pats or [])
566 m = repo[None].match(pats, opts.get('include'), opts.get('exclude'),
566
567 if hasattr(ctxorrepo, 'match'):
568 ctx = ctxorrepo
569 else:
570 # will eventually abort here
571 ctx = ctxorrepo[None]
572
573 m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
567 default)
574 default)
568 def badfn(f, msg):
575 def badfn(f, msg):
569 repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
576 repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
General Comments 0
You need to be logged in to leave comments. Login now