changeset 46358:009130064813

exchangev2: avoid second look-up by node Accessing the revlog by node is slightly more expensive than by revision, so look up the revision first and use it afterwards. Differential Revision: https://phab.mercurial-scm.org/D9831
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 19 Jan 2021 00:20:42 +0100
parents 72f5280e33b6
children 0600e8467101
files mercurial/exchangev2.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchangev2.py	Tue Jan 19 00:18:39 2021 +0100
+++ b/mercurial/exchangev2.py	Tue Jan 19 00:20:42 2021 +0100
@@ -364,12 +364,13 @@
     def onchangeset(cl, node):
         progress.increment()
 
-        revision = cl.changelogrevision(node)
+        rev = cl.rev(node)
+        revision = cl.changelogrevision(rev)
         added.append(node)
 
         # We need to preserve the mapping of changelog revision to node
         # so we can set the linkrev accordingly when manifests are added.
-        manifestnodes[cl.rev(node)] = revision.manifest
+        manifestnodes[rev] = revision.manifest
 
     nodesbyphase = {phase: set() for phase in phases.phasenames.values()}
     remotebookmarks = {}