Rev 2391: (James Westby) add read locks around read_working_inventory() in test_commit_move in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

John Arbash Meinel john at arbash-meinel.com
Sun Feb 25 17:12:42 GMT 2007


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

------------------------------------------------------------
revno: 2391
revision-id: john at arbash-meinel.com-20070225171143-dcj0kgtu8kf2o0is
parent: john at arbash-meinel.com-20070225170249-fcgtqn57yinqxsc2
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Sun 2007-02-25 11:11:43 -0600
message:
  (James Westby) add read locks around read_working_inventory() in test_commit_move
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:02:49 +0000
+++ b/bzrlib/tests/test_commit.py	2007-02-25 17:11:43 +0000
@@ -223,28 +223,40 @@
         wt.move(['hello'], 'a')
         r2 = 'test at rev-2'
         wt.commit('two', rev_id=r2, allow_pointless=False)
-        self.check_inventory_shape(wt.read_working_inventory(),
-                                   ['a', 'a/hello', 'b'])
+        wt.lock_read()
+        try:
+            self.check_inventory_shape(wt.read_working_inventory(),
+                                       ['a', 'a/hello', 'b'])
+        finally:
+            wt.unlock()
 
         wt.move(['b'], 'a')
         r3 = 'test at rev-3'
         wt.commit('three', rev_id=r3, allow_pointless=False)
-        self.check_inventory_shape(wt.read_working_inventory(),
-                                   ['a', 'a/hello', 'a/b'])
-        self.check_inventory_shape(b.repository.get_revision_inventory(r3),
-                                   ['a', 'a/hello', 'a/b'])
+        wt.lock_read()
+        try:
+            self.check_inventory_shape(wt.read_working_inventory(),
+                                       ['a', 'a/hello', 'a/b'])
+            self.check_inventory_shape(b.repository.get_revision_inventory(r3),
+                                       ['a', 'a/hello', 'a/b'])
+        finally:
+            wt.unlock()
 
         wt.move(['a/hello'], 'a/b')
         r4 = 'test at rev-4'
         wt.commit('four', rev_id=r4, allow_pointless=False)
-        self.check_inventory_shape(wt.read_working_inventory(),
-                                   ['a', 'a/b/hello', 'a/b'])
+        wt.lock_read()
+        try:
+            self.check_inventory_shape(wt.read_working_inventory(),
+                                       ['a', 'a/b/hello', 'a/b'])
+        finally:
+            wt.unlock()
 
         inv = b.repository.get_revision_inventory(r4)
         eq(inv['hello-id'].revision, r4)
         eq(inv['a-id'].revision, r1)
         eq(inv['b-id'].revision, r3)
-        
+
     def test_removed_commit(self):
         """Commit with a removed file"""
         wt = self.make_branch_and_tree('.')



More information about the bazaar-commits mailing list