Mercurial > public > mercurial-scm > hg-stable
diff mercurial/exchangev2.py @ 46432: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 | 89a2afe31e82 |
children | 0903d6b9b1df |
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 = {}