Mercurial > hg
comparison mercurial/changegroup.py @ 38994:6076053589b9
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
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 06 Aug 2018 14:56:37 -0700 |
parents | d85b0d81112b |
children | ed25722da873 |
comparison
equal
deleted
inserted
replaced
38993:ee0720e82257 | 38994:6076053589b9 |
---|---|
850 def lookupcl(x): | 850 def lookupcl(x): |
851 c = cl.read(x) | 851 c = cl.read(x) |
852 clrevorder[x] = len(clrevorder) | 852 clrevorder[x] = len(clrevorder) |
853 | 853 |
854 if self._ellipses: | 854 if self._ellipses: |
855 self._clnodetorev[x] = cl.rev(x) | |
856 | |
855 # Only update mfs if x is going to be sent. Otherwise we | 857 # Only update mfs if x is going to be sent. Otherwise we |
856 # end up with bogus linkrevs specified for manifests and | 858 # end up with bogus linkrevs specified for manifests and |
857 # we skip some manifest nodes that we should otherwise | 859 # we skip some manifest nodes that we should otherwise |
858 # have sent. | 860 # have sent. |
859 if (x in self._fullnodes | 861 if (x in self._fullnodes |
1043 yield chunk | 1045 yield chunk |
1044 self._verbosenote(_('%8.i %s\n') % (size, fname)) | 1046 self._verbosenote(_('%8.i %s\n') % (size, fname)) |
1045 progress.complete() | 1047 progress.complete() |
1046 | 1048 |
1047 def _revisiondeltanarrow(self, store, ischangelog, rev, prev, linknode): | 1049 def _revisiondeltanarrow(self, store, ischangelog, rev, prev, linknode): |
1048 # build up some mapping information that's useful later. See | 1050 linkrev = self._clnodetorev[linknode] |
1049 # the local() nested function below. | 1051 self._clrevtolocalrev[linkrev] = rev |
1050 if ischangelog: | |
1051 self._clnodetorev[linknode] = rev | |
1052 linkrev = rev | |
1053 self._clrevtolocalrev[linkrev] = rev | |
1054 else: | |
1055 linkrev = self._clnodetorev[linknode] | |
1056 self._clrevtolocalrev[linkrev] = rev | |
1057 | 1052 |
1058 # This is a node to send in full, because the changeset it | 1053 # This is a node to send in full, because the changeset it |
1059 # corresponds to was a full changeset. | 1054 # corresponds to was a full changeset. |
1060 if linknode in self._fullnodes: | 1055 if linknode in self._fullnodes: |
1061 return _revisiondeltanormal(store, rev, prev, linknode, | 1056 return _revisiondeltanormal(store, rev, prev, linknode, |