Rev 4806: 2.1.0b4-win32-append-read-locked was approved in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-accepted

John Arbash Meinel john at arbash-meinel.com
Tue Nov 17 22:20:19 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-accepted

------------------------------------------------------------
revno: 4806 [merge]
revision-id: john at arbash-meinel.com-20091117222009-sbcgouw5nwn61awi
parent: pqm at pqm.ubuntu.com-20091117092107-8ag9sr4hd0cubo6r
parent: john at arbash-meinel.com-20091108050024-zpmrgqwa6hszlfsg
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-win32-accepted
timestamp: Tue 2009-11-17 16:20:09 -0600
message:
  2.1.0b4-win32-append-read-locked was approved
modified:
  bzrlib/tests/test__dirstate_helpers.py test_dirstate_helper-20070504035751-jsbn00xodv0y1eve-2
-------------- next part --------------
=== modified file 'bzrlib/tests/test__dirstate_helpers.py'
--- a/bzrlib/tests/test__dirstate_helpers.py	2009-06-22 15:39:42 +0000
+++ b/bzrlib/tests/test__dirstate_helpers.py	2009-11-08 05:00:24 +0000
@@ -743,13 +743,17 @@
 
     def test_trailing_garbage(self):
         tree, state, expected = self.create_basic_dirstate()
-        # We can modify the file as long as it hasn't been read yet.
+        # On Linux, we can write extra data as long as we haven't read yet, but
+        # on Win32, if you've opened the file with FILE_SHARE_READ, trying to
+        # open it in append mode will fail.
+        state.unlock()
         f = open('dirstate', 'ab')
         try:
             # Add bogus trailing garbage
             f.write('bogus\n')
         finally:
             f.close()
+            state.lock_read()
         e = self.assertRaises(errors.DirstateCorrupt,
                               state._read_dirblocks_if_needed)
         # Make sure we mention the bogus characters in the error



More information about the bazaar-commits mailing list