##// END OF EJS Templates
match: minor cleanups to patternmatcher and includematcher...
Martin von Zweigbergk -
r33306:a9808bd1 default
parent child Browse files
Show More
@@ -358,9 +358,8 b' class patternmatcher(basematcher):'
358 358
359 359 self._files = _explicitfiles(kindpats)
360 360 self._anypats = _anypats(kindpats)
361 self.patternspat, pm = _buildmatch(ctx, kindpats, '$', listsubrepos,
362 root)
363 self.matchfn = pm
361 self._pats, self.matchfn = _buildmatch(ctx, kindpats, '$', listsubrepos,
362 root)
364 363
365 364 @propertycache
366 365 def _dirs(self):
@@ -379,7 +378,7 b' class patternmatcher(basematcher):'
379 378 return self._anypats
380 379
381 380 def __repr__(self):
382 return ('<patternmatcher patterns=%r>' % self.patternspat)
381 return ('<patternmatcher patterns=%r>' % self._pats)
383 382
384 383 class includematcher(basematcher):
385 384
@@ -387,15 +386,14 b' class includematcher(basematcher):'
387 386 badfn=None):
388 387 super(includematcher, self).__init__(root, cwd, badfn)
389 388
390 self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)',
391 listsubrepos, root)
389 self._pats, self.matchfn = _buildmatch(ctx, kindpats, '(?:/|$)',
390 listsubrepos, root)
392 391 self._anypats = _anypats(kindpats)
393 392 roots, dirs = _rootsanddirs(kindpats)
394 393 # roots are directories which are recursively included.
395 394 self._roots = set(roots)
396 395 # dirs are directories which are non-recursively included.
397 396 self._dirs = set(dirs)
398 self.matchfn = im
399 397
400 398 def visitdir(self, dir):
401 399 if not self._anypats and dir in self._roots:
@@ -411,7 +409,7 b' class includematcher(basematcher):'
411 409 return True
412 410
413 411 def __repr__(self):
414 return ('<includematcher includes=%r>' % self.includepat)
412 return ('<includematcher includes=%r>' % self._pats)
415 413
416 414 class exactmatcher(basematcher):
417 415 '''Matches the input files exactly. They are interpreted as paths, not
General Comments 0
You need to be logged in to leave comments. Login now