~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-22 21:20:30 UTC
  • mfrom: (3010.1.17 pack.read-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20071122212030-ehfexlt3qzptnsdv
(robertc) Various lock and write-group correctness issues which show
        up when packs are the default format. (Robert Collins, #154204).

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
    def make_graph(self, ancestors):
163
163
        tree = self.prepare_memory_tree('.')
164
164
        self.build_ancestry(tree, ancestors)
165
 
        tree.unlock()
 
165
        self.addCleanup(tree.unlock)
166
166
        return tree.branch.repository.get_graph()
167
167
 
168
168
    def prepare_memory_tree(self, location):
271
271
        """Ensure we do unique_lca using data from two repos"""
272
272
        mainline_tree = self.prepare_memory_tree('mainline')
273
273
        self.build_ancestry(mainline_tree, mainline)
274
 
        mainline_tree.unlock()
 
274
        self.addCleanup(mainline_tree.unlock)
275
275
 
276
276
        # This is cheating, because the revisions in the graph are actually
277
277
        # different revisions, despite having the same revision-id.
278
278
        feature_tree = self.prepare_memory_tree('feature')
279
279
        self.build_ancestry(feature_tree, feature_branch)
280
 
        feature_tree.unlock()
 
280
        self.addCleanup(feature_tree.unlock)
 
281
 
281
282
        graph = mainline_tree.branch.repository.get_graph(
282
283
            feature_tree.branch.repository)
283
284
        self.assertEqual('rev2b', graph.find_unique_lca('rev2a', 'rev3b'))