~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_tree.py

  • Committer: Aaron Bentley
  • Date: 2007-01-27 20:17:00 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070127201700-zpa95eucj24u8pyp
Enable nested commits

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        if not getattr(tree, 'supports_tree_reference', lambda: False)():
35
35
            raise tests.TestSkipped('Tree references not supported')
36
36
 
37
 
    def test_get_reference_revision(self):
 
37
    def create_nested(self):
38
38
        work_tree = self.make_branch_and_tree('wt')
39
39
        self.skip_if_no_reference(work_tree)
40
40
        subtree = self.make_branch_and_tree('wt/subtree')
43
43
        work_tree.add_reference(subtree)
44
44
        tree = self._convert_tree(work_tree)
45
45
        self.skip_if_no_reference(tree)
 
46
        return tree
 
47
 
 
48
    def test_get_reference_revision(self):
 
49
        tree = self.create_nested()
46
50
        entry = tree.inventory['sub-root']
47
51
        path = tree.id2path('sub-root')
48
52
        self.assertEqual('sub-1', tree.get_reference_revision(entry, path))
 
53
 
 
54
    def test_iter_reference_entries(self):
 
55
        tree = self.create_nested()
 
56
        entry = tree.inventory['sub-root']
 
57
        self.assertEqual([entry], [e for p, e in
 
58
                                   tree.iter_reference_entries()])