Rev 4537: Fix the direct lock tests. in lp:///~jameinel/bzr/1.18-lock-warnings
John Arbash Meinel
john at arbash-meinel.com
Fri Jul 31 17:51:50 BST 2009
At lp:///~jameinel/bzr/1.18-lock-warnings
------------------------------------------------------------
revno: 4537
revision-id: john at arbash-meinel.com-20090731165148-fg37wo885ppjp4we
parent: john at arbash-meinel.com-20090731162254-cnp93fq23p18uavb
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.18-lock-warnings
timestamp: Fri 2009-07-31 11:51:48 -0500
message:
Fix the direct lock tests.
-------------- next part --------------
=== modified file 'bzrlib/lock.py'
--- a/bzrlib/lock.py 2009-07-31 15:52:52 +0000
+++ b/bzrlib/lock.py 2009-07-31 16:51:48 +0000
@@ -229,6 +229,8 @@
self.filename = osutils.realpath(filename)
if self.filename in _fcntl_WriteLock._open_locks:
if 'strict_locks' in debug.debug_flags:
+ # We raise before calling _open so we don't need to
+ # _clear_f
raise errors.LockContention(self.filename)
else:
trace.mutter('Read lock taken w/ an open write lock on: %s'
=== modified file 'bzrlib/tests/test_lock.py'
--- a/bzrlib/tests/test_lock.py 2009-07-31 15:49:25 +0000
+++ b/bzrlib/tests/test_lock.py 2009-07-31 16:51:48 +0000
@@ -76,11 +76,11 @@
try:
if lock.have_fcntl and self.write_lock is lock._fcntl_WriteLock:
# With -Dlock, fcntl locks are properly exclusive
- debug.debug_flags.add('strict-locks')
+ debug.debug_flags.add('strict_locks')
self.assertRaises(errors.LockContention,
self.write_lock, 'a-lock-file')
# But not without it
- debug.debug_flags.remove('strict-locks')
+ debug.debug_flags.remove('strict_locks')
try:
w_lock = self.write_lock('a-lock-file')
except errors.LockContention:
@@ -101,11 +101,11 @@
try:
if lock.have_fcntl and self.read_lock is lock._fcntl_ReadLock:
# With -Dlock, fcntl locks are properly exclusive
- debug.debug_flags.add('strict-locks')
+ debug.debug_flags.add('strict_locks')
self.assertRaises(errors.LockContention,
self.read_lock, 'a-lock-file')
# But not without it
- debug.debug_flags.remove('strict-locks')
+ debug.debug_flags.remove('strict_locks')
try:
r_lock = self.read_lock('a-lock-file')
except errors.LockContention:
More information about the bazaar-commits
mailing list