comparison mercurial/branchmap.py @ 42122:7c9d4cf23adf

branchcache: don't verify closed nodes in iteropen() We expect that the nodes passed to iteropen() will be verified. We are only testing for membership in closed nodes set, so we don't need to verify the whole closed nodes set. This will speed up calculating branchheads() when there are lot of closed nodes related to other branches. Differential Revision: https://phab.mercurial-scm.org/D6209
author Pulkit Goyal <pulkit@yandex-team.ru>
date Fri, 05 Apr 2019 15:56:33 +0300
parents 6578654916ae
children be5eeaf5c24a
comparison
equal deleted inserted replaced
42121:6578654916ae 42122:7c9d4cf23adf
317 tipmost closed head on branch. 317 tipmost closed head on branch.
318 Raise KeyError for unknown branch.''' 318 Raise KeyError for unknown branch.'''
319 return self._branchtip(self[branch])[0] 319 return self._branchtip(self[branch])[0]
320 320
321 def iteropen(self, nodes): 321 def iteropen(self, nodes):
322 self._verifyclosed()
323 return (n for n in nodes if n not in self._closednodes) 322 return (n for n in nodes if n not in self._closednodes)
324 323
325 def branchheads(self, branch, closed=False): 324 def branchheads(self, branch, closed=False):
326 self._verifybranch(branch) 325 self._verifybranch(branch)
327 heads = self._entries[branch] 326 heads = self._entries[branch]