diff -r 6386f9a421d2 -r d121823072b8 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Thu Mar 14 09:12:55 2019 +0000 +++ b/mercurial/debugcommands.py Fri Mar 15 15:07:43 2019 +0000 @@ -1476,13 +1476,13 @@ raise error.Abort(msg) if opts.get(r'clear'): - with repo.lock(): + with repo.wlock(): cache = getcache() cache.clear(clear_persisted_data=True) return if add: - with repo.lock(): + with repo.wlock(): m = repo.manifestlog store = m.getstorage(b'') for n in add: