diff mercurial/debugcommands.py @ 32265:ccef71de7d41

caches: introduce a 'debugupdatecaches' command That command make sure caches are updated. This is based on 'localrepo.updatecaches' so when we move support for new cache in that function this command will benefit from it.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 02 May 2017 21:35:06 +0200
parents 9bc36198338e
children 67026d65a4fc
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue May 02 19:05:58 2017 +0200
+++ b/mercurial/debugcommands.py	Tue May 02 21:35:06 2017 +0200
@@ -2130,6 +2130,13 @@
             displayer.show(repo[r], **props)
         displayer.close()
 
+@command('debugupdatecaches', [])
+def debugupdatecaches(ui, repo, *pats, **opts):
+    """warm all known caches in the repository"""
+    with repo.wlock():
+        with repo.lock():
+            repo.updatecaches()
+
 @command('debugupgraderepo', [
     ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
     ('', 'run', False, _('performs an upgrade')),