mercurial/match.py
changeset 42346 38d85ec06552
parent 42343 d8e55c0c642c
child 42361 c4b8f8637d7a
equal deleted inserted replaced
42345:7d4ee14ff92d 42346:38d85ec06552
   531         self._prefix = _prefix(kindpats)
   531         self._prefix = _prefix(kindpats)
   532         self._pats, self.matchfn = _buildmatch(kindpats, '$', root)
   532         self._pats, self.matchfn = _buildmatch(kindpats, '$', root)
   533 
   533 
   534     @propertycache
   534     @propertycache
   535     def _dirs(self):
   535     def _dirs(self):
   536         return set(util.dirs(self._fileset)) | {''}
   536         return set(util.dirs(self._fileset))
   537 
   537 
   538     def visitdir(self, dir):
   538     def visitdir(self, dir):
   539         dir = normalizerootdir(dir, 'visitdir')
   539         dir = normalizerootdir(dir, 'visitdir')
   540         if self._prefix and dir in self._fileset:
   540         if self._prefix and dir in self._fileset:
   541             return 'all'
   541             return 'all'
   689 
   689 
   690     matchfn = basematcher.exact
   690     matchfn = basematcher.exact
   691 
   691 
   692     @propertycache
   692     @propertycache
   693     def _dirs(self):
   693     def _dirs(self):
   694         return set(util.dirs(self._fileset)) | {''}
   694         return set(util.dirs(self._fileset))
   695 
   695 
   696     def visitdir(self, dir):
   696     def visitdir(self, dir):
   697         dir = normalizerootdir(dir, 'visitdir')
   697         dir = normalizerootdir(dir, 'visitdir')
   698         return dir in self._dirs
   698         return dir in self._dirs
   699 
   699 
  1005             return False
  1005             return False
  1006         return self._matcher.matchfn(f[len(self._pathprefix):])
  1006         return self._matcher.matchfn(f[len(self._pathprefix):])
  1007 
  1007 
  1008     @propertycache
  1008     @propertycache
  1009     def _pathdirs(self):
  1009     def _pathdirs(self):
  1010         return set(util.finddirs(self._path)) | {''}
  1010         return set(util.finddirs(self._path))
  1011 
  1011 
  1012     def visitdir(self, dir):
  1012     def visitdir(self, dir):
  1013         if dir == self._path:
  1013         if dir == self._path:
  1014             return self._matcher.visitdir('')
  1014             return self._matcher.visitdir('')
  1015         if dir.startswith(self._pathprefix):
  1015         if dir.startswith(self._pathprefix):