644 return self._matcher.prefix() and not self._always |
644 return self._matcher.prefix() and not self._always |
645 |
645 |
646 def __repr__(self): |
646 def __repr__(self): |
647 return ('<subdirmatcher path=%r, matcher=%r>' % |
647 return ('<subdirmatcher path=%r, matcher=%r>' % |
648 (self._path, self._matcher)) |
648 (self._path, self._matcher)) |
649 |
|
650 class forceincludematcher(basematcher): |
|
651 """A matcher that returns true for any of the forced includes before testing |
|
652 against the actual matcher.""" |
|
653 def __init__(self, matcher, includes): |
|
654 self._matcher = matcher |
|
655 self._includes = includes |
|
656 |
|
657 def matchfn(self, f): |
|
658 return f in self._includes or self._matcher(f) |
|
659 |
|
660 def __repr__(self): |
|
661 return ('<forceincludematcher matcher=%r, includes=%r>' % |
|
662 (self._matcher, sorted(self._includes))) |
|
663 |
649 |
664 class unionmatcher(basematcher): |
650 class unionmatcher(basematcher): |
665 """A matcher that is the union of several matchers.""" |
651 """A matcher that is the union of several matchers.""" |
666 def __init__(self, matchers): |
652 def __init__(self, matchers): |
667 self._matchers = matchers |
653 self._matchers = matchers |