# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-09-08 13:16:01 # Node ID 324ad3e7ef41a5d8b421ac33ce84f036841d1a3f # Parent f52b0297acc8dc09ea65a2152132e12bfb75ea88 localrepo: warn if we are writing to cache without a lock From quite sometime we have two types of cache, `cache` and `wcache`. The later one is a working copy cache and the first one is a store cache. Let's add a check for warning if we are missing store lock while writing to these caches. This is inspired from some tag cache breakage which is observed when multiple shares are in play. The interesting part is that although we are still taking wlock to write store caches at many places, but still the test pases. Differential Revision: https://phab.mercurial-scm.org/D9000 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1250,7 +1250,12 @@ class localrepository(object): msg = b'accessing cache with vfs instead of cachevfs: "%s"' repo.ui.develwarn(msg % path, stacklevel=3, config=b"cache-vfs") # path prefixes covered by 'lock' - vfs_path_prefixes = (b'journal.', b'undo.', b'strip-backup/') + vfs_path_prefixes = ( + b'journal.', + b'undo.', + b'strip-backup/', + b'cache/', + ) if any(path.startswith(prefix) for prefix in vfs_path_prefixes): if repo._currentlock(repo._lockref) is None: repo.ui.develwarn(