[PATCH 2 of 2 v2] manifest: make intersectfiles() private

Martin von Zweigbergk martinvonz at google.com
Wed Mar 25 15:07:10 CDT 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1427313982 25200
#      Wed Mar 25 13:06:22 2015 -0700
# Node ID 94c7641371149eabb0b6d54b7cb6f89101281fc2
# Parent  6ffdc058428df5f53cd92e0063ace45346016e2e
manifest: make intersectfiles() private

Since 0cc283f44655 (manifest: add matches() method, 2014-10-22), the
intersectfiles() method has been an implementation detail. The
treemanifest class will probably want to special-case differently and
should not have to provide intersectfiles() for API compatibility with
manifestdict(). For now, let's add a '_' prefix to indicate that it's
not part of the API.

diff -r 6ffdc058428d -r 94c764137114 mercurial/manifest.py
--- a/mercurial/manifest.py	Wed Oct 29 08:43:39 2014 -0700
+++ b/mercurial/manifest.py	Wed Mar 25 13:06:22 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():


More information about the Mercurial-devel mailing list