comparison mercurial/localrepo.py @ 17714:5210e5a556d9

clfilter: do not use branchmap cache if there are filtered changesets If there are filtered changesets the cache is not valid. We'll have to cache branchmap for filtered state too, but for now recomputing the branchmap is enough.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 03 Sep 2012 14:34:19 +0200
parents 8575f4a2126e
children 21c503480986
comparison
equal deleted inserted replaced
17713:2c6382772db0 17714:5210e5a556d9
625 # this private cache holds all heads (not just the branch tips) 625 # this private cache holds all heads (not just the branch tips)
626 self._branchcache = partial 626 self._branchcache = partial
627 627
628 def branchmap(self): 628 def branchmap(self):
629 '''returns a dictionary {branch: [branchheads]}''' 629 '''returns a dictionary {branch: [branchheads]}'''
630 self.updatebranchcache() 630 if self.changelog.filteredrevs:
631 return self._branchcache 631 # some changeset are excluded we can't use the cache
632 branchmap = {}
633 self._updatebranchcache(branchmap, (self[r] for r in self))
634 return branchmap
635 else:
636 self.updatebranchcache()
637 return self._branchcache
638
632 639
633 def _branchtip(self, heads): 640 def _branchtip(self, heads):
634 '''return the tipmost branch head in heads''' 641 '''return the tipmost branch head in heads'''
635 tip = heads[-1] 642 tip = heads[-1]
636 for h in reversed(heads): 643 for h in reversed(heads):