# HG changeset patch # User Pierre-Yves David # Date 1493753706 -7200 # Node ID ccef71de7d41295c657d783e9caa7567d36fa529 # Parent a72caf0af38e06c231c2b00ac89fc7e0d50f9768 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. diff -r a72caf0af38e -r ccef71de7d41 mercurial/debugcommands.py --- 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')), diff -r a72caf0af38e -r ccef71de7d41 tests/test-completion.t --- a/tests/test-completion.t Tue May 02 19:05:58 2017 +0200 +++ b/tests/test-completion.t Tue May 02 21:35:06 2017 +0200 @@ -111,6 +111,7 @@ debugsub debugsuccessorssets debugtemplate + debugupdatecaches debugupgraderepo debugwalk debugwireargs @@ -285,6 +286,7 @@ debugsub: rev debugsuccessorssets: debugtemplate: rev, define + debugupdatecaches: debugupgraderepo: optimize, run debugwalk: include, exclude debugwireargs: three, four, five, ssh, remotecmd, insecure diff -r a72caf0af38e -r ccef71de7d41 tests/test-debugcommands.t --- a/tests/test-debugcommands.t Tue May 02 19:05:58 2017 +0200 +++ b/tests/test-debugcommands.t Tue May 02 21:35:06 2017 +0200 @@ -109,6 +109,16 @@ 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob) 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob) 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob) + +Test cache warming command + + $ rm -rf .hg/cache/ + $ hg debugupdatecaches --debug + $ ls -r .hg/cache/* + .hg/cache/rbc-revs-v1 + .hg/cache/rbc-names-v1 + .hg/cache/branch2-served + $ cd .. Test internal debugstacktrace command diff -r a72caf0af38e -r ccef71de7d41 tests/test-help.t --- a/tests/test-help.t Tue May 02 19:05:58 2017 +0200 +++ b/tests/test-help.t Tue May 02 21:35:06 2017 +0200 @@ -931,6 +931,8 @@ show set of successors for revision debugtemplate parse and apply a template + debugupdatecaches + warm all known caches in the repository debugupgraderepo upgrade a repository to use different features debugwalk show how files match on given patterns