From patchwork Fri Nov 10 06:49:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1351: changegroup: use any node, not min(), in treemanifest's generatemanifests From: phabricator X-Patchwork-Id: 25455 Message-Id: <48d5b24d5aca9b1086c93faceaa60099@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 10 Nov 2017 06:49:54 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGd80380ba8e7d: changegroup: use any node, not min(), in treemanifest's generatemanifests (authored by spectral, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1351?vs=3388&id=3389 REVISION DETAIL https://phab.mercurial-scm.org/D1351 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS To: spectral, #hg-reviewers, indygreg Cc: indygreg, martinvonz, mercurial-devel 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()