Patchwork [7,of,8] manifest: get rid of manifest.readshallowfast

login
register
mail settings
Submitter Durham Goode
Date Sept. 14, 2016, 11:04 p.m.
Message ID <9cccfde2ef2c1e7ac27e.1473894277@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/16636/
State Superseded
Headers show

Comments

Durham Goode - Sept. 14, 2016, 11:04 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1473893509 25200
#      Wed Sep 14 15:51:49 2016 -0700
# Node ID 9cccfde2ef2c1e7ac27e222d5be2850ab3da7960
# Parent  de2b633b8448ee3fccc8bc277ae308476945b7dc
manifest: get rid of manifest.readshallowfast

This removes manifest.readshallowfast and converts it's one user to use
manifestlog instead.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -674,7 +674,8 @@  class cg1packer(object):
     def generatemanifests(self, commonrevs, clrevorder, fastpathlinkrev, mfs,
                           fnodes):
         repo = self._repo
-        dirlog = repo.manifest.dirlog
+        mfl = repo.manifestlog
+        dirlog = mfl._revlog.dirlog
         tmfnodes = {'': mfs}
 
         # Callback for the manifest, used to collect linkrevs for filelog
@@ -702,7 +703,7 @@  class cg1packer(object):
                 treemanifests to send.
                 """
                 clnode = tmfnodes[dir][x]
-                mdata = dirlog(dir).readshallowfast(x)
+                mdata = mfl.get(dir, x).readfast(shallow=True)
                 for p, n, fl in mdata.iterentries():
                     if fl == 't': # subdirectory manifest
                         subdir = dir + p + '/'
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1276,15 +1276,6 @@  class manifest(manifestrevlog):
         d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
         return manifestdict(d)
 
-    def readshallowfast(self, node):
-        '''like readfast(), but calls readshallowdelta() instead of readdelta()
-        '''
-        r = self.rev(node)
-        deltaparent = self.deltaparent(r)
-        if deltaparent != revlog.nullrev and deltaparent in self.parentrevs(r):
-            return self.readshallowdelta(node)
-        return self.readshallow(node)
-
     def read(self, node):
         if node == revlog.nullid:
             return self._newmanifest() # don't upset local cache
@@ -1311,13 +1302,6 @@  class manifest(manifestrevlog):
         self.fulltextcache[node] = arraytext
         return m
 
-    def readshallow(self, node):
-        '''Reads the manifest in this directory. When using flat manifests,
-        this manifest will generally have files in subdirectories in it. Does
-        not cache the manifest as the callers generally do not read the same
-        version twice.'''
-        return manifestdict(self.revision(node))
-
     def find(self, node, f):
         '''look up entry for a single file efficiently.
         return (node, flags) pair if found, (None, None) if not.'''