##// END OF EJS Templates
match: rename _fmap to _fileroots for clarity...
Drew Gottlieb -
r25189:1c8c33ea default
parent child Browse files
Show More
@@ -27,7 +27,7 b' def composelargefilematcher(match, manif'
27 m = copy.copy(match)
27 m = copy.copy(match)
28 lfile = lambda f: lfutil.standin(f) in manifest
28 lfile = lambda f: lfutil.standin(f) in manifest
29 m._files = filter(lfile, m._files)
29 m._files = filter(lfile, m._files)
30 m._fmap = set(m._files)
30 m._fileroots = set(m._files)
31 m._always = False
31 m._always = False
32 origmatchfn = m.matchfn
32 origmatchfn = m.matchfn
33 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
33 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
@@ -42,7 +42,7 b' def composenormalfilematcher(match, mani'
42 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
42 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
43 manifest or f in excluded)
43 manifest or f in excluded)
44 m._files = filter(notlfile, m._files)
44 m._files = filter(notlfile, m._files)
45 m._fmap = set(m._files)
45 m._fileroots = set(m._files)
46 m._always = False
46 m._always = False
47 origmatchfn = m.matchfn
47 origmatchfn = m.matchfn
48 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
48 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
@@ -358,7 +358,7 b' def overridelog(orig, ui, repo, *pats, *'
358 and repo.wvfs.isdir(standin):
358 and repo.wvfs.isdir(standin):
359 m._files.append(standin)
359 m._files.append(standin)
360
360
361 m._fmap = set(m._files)
361 m._fileroots = set(m._files)
362 m._always = False
362 m._always = False
363 origmatchfn = m.matchfn
363 origmatchfn = m.matchfn
364 def lfmatchfn(f):
364 def lfmatchfn(f):
@@ -626,7 +626,7 b' def overridecopy(orig, ui, repo, pats, o'
626 m = copy.copy(match)
626 m = copy.copy(match)
627 lfile = lambda f: lfutil.standin(f) in manifest
627 lfile = lambda f: lfutil.standin(f) in manifest
628 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
628 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
629 m._fmap = set(m._files)
629 m._fileroots = set(m._files)
630 origmatchfn = m.matchfn
630 origmatchfn = m.matchfn
631 m.matchfn = lambda f: (lfutil.isstandin(f) and
631 m.matchfn = lambda f: (lfutil.isstandin(f) and
632 (f in manifest) and
632 (f in manifest) and
@@ -742,7 +742,7 b' def overriderevert(orig, ui, repo, ctx, '
742 return f
742 return f
743 m._files = [tostandin(f) for f in m._files]
743 m._files = [tostandin(f) for f in m._files]
744 m._files = [f for f in m._files if f is not None]
744 m._files = [f for f in m._files if f is not None]
745 m._fmap = set(m._files)
745 m._fileroots = set(m._files)
746 origmatchfn = m.matchfn
746 origmatchfn = m.matchfn
747 def matchfn(f):
747 def matchfn(f):
748 if lfutil.isstandin(f):
748 if lfutil.isstandin(f):
@@ -123,7 +123,7 b' class match(object):'
123 return True
123 return True
124
124
125 self.matchfn = m
125 self.matchfn = m
126 self._fmap = set(self._files)
126 self._fileroots = set(self._files)
127
127
128 def __call__(self, fn):
128 def __call__(self, fn):
129 return self.matchfn(fn)
129 return self.matchfn(fn)
@@ -171,17 +171,17 b' class match(object):'
171
171
172 @propertycache
172 @propertycache
173 def _dirs(self):
173 def _dirs(self):
174 return set(util.dirs(self._fmap)) | set(['.'])
174 return set(util.dirs(self._fileroots)) | set(['.'])
175
175
176 def visitdir(self, dir):
176 def visitdir(self, dir):
177 return (not self._fmap or '.' in self._fmap or
177 return (not self._fileroots or '.' in self._fileroots or
178 dir in self._fmap or dir in self._dirs or
178 dir in self._fileroots or dir in self._dirs or
179 any(parentdir in self._fmap
179 any(parentdir in self._fileroots
180 for parentdir in util.finddirs(dir)))
180 for parentdir in util.finddirs(dir)))
181
181
182 def exact(self, f):
182 def exact(self, f):
183 '''Returns True if f is in .files().'''
183 '''Returns True if f is in .files().'''
184 return f in self._fmap
184 return f in self._fileroots
185
185
186 def anypats(self):
186 def anypats(self):
187 '''Matcher uses patterns or include/exclude.'''
187 '''Matcher uses patterns or include/exclude.'''
@@ -276,7 +276,7 b' class narrowmatcher(match):'
276 if f.startswith(path + "/")]
276 if f.startswith(path + "/")]
277 self._anypats = matcher._anypats
277 self._anypats = matcher._anypats
278 self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
278 self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
279 self._fmap = set(self._files)
279 self._fileroots = set(self._files)
280
280
281 def abs(self, f):
281 def abs(self, f):
282 return self._matcher.abs(self._path + "/" + f)
282 return self._matcher.abs(self._path + "/" + f)
@@ -303,7 +303,7 b' class icasefsmatcher(match):'
303 # m.exact(file) must be based off of the actual user input, otherwise
303 # m.exact(file) must be based off of the actual user input, otherwise
304 # inexact case matches are treated as exact, and not noted without -v.
304 # inexact case matches are treated as exact, and not noted without -v.
305 if self._files:
305 if self._files:
306 self._fmap = set(_roots(self._kp))
306 self._fileroots = set(_roots(self._kp))
307
307
308 def _normalize(self, patterns, default, root, cwd, auditor):
308 def _normalize(self, patterns, default, root, cwd, auditor):
309 self._kp = super(icasefsmatcher, self)._normalize(patterns, default,
309 self._kp = super(icasefsmatcher, self)._normalize(patterns, default,
General Comments 0
You need to be logged in to leave comments. Login now