diff -r 0720e6265c8a -r 8056481caa81 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Mon Aug 08 18:14:42 2016 +0200 +++ b/mercurial/debugcommands.py Thu Jul 13 18:31:35 2017 -0700 @@ -2177,9 +2177,8 @@ @command('debugupdatecaches', []) def debugupdatecaches(ui, repo, *pats, **opts): """warm all known caches in the repository""" - with repo.wlock(): - with repo.lock(): - repo.updatecaches() + with repo.wlock(), repo.lock(): + repo.updatecaches() @command('debugupgraderepo', [ ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),