##// END OF EJS Templates
match: allow passing a context object to match core
Matt Mackall -
r14674:1c151b96 default
parent child Browse files
Show More
@@ -212,7 +212,8 class changectx(object):
212 212 def match(self, pats=[], include=None, exclude=None, default='glob'):
213 213 r = self._repo
214 214 return matchmod.match(r.root, r.getcwd(), pats,
215 include, exclude, default, auditor=r.auditor)
215 include, exclude, default,
216 auditor=r.auditor, ctx=self)
216 217
217 218 def diff(self, ctx2=None, match=None, **opts):
218 219 """Returns a diff generator for the given contexts and matcher"""
@@ -11,7 +11,7 from i18n import _
11 11
12 12 class match(object):
13 13 def __init__(self, root, cwd, patterns, include=[], exclude=[],
14 default='glob', exact=False, auditor=None):
14 default='glob', exact=False, auditor=None, ctx=None):
15 15 """build an object to match a set of file patterns
16 16
17 17 arguments:
@@ -37,6 +37,7 class match(object):
37 37 self._cwd = cwd
38 38 self._files = []
39 39 self._anypats = bool(include or exclude)
40 self._ctx = ctx
40 41
41 42 if include:
42 43 pats = _normalize(include, 'glob', root, cwd, auditor)
General Comments 0
You need to be logged in to leave comments. Login now