# HG changeset patch # User Pierre-Yves David # Date 2012-09-03 12:34:19 # Node ID 5210e5a556d9c8e304b9f8af9f631930ac509bb9 # Parent 2c6382772db0a5592138bfeed39422192bb6bc3a 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. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -627,8 +627,15 @@ class localrepository(object): def branchmap(self): '''returns a dictionary {branch: [branchheads]}''' - self.updatebranchcache() - return self._branchcache + if self.changelog.filteredrevs: + # some changeset are excluded we can't use the cache + branchmap = {} + self._updatebranchcache(branchmap, (self[r] for r in self)) + return branchmap + else: + self.updatebranchcache() + return self._branchcache + def _branchtip(self, heads): '''return the tipmost branch head in heads'''