Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 29186:e0fc0ed41935
transaction: turn lack of locking into a hard failure (API)
We have been warning about transactions without locks for about a year (and
three releases), third party extensions had a fair grace period to fix their
code, we are moving lack of locking to a hard failure in order to protect users
against repository corruption.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 05 May 2016 16:20:53 +0200 |
parents | b207653ada10 |
children | e51f34183599 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu May 05 16:13:22 2016 +0200 +++ b/mercurial/localrepo.py Thu May 05 16:20:53 2016 +0200 @@ -1000,7 +1000,8 @@ or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is None or not l.held: - self.ui.develwarn('transaction with no lock') + raise RuntimeError('programming error: transaction requires ' + 'locking') tr = self.currenttransaction() if tr is not None: return tr.nest()