Rev 2403: lock a basis tree during a commit test. in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

John Arbash Meinel john at arbash-meinel.com
Mon Feb 26 00:48:21 GMT 2007


At http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

------------------------------------------------------------
revno: 2403
revision-id: john at arbash-meinel.com-20070226004721-mxcueak27y98r1vk
parent: john at arbash-meinel.com-20070226004531-f5j0onpamaehk9ob
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Sun 2007-02-25 18:47:21 -0600
message:
  lock a basis tree during a commit test.
modified:
  bzrlib/tests/test_commit.py    test_commit.py-20050914060732-279f057f8c295434
-------------- next part --------------
=== modified file 'bzrlib/tests/test_commit.py'
--- a/bzrlib/tests/test_commit.py	2007-02-25 17:11:43 +0000
+++ b/bzrlib/tests/test_commit.py	2007-02-26 00:47:21 +0000
@@ -539,9 +539,13 @@
         tree.commit('added a, b')
         tree.remove(['a', 'b'])
         tree.commit('removed a', specific_files='a')
-        basis = tree.basis_tree().inventory
-        self.assertIs(None, basis.path2id('a'))
-        self.assertFalse(basis.path2id('b') is None)
+        basis = tree.basis_tree()
+        tree.lock_read()
+        try:
+            self.assertIs(None, basis.path2id('a'))
+            self.assertFalse(basis.path2id('b') is None)
+        finally:
+            tree.unlock()
 
     def test_commit_saves_1ms_timestamp(self):
         """Passing in a timestamp is saved with 1ms resolution"""



More information about the bazaar-commits mailing list