From patchwork Sun Jul 16 08:47:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 8] vfsward: register 'write with no lock' warnings as 'check-locks' config From: Boris Feld X-Patchwork-Id: 22425 Message-Id: To: mercurial-devel@mercurial-scm.org Cc: boris.feld@octobus.net Date: Sun, 16 Jul 2017 10:47:46 +0200 # HG changeset patch # User Boris Feld # Date 1500151251 -7200 # Sat Jul 15 22:40:51 2017 +0200 # Node ID a73c1ffd2edb211d19242a60027f84cf50d88fa4 # Parent 27d23fe32887279db649eccae244f261452be7ac # EXP-Topic cachevfs vfsward: register 'write with no lock' warnings as 'check-locks' config Update 'write with no lock' warnings in order to be better controlled by the config. We reuse the option used for lock order for these other lock related message. The message can now be disabled using 'devel.check-locks = no' (in addition to the usual 'devel.all-warnings = no'). diff -r 27d23fe32887 -r a73c1ffd2edb mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Jul 14 20:26:21 2017 -0700 +++ b/mercurial/localrepo.py Sat Jul 15 22:40:51 2017 +0200 @@ -489,7 +489,7 @@ # journal is covered by 'lock' if repo._currentlock(repo._lockref) is None: repo.ui.develwarn('write with no lock: "%s"' % path, - stacklevel=2) + stacklevel=2, config='check-locks') elif repo._currentlock(repo._wlockref) is None: # rest of vfs files are covered by 'wlock' # @@ -498,7 +498,7 @@ if path.startswith(prefix): return repo.ui.develwarn('write with no wlock: "%s"' % path, - stacklevel=2) + stacklevel=2, config='check-locks') return ret return checkvfs