# HG changeset patch # User Joerg Sonnenberger # Date 1611012042 -3600 # Node ID 009130064813065868050fadf40b2575ad815be2 # Parent 72f5280e33b6c3ec621ca33e2ac3de982e20a00a 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 diff -r 72f5280e33b6 -r 009130064813 mercurial/exchangev2.py --- 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 = {}