[MERGE] Cleanup and test Lock objects
John Arbash Meinel
john at arbash-meinel.com
Tue Mar 13 23:20:24 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
The attached patch cleans up the bzrlib/lock.py file a bit, and adds
direct test for our Lock support.
I still have more to do to make locks properly exclusive on Linux. But
because that is a behavior change, I wanted to submit this first.
This also implements Windows locks using ctypes if pywin32 is not
available. It turns out that msvcrt locks don't support creating a
shared lock, so we can no longer use them.
Which means that we now have a strict dependency on either pywin32 or
ctypes for Windows. I don't think this is terrible, though, because
we've had a soft one for a long time. And as I understand it, Alexander
has been shipping a installer with them for a long time.
My next step is to enable the 2 tests that ensure you cannot take a read
lock on the same file that you have a write lock on. Which I know fails
with fcntl locks, and I expect that once I fix that, we will start
seeing lots of LockErrors as part of the rest of our code.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 69568 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070313/2f4528bb/attachment-0001.bin
More information about the bazaar