##// END OF EJS Templates
caches: call 'repo.updatecache()' in 'repo.destroyed()'...
Pierre-Yves David -
r32264:a72caf0a default
parent child Browse files
Show More
@@ -1232,14 +1232,20 b' class localrepository(object):'
1232 return 0
1232 return 0
1233
1233
1234 @unfilteredmethod
1234 @unfilteredmethod
1235 def updatecaches(self, tr):
1235 def updatecaches(self, tr=None):
1236 """warm appropriate caches after a transaction closed"""
1236 """warm appropriate caches
1237 if tr.hookargs.get('source') == 'strip':
1237
1238 If this function is called after a transaction closed. The transaction
1239 will be available in the 'tr' argument. This can be used to selectively
1240 update caches relevant to the changes in that transaction.
1241 """
1242 if tr is not None and tr.hookargs.get('source') == 'strip':
1238 # During strip, many caches are invalid but
1243 # During strip, many caches are invalid but
1239 # later call to `destroyed` will refresh them.
1244 # later call to `destroyed` will refresh them.
1240 return
1245 return
1241
1246
1242 if tr.changes['revs']:
1247 if tr is None or tr.changes['revs']:
1248 # updating the unfiltered branchmap should refresh all the others,
1243 branchmap.updatecache(self.filtered('served'))
1249 branchmap.updatecache(self.filtered('served'))
1244
1250
1245 def invalidatecaches(self):
1251 def invalidatecaches(self):
@@ -1830,10 +1836,8 b' class localrepository(object):'
1830 self._phasecache.filterunknown(self)
1836 self._phasecache.filterunknown(self)
1831 self._phasecache.write()
1837 self._phasecache.write()
1832
1838
1833 # update the 'served' branch cache to help read only server process
1839 # refresh all repository caches
1834 # Thanks to branchcache collaboration this is done from the nearest
1840 self.updatecaches()
1835 # filtered subset and it is expected to be fast.
1836 branchmap.updatecache(self.filtered('served'))
1837
1841
1838 # Ensure the persistent tag cache is updated. Doing it now
1842 # Ensure the persistent tag cache is updated. Doing it now
1839 # means that the tag cache only has to worry about destroyed
1843 # means that the tag cache only has to worry about destroyed
General Comments 0
You need to be logged in to leave comments. Login now