##// END OF EJS Templates
localrepo: introduce method for explicit branch cache update...
Georg Brandl -
r12066:d01e2865 default
parent child Browse files
Show More
@@ -337,8 +337,7 b' class localrepository(repo.repository):'
337 337
338 338 return partial
339 339
340 def branchmap(self):
341 '''returns a dictionary {branch: [branchheads]}'''
340 def updatebranchcache(self):
342 341 tip = self.changelog.tip()
343 342 if self._branchcache is not None and self._branchcachetip == tip:
344 343 return self._branchcache
@@ -355,6 +354,9 b' class localrepository(repo.repository):'
355 354 # this private cache holds all heads (not just tips)
356 355 self._branchcache = partial
357 356
357 def branchmap(self):
358 '''returns a dictionary {branch: [branchheads]}'''
359 self.updatebranchcache()
358 360 return self._branchcache
359 361
360 362 def branchtags(self):
@@ -976,7 +978,7 b' class localrepository(repo.repository):'
976 978 tr.close()
977 979
978 980 if self._branchcache:
979 self.branchtags()
981 self.updatebranchcache()
980 982 return n
981 983 finally:
982 984 if tr:
@@ -1700,7 +1702,7 b' class localrepository(repo.repository):'
1700 1702 if changesets > 0:
1701 1703 # forcefully update the on-disk branch cache
1702 1704 self.ui.debug("updating the branch cache\n")
1703 self.branchtags()
1705 self.updatebranchcache()
1704 1706 self.hook("changegroup", node=hex(cl.node(clstart)),
1705 1707 source=srctype, url=url)
1706 1708
General Comments 0
You need to be logged in to leave comments. Login now