mercurial/match.py
changeset 32444 952017471f93
parent 32439 284b18303f61
child 32453 9695aca1a3a0
equal deleted inserted replaced
32443:bdc4861ffe59 32444:952017471f93
   212         self._cwd = cwd
   212         self._cwd = cwd
   213         self._files = [] # exact files and roots of patterns
   213         self._files = [] # exact files and roots of patterns
   214         self._anypats = bool(include or exclude)
   214         self._anypats = bool(include or exclude)
   215         self._always = False
   215         self._always = False
   216         self._pathrestricted = bool(include or exclude or patterns)
   216         self._pathrestricted = bool(include or exclude or patterns)
       
   217         self.patternspat = None
       
   218         self.includepat = None
       
   219         self.excludepat = None
   217 
   220 
   218         # roots are directories which are recursively included/excluded.
   221         # roots are directories which are recursively included/excluded.
   219         self._includeroots = set()
   222         self._includeroots = set()
   220         self._excluderoots = set()
   223         self._excluderoots = set()
   221         # dirs are directories which are non-recursively included.
   224         # dirs are directories which are non-recursively included.
   372     def isexact(self):
   375     def isexact(self):
   373         return self.matchfn == self.exact
   376         return self.matchfn == self.exact
   374 
   377 
   375     def prefix(self):
   378     def prefix(self):
   376         return not self.always() and not self.isexact() and not self.anypats()
   379         return not self.always() and not self.isexact() and not self.anypats()
       
   380 
       
   381     def __repr__(self):
       
   382         return ('<matcher files=%r, patterns=%r, includes=%r, excludes=%r>' %
       
   383                 (self._files, self.patternspat, self.includepat,
       
   384                  self.excludepat))
   377 
   385 
   378 class subdirmatcher(matcher):
   386 class subdirmatcher(matcher):
   379     """Adapt a matcher to work on a subdirectory only.
   387     """Adapt a matcher to work on a subdirectory only.
   380 
   388 
   381     The paths are remapped to remove/insert the path as needed:
   389     The paths are remapped to remove/insert the path as needed: