Rev 3016: Locking in test_graph. in http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

Robert Collins robertc at robertcollins.net
Wed Nov 21 23:39:51 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

------------------------------------------------------------
revno: 3016
revision-id:robertc at robertcollins.net-20071121233940-3l1xpdnxqdneogqe
parent: robertc at robertcollins.net-20071121233632-63hxiuhd5kcweg21
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack.read-locks
timestamp: Thu 2007-11-22 10:39:40 +1100
message:
  Locking in test_graph.
modified:
  bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
=== modified file 'bzrlib/tests/test_graph.py'
--- a/bzrlib/tests/test_graph.py	2007-10-22 05:44:49 +0000
+++ b/bzrlib/tests/test_graph.py	2007-11-21 23:39:40 +0000
@@ -162,7 +162,7 @@
     def make_graph(self, ancestors):
         tree = self.prepare_memory_tree('.')
         self.build_ancestry(tree, ancestors)
-        tree.unlock()
+        self.addCleanup(tree.unlock)
         return tree.branch.repository.get_graph()
 
     def prepare_memory_tree(self, location):
@@ -271,13 +271,14 @@
         """Ensure we do unique_lca using data from two repos"""
         mainline_tree = self.prepare_memory_tree('mainline')
         self.build_ancestry(mainline_tree, mainline)
-        mainline_tree.unlock()
+        self.addCleanup(mainline_tree.unlock)
 
         # This is cheating, because the revisions in the graph are actually
         # different revisions, despite having the same revision-id.
         feature_tree = self.prepare_memory_tree('feature')
         self.build_ancestry(feature_tree, feature_branch)
-        feature_tree.unlock()
+        self.addCleanup(feature_tree.unlock)
+
         graph = mainline_tree.branch.repository.get_graph(
             feature_tree.branch.repository)
         self.assertEqual('rev2b', graph.find_unique_lca('rev2a', 'rev3b'))



More information about the bazaar-commits mailing list