def _dirignore(self, f): if f == '.': return False if self._ignore(f): return True for p in util.finddirs(f): if self._ignore(p): return True return False
def visitdir(self, dir): '''Decides whether a directory should be visited based on whether it has potential matches in it or one of its subdirectories. This is based on the match's primary, included, and excluded patterns. This function's behavior is undefined if it has returned False for one of the dir's parent directories. ''' if dir in self._excluderoots: return False if (self._includeroots and '.' not in self._includeroots and dir not in self._includeroots and dir not in self._includedirs and not any(parent in self._includeroots for parent in util.finddirs(dir))): return False return (not self._fileroots or '.' in self._fileroots or dir in self._fileroots or dir in self._dirs or any(parentdir in self._fileroots for parentdir in util.finddirs(dir)))
def _addpath(self, f, state, mode, size, mtime): oldstate = self[f] if state == 'a' or oldstate == 'r': scmutil.checkfilename(f) if f in self._dirs: raise error.Abort(_('directory %r already in dirstate') % f) # shadows for d in util.finddirs(f): if d in self._dirs: break if d in self._map and self[d] != 'r': raise error.Abort( _('file %r in dirstate clashes with %r') % (d, f)) if oldstate in "?r" and "_dirs" in self.__dict__: self._dirs.addpath(f) self._dirty = True self._map[f] = dirstatetuple(state, mode, size, mtime)
def _addpath(self, f, state, mode, size, mtime): oldstate = self[f] if state == 'a' or oldstate == 'r': scmutil.checkfilename(f) if f in self._dirs: raise util.Abort(_('directory %r already in dirstate') % f) # shadows for d in util.finddirs(f): if d in self._dirs: break if d in self._map and self[d] != 'r': raise util.Abort( _('file %r in dirstate clashes with %r') % (d, f)) if oldstate in "?r" and "_dirs" in self.__dict__: self._dirs.addpath(f) self._dirty = True self._map[f] = dirstatetuple(state, mode, size, mtime)