D4198: changegroup: inline _packmanifests() into generatemanifests()

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Aug 9 16:28:04 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5959ef78d834: changegroup: inline _packmanifests() into generatemanifests() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4198?vs=10165&id=10187

REVISION DETAIL
  https://phab.mercurial-scm.org/D4198

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -834,22 +834,6 @@
         rr, rl = store.rev, store.linkrev
         return [n for n in missing if rl(rr(n)) not in commonrevs]
 
-    def _packmanifests(self, dir, dirlog, revs, lookuplinknode,
-                       clrevtolocalrev):
-        """Pack manifests into a changegroup stream.
-
-        Encodes the directory name in the output so multiple manifests
-        can be sent. Multiple manifests is not supported by cg1 and cg2.
-        """
-        if dir:
-            assert self.version == b'03'
-            yield _fileheader(dir)
-
-        for chunk in self.group(revs, dirlog, False, lookuplinknode,
-                                units=_('manifests'),
-                                clrevtolocalrev=clrevtolocalrev):
-            yield chunk
-
     def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
         """Yield a sequence of changegroup byte chunks."""
 
@@ -1061,10 +1045,17 @@
                 revs = _sortnodesnormal(store, prunednodes,
                                         self._reorder)
 
-            for x in self._packmanifests(dir, store, revs, lookupfn,
-                                         clrevtolocalrev):
-                size += len(x)
-                yield x
+            if dir:
+                assert self.version == b'03'
+                chunk = _fileheader(dir)
+                size += len(chunk)
+                yield chunk
+
+            for chunk in self.group(revs, store, False, lookupfn,
+                                    units=_('manifests'),
+                                    clrevtolocalrev=clrevtolocalrev):
+                size += len(chunk)
+                yield chunk
 
         self._verbosenote(_('%8.i (manifests)\n') % size)
         yield self._manifestsend



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list