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