##// END OF EJS Templates
manifestdict: inline _intersectfiles()...
Martin von Zweigbergk -
r24666:3092885b default
parent child Browse files
Show More
@@ -198,17 +198,6 b' class manifestdict(object):'
198 def keys(self):
198 def keys(self):
199 return list(self.iterkeys())
199 return list(self.iterkeys())
200
200
201 def _intersectfiles(self, files):
202 '''make a new lazymanifest with the intersection of self with files
203
204 The algorithm assumes that files is much smaller than self.'''
205 ret = manifestdict()
206 lm = self._lm
207 for fn in files:
208 if fn in lm:
209 ret._lm[fn] = lm[fn]
210 return ret
211
212 def filesnotin(self, m2):
201 def filesnotin(self, m2):
213 '''Set of files in this manifest that are not in the other'''
202 '''Set of files in this manifest that are not in the other'''
214 files = set(self)
203 files = set(self)
@@ -265,7 +254,12 b' class manifestdict(object):'
265 files = match.files()
254 files = match.files()
266 if (len(files) < 100 and (match.isexact() or
255 if (len(files) < 100 and (match.isexact() or
267 (not match.anypats() and util.all(fn in self for fn in files)))):
256 (not match.anypats() and util.all(fn in self for fn in files)))):
268 return self._intersectfiles(files)
257 m = manifestdict()
258 lm = self._lm
259 for fn in match.files():
260 if fn in lm:
261 m._lm[fn] = lm[fn]
262 return m
269
263
270 m = manifestdict('')
264 m = manifestdict('')
271 m._lm = self._lm.filtercopy(match)
265 m._lm = self._lm.filtercopy(match)
General Comments 0
You need to be logged in to leave comments. Login now