mercurial/localrepo.py
changeset 12066 d01e28657429
parent 12035 ff1044230bca
child 12070 fddacca3202e
--- a/mercurial/localrepo.py	Fri Aug 27 22:24:47 2010 -0500
+++ b/mercurial/localrepo.py	Sat Aug 28 23:57:39 2010 +0200
@@ -337,8 +337,7 @@
 
         return partial
 
-    def branchmap(self):
-        '''returns a dictionary {branch: [branchheads]}'''
+    def updatebranchcache(self):
         tip = self.changelog.tip()
         if self._branchcache is not None and self._branchcachetip == tip:
             return self._branchcache
@@ -355,6 +354,9 @@
         # this private cache holds all heads (not just tips)
         self._branchcache = partial
 
+    def branchmap(self):
+        '''returns a dictionary {branch: [branchheads]}'''
+        self.updatebranchcache()
         return self._branchcache
 
     def branchtags(self):
@@ -976,7 +978,7 @@
             tr.close()
 
             if self._branchcache:
-                self.branchtags()
+                self.updatebranchcache()
             return n
         finally:
             if tr:
@@ -1700,7 +1702,7 @@
         if changesets > 0:
             # forcefully update the on-disk branch cache
             self.ui.debug("updating the branch cache\n")
-            self.branchtags()
+            self.updatebranchcache()
             self.hook("changegroup", node=hex(cl.node(clstart)),
                       source=srctype, url=url)