##// END OF EJS Templates
treemanifest: make treemanifest.matches() faster...
Drew Gottlieb -
r24552:a2292da6 default
parent child Browse files
Show More
@@ -522,11 +522,28 b' class treemanifest(object):'
522 522 if match.always():
523 523 return self.copy()
524 524
525 m = self.copy()
526 for fn in m.keys():
527 if not match(fn):
528 del m[fn]
529 return m
525 return self._matches(match)
526
527 def _matches(self, match):
528 '''recursively generate a new manifest filtered by the match argument.
529 '''
530
531 ret = treemanifest(self._dir)
532
533 for fn in self._files:
534 fullp = self._subpath(fn)
535 if not match(fullp):
536 continue
537 ret._files[fn] = self._files[fn]
538 if fn in self._flags:
539 ret._flags[fn] = self._flags[fn]
540
541 for dir, subm in self._dirs.iteritems():
542 m = subm._matches(match)
543 if not m._isempty():
544 ret._dirs[dir] = m
545
546 return ret
530 547
531 548 def diff(self, m2, clean=False):
532 549 '''Finds changes between the current manifest and m2.
General Comments 0
You need to be logged in to leave comments. Login now