[PATCH 2 of 4] treemanifest: remove treemanifest._intersectfiles()

Drew Gottlieb drgott at google.com
Tue Mar 31 17:29:12 CDT 2015


# HG changeset patch
# User Drew Gottlieb <drgott at google.com>
# Date 1427487373 25200
#      Fri Mar 27 13:16:13 2015 -0700
# Node ID 3e59a573b043f2e39334347232bf9def2acba801
# Parent  bb9449558e313c14d8777e11f0f22bbc19b6fc30
treemanifest: remove treemanifest._intersectfiles()

In preparation for the optimization in the following commit, this commit
removes treemanifest.matches()'s call to _intersectfiles(), and removes
_intersectfiles() itself since it's unused at this point.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -480,19 +480,6 @@
         copy._flags = dict.copy(self._flags)
         return copy
 
-    def _intersectfiles(self, files):
-        '''make a new treemanifest with the intersection of self with files
-
-        The algorithm assumes that files is much smaller than self.'''
-        ret = treemanifest()
-        for fn in files:
-            if fn in self:
-                ret[fn] = self[fn]
-                flags = self.flags(fn)
-                if flags:
-                    ret.setflag(fn, flags)
-        return ret
-
     def filesnotin(self, m2):
         '''Set of files in this manifest that are not in the other'''
         files = set()
@@ -531,11 +518,6 @@
         if match.always():
             return self.copy()
 
-        files = match.files()
-        if (match.isexact() or
-            (not match.anypats() and util.all(fn in self for fn in files))):
-            return self._intersectfiles(files)
-
         m = self.copy()
         for fn in m.keys():
             if not match(fn):


More information about the Mercurial-devel mailing list