Mercurial > hg
comparison tests/test-lock.py @ 26499:e72b62b154b0
localrepo: prevent wlock from being inherited when a transaction is running
Review feedback from Pierre-Yves David. A separate line of work is working to
ensure that dirstate writes are written to a separate 'pending' file while a
transaction is active. Lock inheritance currently conflicts with that, so dodge
the issue by simply preventing inheritance while a transaction is running.
Custom merge drivers aren't going to run inside a transaction, so this doesn't
affect that.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 06 Oct 2015 13:19:05 -0700 |
parents | e8564e04382d |
children | 14033c5dd261 |
comparison
equal
deleted
inserted
replaced
26498:e8564e04382d | 26499:e72b62b154b0 |
---|---|
258 raise error.LockInheritanceContractViolation('check failed') | 258 raise error.LockInheritanceContractViolation('check failed') |
259 lock = state.makelock(inheritchecker=check) | 259 lock = state.makelock(inheritchecker=check) |
260 state.assertacquirecalled(True) | 260 state.assertacquirecalled(True) |
261 | 261 |
262 def tryinherit(): | 262 def tryinherit(): |
263 with lock.inherit() as lockname: | 263 with lock.inherit(): |
264 pass | 264 pass |
265 | 265 |
266 self.assertRaises(error.LockInheritanceContractViolation, tryinherit) | 266 self.assertRaises(error.LockInheritanceContractViolation, tryinherit) |
267 | 267 |
268 lock.release() | 268 lock.release() |