# HG changeset patch # User Benoit Boissinot # Date 1256944828 -3600 # Node ID 863ba2ea1f0bd80bb0e175a8edabe2f415a8ef01 # Parent 5bbf4f130684e27ce4491ea31fbe1629dcc4ebdb localrepo/branchcache: rebuild the "charset-aware" branchcache when needed It's simpler and the two cache weren't always in sync otherwise: localrepo.branchcache would not be updated after calling branchmap() diff -r 5bbf4f130684 -r 863ba2ea1f0b mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Oct 30 15:43:01 2009 +0200 +++ b/mercurial/localrepo.py Sat Oct 31 00:20:28 2009 +0100 @@ -320,10 +320,7 @@ return partial def lbranchmap(self): - tip = self.changelog.tip() - if self.branchcache is not None and self._branchcachetip == tip: - return self.branchcache - + self.branchcache = {} partial = self.branchmap() # the branch cache is stored on disk as UTF-8, but in the local @@ -339,10 +336,6 @@ oldtip = self._branchcachetip self._branchcachetip = tip - if self.branchcache is None: - self.branchcache = {} # avoid recursion in changectx - else: - self.branchcache.clear() # keep using the same dict if oldtip is None or oldtip not in self.changelog.nodemap: partial, last, lrev = self._readbranchcache() else: