##// END OF EJS Templates
debugupdatecache: also warm rev branch cache...
Boris Feld -
r36970:b24cde12 default
parent child Browse files
Show More
@@ -2482,7 +2482,7 b" def debuguiprompt(ui, prompt=''):"
2482 def debugupdatecaches(ui, repo, *pats, **opts):
2482 def debugupdatecaches(ui, repo, *pats, **opts):
2483 """warm all known caches in the repository"""
2483 """warm all known caches in the repository"""
2484 with repo.wlock(), repo.lock():
2484 with repo.wlock(), repo.lock():
2485 repo.updatecaches()
2485 repo.updatecaches(full=True)
2486
2486
2487 @command('debugupgraderepo', [
2487 @command('debugupgraderepo', [
2488 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
2488 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
@@ -1519,12 +1519,15 b' class localrepository(object):'
1519 return updater
1519 return updater
1520
1520
1521 @unfilteredmethod
1521 @unfilteredmethod
1522 def updatecaches(self, tr=None):
1522 def updatecaches(self, tr=None, full=False):
1523 """warm appropriate caches
1523 """warm appropriate caches
1524
1524
1525 If this function is called after a transaction closed. The transaction
1525 If this function is called after a transaction closed. The transaction
1526 will be available in the 'tr' argument. This can be used to selectively
1526 will be available in the 'tr' argument. This can be used to selectively
1527 update caches relevant to the changes in that transaction.
1527 update caches relevant to the changes in that transaction.
1528
1529 If 'full' is set, make sure all caches the function knows about have
1530 up-to-date data. Even the ones usually loaded more lazily.
1528 """
1531 """
1529 if tr is not None and tr.hookargs.get('source') == 'strip':
1532 if tr is not None and tr.hookargs.get('source') == 'strip':
1530 # During strip, many caches are invalid but
1533 # During strip, many caches are invalid but
@@ -1536,6 +1539,12 b' class localrepository(object):'
1536 self.ui.debug('updating the branch cache\n')
1539 self.ui.debug('updating the branch cache\n')
1537 branchmap.updatecache(self.filtered('served'))
1540 branchmap.updatecache(self.filtered('served'))
1538
1541
1542 if full:
1543 rbc = self.revbranchcache()
1544 for r in self.changelog:
1545 rbc.branchinfo(r)
1546 rbc.write()
1547
1539 def invalidatecaches(self):
1548 def invalidatecaches(self):
1540
1549
1541 if '_tagscache' in vars(self):
1550 if '_tagscache' in vars(self):
General Comments 0
You need to be logged in to leave comments. Login now