comparison mercurial/changegroup.py @ 41767:1c1c4ef8b72e

changegroup: move non-pruning of non-ellipsis manifests to _prunemanifests() Google has an extension that overrides _prunemanifests() and removes nodes that we fetch using another mechanism. That broke when _prunemanifests() no longer got called. It works again if we move the check for "not self._ellipses" inside _prunemanifests(). Differential Revision: https://phab.mercurial-scm.org/D6004
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 21 Feb 2019 21:27:42 -0800
parents 5f9d057ba28c
children 27d6956d386b
comparison
equal deleted inserted replaced
41766:cd7059d17cb2 41767:1c1c4ef8b72e
1071 # No nodes to send because this directory is out of 1071 # No nodes to send because this directory is out of
1072 # the client's view of the repository (probably 1072 # the client's view of the repository (probably
1073 # because of narrow clones). Do this even for the root 1073 # because of narrow clones). Do this even for the root
1074 # directory (tree=='') 1074 # directory (tree=='')
1075 prunednodes = [] 1075 prunednodes = []
1076 elif not self._ellipses:
1077 # In non-ellipses case and large repositories, it is better to
1078 # prevent calling of store.rev and store.linkrev on a lot of
1079 # nodes as compared to sending some extra data
1080 prunednodes = nodes.copy()
1081 else: 1076 else:
1082 # Avoid sending any manifest nodes we can prove the 1077 # Avoid sending any manifest nodes we can prove the
1083 # client already has by checking linkrevs. See the 1078 # client already has by checking linkrevs. See the
1084 # related comment in generatefiles(). 1079 # related comment in generatefiles().
1085 prunednodes = self._prunemanifests(store, nodes, commonrevs) 1080 prunednodes = self._prunemanifests(store, nodes, commonrevs)
1108 pass 1103 pass
1109 if not tree: 1104 if not tree:
1110 yield tree, [] 1105 yield tree, []
1111 1106
1112 def _prunemanifests(self, store, nodes, commonrevs): 1107 def _prunemanifests(self, store, nodes, commonrevs):
1108 if not self._ellipses:
1109 # In non-ellipses case and large repositories, it is better to
1110 # prevent calling of store.rev and store.linkrev on a lot of
1111 # nodes as compared to sending some extra data
1112 return nodes.copy()
1113 # This is split out as a separate method to allow filtering 1113 # This is split out as a separate method to allow filtering
1114 # commonrevs in extension code. 1114 # commonrevs in extension code.
1115 # 1115 #
1116 # TODO(augie): this shouldn't be required, instead we should 1116 # TODO(augie): this shouldn't be required, instead we should
1117 # make filtering of revisions to send delegated to the store 1117 # make filtering of revisions to send delegated to the store