diff mercurial/localrepo.py @ 3823:b3b868113d24

fix encoding conversion of branch names when mq is loaded
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 07 Dec 2006 14:35:43 -0200
parents 2aef481ac73c
children d1ce5461beed
line wrap: on
line diff
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -312,12 +312,7 @@ class localrepository(repo.repository):
                 self.nodetagscache.setdefault(n, []).append(t)
         return self.nodetagscache.get(node, [])
 
-    def branchtags(self):
-        if self.branchcache != None:
-            return self.branchcache
-
-        self.branchcache = {} # avoid recursion in changectx
-
+    def _branchtags(self):
         partial, last, lrev = self._readbranchcache()
 
         tiprev = self.changelog.count() - 1
@@ -325,6 +320,15 @@ class localrepository(repo.repository):
             self._updatebranchcache(partial, lrev+1, tiprev+1)
             self._writebranchcache(partial, self.changelog.tip(), tiprev)
 
+        return partial
+
+    def branchtags(self):
+        if self.branchcache is not None:
+            return self.branchcache
+
+        self.branchcache = {} # avoid recursion in changectx
+        partial = self._branchtags()
+
         # the branch cache is stored on disk as UTF-8, but in the local
         # charset internally
         for k, v in partial.items():