Show More
@@ -341,36 +341,21 b' class patternmatcher(basematcher):' | |||||
341 | def __init__(self, root, cwd, normalize, patterns, default='glob', |
|
341 | def __init__(self, root, cwd, normalize, patterns, default='glob', | |
342 | auditor=None, ctx=None, listsubrepos=False, warn=None, |
|
342 | auditor=None, ctx=None, listsubrepos=False, warn=None, | |
343 | badfn=None): |
|
343 | badfn=None): | |
344 |
super(patternmatcher, self).__init__(root, cwd, badfn |
|
344 | super(patternmatcher, self).__init__(root, cwd, badfn) | |
345 | relativeuipath=bool(patterns)) |
|
|||
346 |
|
||||
347 | self._anypats = False |
|
|||
348 | self._always = False |
|
|||
349 | self.patternspat = None |
|
|||
350 |
|
345 | |||
351 | matchfns = [] |
|
346 | kindpats = normalize(patterns, default, root, cwd, auditor, warn) | |
352 | if patterns: |
|
347 | if not _kindpatsalwaysmatch(kindpats): | |
353 | kindpats = normalize(patterns, default, root, cwd, auditor, warn) |
|
348 | self._files = _explicitfiles(kindpats) | |
354 |
|
|
349 | self._anypats = _anypats(kindpats) | |
355 | self._files = _explicitfiles(kindpats) |
|
350 | self.patternspat, pm = _buildmatch(ctx, kindpats, '$', | |
356 | self._anypats = self._anypats or _anypats(kindpats) |
|
351 | listsubrepos, root) | |
357 | self.patternspat, pm = _buildmatch(ctx, kindpats, '$', |
|
352 | self._always = False | |
358 | listsubrepos, root) |
|
353 | self.matchfn = pm | |
359 | matchfns.append(pm) |
|
354 | else: | |
360 |
|
355 | self._anypats = False | ||
361 | if not matchfns: |
|
356 | self.patternspat = None | |
362 | m = util.always |
|
|||
363 | self._always = True |
|
357 | self._always = True | |
364 |
el |
|
358 | self.matchfn = lambda f: True | |
365 | m = matchfns[0] |
|
|||
366 | else: |
|
|||
367 | def m(f): |
|
|||
368 | for matchfn in matchfns: |
|
|||
369 | if not matchfn(f): |
|
|||
370 | return False |
|
|||
371 | return True |
|
|||
372 |
|
||||
373 | self.matchfn = m |
|
|||
374 |
|
359 | |||
375 | @propertycache |
|
360 | @propertycache | |
376 | def _dirs(self): |
|
361 | def _dirs(self): |
General Comments 0
You need to be logged in to leave comments.
Login now