~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

Merge up bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
    def make_graph(self, ancestors):
151
151
        tree = self.prepare_memory_tree('.')
152
152
        self.build_ancestry(tree, ancestors)
153
 
        tree.unlock()
 
153
        self.addCleanup(tree.unlock)
154
154
        return tree.branch.repository.get_graph()
155
155
 
156
156
    def prepare_memory_tree(self, location):
259
259
        """Ensure we do unique_lca using data from two repos"""
260
260
        mainline_tree = self.prepare_memory_tree('mainline')
261
261
        self.build_ancestry(mainline_tree, mainline)
262
 
        mainline_tree.unlock()
 
262
        self.addCleanup(mainline_tree.unlock)
263
263
 
264
264
        # This is cheating, because the revisions in the graph are actually
265
265
        # different revisions, despite having the same revision-id.
266
266
        feature_tree = self.prepare_memory_tree('feature')
267
267
        self.build_ancestry(feature_tree, feature_branch)
268
 
        feature_tree.unlock()
 
268
        self.addCleanup(feature_tree.unlock)
 
269
 
269
270
        graph = mainline_tree.branch.repository.get_graph(
270
271
            feature_tree.branch.repository)
271
272
        self.assertEqual('rev2b', graph.find_unique_lca('rev2a', 'rev3b'))