##// END OF EJS Templates
match: move normalize() call out of matcher constructors...
Martin von Zweigbergk -
r32556:5f08eca8 default
parent child Browse files
Show More
@@ -145,9 +145,9 b' def match(root, cwd, patterns, include=N'
145 145 if exact:
146 146 m = exactmatcher(root, cwd, patterns, badfn)
147 147 elif patterns:
148 m = patternmatcher(root, cwd, normalize, patterns, default=default,
149 auditor=auditor, ctx=ctx, listsubrepos=listsubrepos,
150 warn=warn, badfn=badfn)
148 kindpats = normalize(patterns, default, root, cwd, auditor, warn)
149 m = patternmatcher(root, cwd, kindpats, ctx=ctx,
150 listsubrepos=listsubrepos, badfn=badfn)
151 151 else:
152 152 # It's a little strange that no patterns means to match everything.
153 153 # Consider changing this to match nothing (probably adding a
@@ -155,14 +155,14 b' def match(root, cwd, patterns, include=N'
155 155 m = alwaysmatcher(root, cwd, badfn)
156 156
157 157 if include:
158 im = includematcher(root, cwd, normalize, include, auditor=auditor,
159 ctx=ctx, listsubrepos=listsubrepos, warn=warn,
160 badfn=None)
158 kindpats = normalize(include, 'glob', root, cwd, auditor, warn)
159 im = includematcher(root, cwd, kindpats, ctx=ctx,
160 listsubrepos=listsubrepos, badfn=None)
161 161 m = intersectmatchers(m, im)
162 162 if exclude:
163 em = includematcher(root, cwd, normalize, exclude, auditor=auditor,
164 ctx=ctx, listsubrepos=listsubrepos, warn=warn,
165 badfn=None)
163 kindpats = normalize(exclude, 'glob', root, cwd, auditor, warn)
164 em = includematcher(root, cwd, kindpats, ctx=ctx,
165 listsubrepos=listsubrepos, badfn=None)
166 166 m = differencematcher(m, em)
167 167 return m
168 168
@@ -338,12 +338,10 b' class alwaysmatcher(basematcher):'
338 338
339 339 class patternmatcher(basematcher):
340 340
341 def __init__(self, root, cwd, normalize, patterns, default='glob',
342 auditor=None, ctx=None, listsubrepos=False, warn=None,
341 def __init__(self, root, cwd, kindpats, ctx=None, listsubrepos=False,
343 342 badfn=None):
344 343 super(patternmatcher, self).__init__(root, cwd, badfn)
345 344
346 kindpats = normalize(patterns, default, root, cwd, auditor, warn)
347 345 if not _kindpatsalwaysmatch(kindpats):
348 346 self._files = _explicitfiles(kindpats)
349 347 self._anypats = _anypats(kindpats)
@@ -383,11 +381,10 b' class patternmatcher(basematcher):'
383 381
384 382 class includematcher(basematcher):
385 383
386 def __init__(self, root, cwd, normalize, include, auditor=None, ctx=None,
387 listsubrepos=False, warn=None, badfn=None):
384 def __init__(self, root, cwd, kindpats, ctx=None, listsubrepos=False,
385 badfn=None):
388 386 super(includematcher, self).__init__(root, cwd, badfn)
389 387
390 kindpats = normalize(include, 'glob', root, cwd, auditor, warn)
391 388 self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)',
392 389 listsubrepos, root)
393 390 self._anypats = _anypats(kindpats)
General Comments 0
You need to be logged in to leave comments. Login now