diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -27,7 +27,7 @@ def composelargefilematcher(match, manif m = copy.copy(match) lfile = lambda f: lfutil.standin(f) in manifest m._files = filter(lfile, m._files) - m._fmap = set(m._files) + m._fileroots = set(m._files) m._always = False origmatchfn = m.matchfn m.matchfn = lambda f: lfile(f) and origmatchfn(f) @@ -42,7 +42,7 @@ def composenormalfilematcher(match, mani notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in manifest or f in excluded) m._files = filter(notlfile, m._files) - m._fmap = set(m._files) + m._fileroots = set(m._files) m._always = False origmatchfn = m.matchfn m.matchfn = lambda f: notlfile(f) and origmatchfn(f) @@ -358,7 +358,7 @@ def overridelog(orig, ui, repo, *pats, * and repo.wvfs.isdir(standin): m._files.append(standin) - m._fmap = set(m._files) + m._fileroots = set(m._files) m._always = False origmatchfn = m.matchfn def lfmatchfn(f): @@ -626,7 +626,7 @@ def overridecopy(orig, ui, repo, pats, o m = copy.copy(match) lfile = lambda f: lfutil.standin(f) in manifest m._files = [lfutil.standin(f) for f in m._files if lfile(f)] - m._fmap = set(m._files) + m._fileroots = set(m._files) origmatchfn = m.matchfn m.matchfn = lambda f: (lfutil.isstandin(f) and (f in manifest) and @@ -742,7 +742,7 @@ def overriderevert(orig, ui, repo, ctx, return f m._files = [tostandin(f) for f in m._files] m._files = [f for f in m._files if f is not None] - m._fmap = set(m._files) + m._fileroots = set(m._files) origmatchfn = m.matchfn def matchfn(f): if lfutil.isstandin(f): diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -123,7 +123,7 @@ class match(object): return True self.matchfn = m - self._fmap = set(self._files) + self._fileroots = set(self._files) def __call__(self, fn): return self.matchfn(fn) @@ -171,17 +171,17 @@ class match(object): @propertycache def _dirs(self): - return set(util.dirs(self._fmap)) | set(['.']) + return set(util.dirs(self._fileroots)) | set(['.']) def visitdir(self, dir): - return (not self._fmap or '.' in self._fmap or - dir in self._fmap or dir in self._dirs or - any(parentdir in self._fmap + 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 exact(self, f): '''Returns True if f is in .files().''' - return f in self._fmap + return f in self._fileroots def anypats(self): '''Matcher uses patterns or include/exclude.''' @@ -276,7 +276,7 @@ class narrowmatcher(match): if f.startswith(path + "/")] self._anypats = matcher._anypats self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn) - self._fmap = set(self._files) + self._fileroots = set(self._files) def abs(self, f): return self._matcher.abs(self._path + "/" + f) @@ -303,7 +303,7 @@ class icasefsmatcher(match): # m.exact(file) must be based off of the actual user input, otherwise # inexact case matches are treated as exact, and not noted without -v. if self._files: - self._fmap = set(_roots(self._kp)) + self._fileroots = set(_roots(self._kp)) def _normalize(self, patterns, default, root, cwd, auditor): self._kp = super(icasefsmatcher, self)._normalize(patterns, default,