diff mercurial/manifest.py @ 24495:d2a3a2808974

manifest: make manifest.intersectfiles() internal manifest.intersectfiles() is just a utility used by manifest.matches(), and a future commit removes intersectfiles for treemanifest for optimization purposes. This commit makes the intersectfiles methods on manifestdict and treemanifest internal, and converts its test to a more generic testMatches(), which has the exact same coverage.
author Drew Gottlieb <drgott@google.com>
date Mon, 30 Mar 2015 10:43:52 -0700
parents bfb754050ccd
children ecac0dd246a8
line wrap: on
line diff
--- a/mercurial/manifest.py	Sat Mar 28 11:19:34 2015 +0100
+++ b/mercurial/manifest.py	Mon Mar 30 10:43:52 2015 -0700
@@ -131,7 +131,7 @@
     def keys(self):
         return list(self.iterkeys())
 
-    def intersectfiles(self, files):
+    def _intersectfiles(self, files):
         '''make a new lazymanifest with the intersection of self with files
 
         The algorithm assumes that files is much smaller than self.'''
@@ -166,7 +166,7 @@
         files = match.files()
         if (len(files) < 100 and (match.isexact() or
             (not match.anypats() and util.all(fn in self for fn in files)))):
-            return self.intersectfiles(files)
+            return self._intersectfiles(files)
 
         lm = manifestdict('')
         lm._lm = self._lm.filtercopy(match)
@@ -467,7 +467,7 @@
         copy._flags = dict.copy(self._flags)
         return copy
 
-    def intersectfiles(self, files):
+    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.'''
@@ -521,7 +521,7 @@
         files = match.files()
         if (match.isexact() or
             (not match.anypats() and util.all(fn in self for fn in files))):
-            return self.intersectfiles(files)
+            return self._intersectfiles(files)
 
         m = self.copy()
         for fn in m.keys():