mercurial/match.py
changeset 33497 80e1331a7fe9
parent 33478 cf15c3cc304c
child 33582 44bc181b9835
equal deleted inserted replaced
33496:258298f4712b 33497:80e1331a7fe9
   676             r |= v
   676             r |= v
   677         return r
   677         return r
   678 
   678 
   679     def __repr__(self):
   679     def __repr__(self):
   680         return ('<unionmatcher matchers=%r>' % self._matchers)
   680         return ('<unionmatcher matchers=%r>' % self._matchers)
   681 
       
   682 class negatematcher(basematcher):
       
   683     def __init__(self, matcher):
       
   684         self._matcher = matcher
       
   685 
       
   686     def matchfn(self, f):
       
   687         return not self._matcher(f)
       
   688 
       
   689     def __repr__(self):
       
   690         return ('<negatematcher matcher=%r>' % self._matcher)
       
   691 
   681 
   692 def patkind(pattern, default=None):
   682 def patkind(pattern, default=None):
   693     '''If pattern is 'kind:pat' with a known kind, return kind.'''
   683     '''If pattern is 'kind:pat' with a known kind, return kind.'''
   694     return _patsplit(pattern, default)[0]
   684     return _patsplit(pattern, default)[0]
   695 
   685