D1351: changegroup: use any node, not min(), in treemanifest's generatemanifests

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Fri Nov 10 01:32:27 EST 2017


spectral updated this revision to Diff 3388.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1351?vs=3358&id=3388

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

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
@@ -692,7 +692,7 @@
         # Callback for the manifest, used to collect linkrevs for filelog
         # revisions.
         # Returns the linkrev node (collected in lookupcl).
-        def makelookupmflinknode(dir):
+        def makelookupmflinknode(dir, nodes):
             if fastpathlinkrev:
                 assert not dir
                 return mfs.__getitem__
@@ -713,7 +713,7 @@
                 the client before you can trust the list of files and
                 treemanifests to send.
                 """
-                clnode = tmfnodes[dir][x]
+                clnode = nodes[x]
                 mdata = mfl.get(dir, x).readfast(shallow=True)
                 for p, n, fl in mdata.iterentries():
                     if fl == 't': # subdirectory manifest
@@ -733,15 +733,13 @@
 
         size = 0
         while tmfnodes:
-            dir = min(tmfnodes)
-            nodes = tmfnodes[dir]
+            dir, nodes = tmfnodes.popitem()
             prunednodes = self.prune(dirlog(dir), nodes, commonrevs)
             if not dir or prunednodes:
                 for x in self._packmanifests(dir, prunednodes,
-                                             makelookupmflinknode(dir)):
+                                             makelookupmflinknode(dir, nodes)):
                     size += len(x)
                     yield x
-            del tmfnodes[dir]
         self._verbosenote(_('%8.i (manifests)\n') % size)
         yield self._manifestsdone()
 



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


More information about the Mercurial-devel mailing list