Mercurial > hg-stable
comparison mercurial/localrepo.py @ 33532:d645fdfb749f
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').
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sat, 15 Jul 2017 22:40:51 +0200 |
parents | f9e6e43c7987 |
children | 4133c0b0fcd7 |
comparison
equal
deleted
inserted
replaced
33531:9cbbf9118c6c | 33532:d645fdfb749f |
---|---|
487 path = path[len(repo.path) + 1:] | 487 path = path[len(repo.path) + 1:] |
488 if path.startswith('journal.'): | 488 if path.startswith('journal.'): |
489 # journal is covered by 'lock' | 489 # journal is covered by 'lock' |
490 if repo._currentlock(repo._lockref) is None: | 490 if repo._currentlock(repo._lockref) is None: |
491 repo.ui.develwarn('write with no lock: "%s"' % path, | 491 repo.ui.develwarn('write with no lock: "%s"' % path, |
492 stacklevel=2) | 492 stacklevel=2, config='check-locks') |
493 elif repo._currentlock(repo._wlockref) is None: | 493 elif repo._currentlock(repo._wlockref) is None: |
494 # rest of vfs files are covered by 'wlock' | 494 # rest of vfs files are covered by 'wlock' |
495 # | 495 # |
496 # exclude special files | 496 # exclude special files |
497 for prefix in self._wlockfreeprefix: | 497 for prefix in self._wlockfreeprefix: |
498 if path.startswith(prefix): | 498 if path.startswith(prefix): |
499 return | 499 return |
500 repo.ui.develwarn('write with no wlock: "%s"' % path, | 500 repo.ui.develwarn('write with no wlock: "%s"' % path, |
501 stacklevel=2) | 501 stacklevel=2, config='check-locks') |
502 return ret | 502 return ret |
503 return checkvfs | 503 return checkvfs |
504 | 504 |
505 def _getsvfsward(self, origfunc): | 505 def _getsvfsward(self, origfunc): |
506 """build a ward for self.svfs""" | 506 """build a ward for self.svfs""" |