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
--- 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 = {}