Mercurial > hg
diff mercurial/debugcommands.py @ 41964:d121823072b8
manifestcache: protect write with `wlock` instead of `lock`
The `wlock` is taken by both `update` and `commit` type operation. This would
help persisting the cache more aggressively.
An explicit test is introduced. However, we can already see the effect of this
change on earlier test output.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 15 Mar 2019 15:07:43 +0000 |
parents | e3307243d188 |
children | 6ae1a776dd1a |
line wrap: on
line diff
--- 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: