comparison mercurial/changegroup.py @ 40664:dba590f27c7a

changegroup: avoid instantiating storage if we are not using it Differential Revision: https://phab.mercurial-scm.org/D5280
author Kyle Lippincott <spectral@google.com>
date Thu, 15 Nov 2018 11:16:42 -0800
parents 808b762679cd
children 876494fd967d
comparison
equal deleted inserted replaced
40663:c53f0ead5781 40664:dba590f27c7a
1041 return clnode 1041 return clnode
1042 return lookupmflinknode 1042 return lookupmflinknode
1043 1043
1044 while tmfnodes: 1044 while tmfnodes:
1045 tree, nodes = tmfnodes.popitem() 1045 tree, nodes = tmfnodes.popitem()
1046
1047 should_visit = self._matcher.visitdir(tree[:-1] or '.')
1048 if tree and not should_visit:
1049 continue
1050
1046 store = mfl.getstorage(tree) 1051 store = mfl.getstorage(tree)
1047 1052
1048 if not self._matcher.visitdir(store.tree[:-1] or '.'): 1053 if not should_visit:
1049 # No nodes to send because this directory is out of 1054 # No nodes to send because this directory is out of
1050 # the client's view of the repository (probably 1055 # the client's view of the repository (probably
1051 # because of narrow clones). 1056 # because of narrow clones). Do this even for the root
1057 # directory (tree=='')
1052 prunednodes = [] 1058 prunednodes = []
1053 else: 1059 else:
1054 # Avoid sending any manifest nodes we can prove the 1060 # Avoid sending any manifest nodes we can prove the
1055 # client already has by checking linkrevs. See the 1061 # client already has by checking linkrevs. See the
1056 # related comment in generatefiles(). 1062 # related comment in generatefiles().
1057 prunednodes = self._prunemanifests(store, nodes, commonrevs) 1063 prunednodes = self._prunemanifests(store, nodes, commonrevs)
1064
1058 if tree and not prunednodes: 1065 if tree and not prunednodes:
1059 continue 1066 continue
1060 1067
1061 lookupfn = makelookupmflinknode(tree, nodes) 1068 lookupfn = makelookupmflinknode(tree, nodes)
1062 1069