Patchwork [1,of,7] changegroup: remove remaining uses of repo.manifest

login
register
mail settings
Submitter Durham Goode
Date Nov. 8, 2016, 4:42 p.m.
Message ID <b47bc9c8aaa603f0e143.1478623375@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17407/
State Accepted
Headers show

Comments

Durham Goode - Nov. 8, 2016, 4:42 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1478621023 28800
#      Tue Nov 08 08:03:43 2016 -0800
# Node ID b47bc9c8aaa603f0e143f9103dc6985f5678c818
# Parent  3fd53cc1aad882ac9191d7388885acdbbc2d7103
changegroup: remove remaining uses of repo.manifest

The remaining uses of repo.manifest in the changegroup module are treating the
manifest excusively as a revlog, so let's replace them with instances of the
revlog directly.

This is part of dropping all dependencies on repo.manifest in favor of
repo.manifestlog.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -250,7 +250,7 @@  class cg1unpacker(object):
         # no new manifest will be created and the manifest group will
         # be empty during the pull
         self.manifestheader()
-        repo.manifest.addgroup(self, revmap, trp)
+        repo.manifestlog._revlog.addgroup(self, revmap, trp)
         repo.ui.progress(_('manifests'), None)
         self.callback = None
 
@@ -480,7 +480,7 @@  class cg3unpacker(cg2unpacker):
             # If we get here, there are directory manifests in the changegroup
             d = chunkdata["filename"]
             repo.ui.debug("adding %s revisions\n" % d)
-            dirlog = repo.manifest.dirlog(d)
+            dirlog = repo.manifestlog._revlog.dirlog(d)
             if not dirlog.addgroup(self, revmap, trp):
                 raise error.Abort(_("received dir revlog group is empty"))
 
@@ -588,7 +588,7 @@  class cg1packer(object):
     def _packmanifests(self, dir, mfnodes, lookuplinknode):
         """Pack flat manifests into a changegroup stream."""
         assert not dir
-        for chunk in self.group(mfnodes, self._repo.manifest,
+        for chunk in self.group(mfnodes, self._repo.manifestlog._revlog,
                                 lookuplinknode, units=_('manifests')):
             yield chunk
 
@@ -852,8 +852,10 @@  class cg3packer(cg2packer):
     def _packmanifests(self, dir, mfnodes, lookuplinknode):
         if dir:
             yield self.fileheader(dir)
-        for chunk in self.group(mfnodes, self._repo.manifest.dirlog(dir),
-                                lookuplinknode, units=_('manifests')):
+
+        dirlog = self._repo.manifestlog._revlog.dirlog(dir)
+        for chunk in self.group(mfnodes, dirlog, lookuplinknode,
+                                units=_('manifests')):
             yield chunk
 
     def _manifestsdone(self):