# HG changeset patch # User Gregory Szorc # Date 1533592597 25200 # Node ID 6076053589b945e31bb9b6f9be96d861770746c3 # Parent ee0720e8225726471fbaadf2e7f94ed1286f913d changegroup: populate _clnodetorev as part of changelog linknode lookup The thing that matters is that self._clnodetorev is populated with changesets that are being sent. Back when this code was in an extension, it wasn't possible to monkeypatch the changelog lookup function. Now that the code is in core, we can move this code to where it logically belongs. Differential Revision: https://phab.mercurial-scm.org/D4186 diff -r ee0720e82257 -r 6076053589b9 mercurial/changegroup.py --- a/mercurial/changegroup.py Thu Aug 09 13:08:29 2018 -0400 +++ b/mercurial/changegroup.py Mon Aug 06 14:56:37 2018 -0700 @@ -852,6 +852,8 @@ clrevorder[x] = len(clrevorder) if self._ellipses: + self._clnodetorev[x] = cl.rev(x) + # Only update mfs if x is going to be sent. Otherwise we # end up with bogus linkrevs specified for manifests and # we skip some manifest nodes that we should otherwise @@ -1045,15 +1047,8 @@ progress.complete() def _revisiondeltanarrow(self, store, ischangelog, rev, prev, linknode): - # build up some mapping information that's useful later. See - # the local() nested function below. - if ischangelog: - self._clnodetorev[linknode] = rev - linkrev = rev - self._clrevtolocalrev[linkrev] = rev - else: - linkrev = self._clnodetorev[linknode] - self._clrevtolocalrev[linkrev] = rev + linkrev = self._clnodetorev[linknode] + self._clrevtolocalrev[linkrev] = rev # This is a node to send in full, because the changeset it # corresponds to was a full changeset.