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()
--- 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: