/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        tree_b.lock_read()
57
57
        self.addCleanup(tree_b.unlock)
58
58
        self.assertEqual([
 
59
            ('killed-a', 'a\n'),
59
60
            ('killed-b', 'b\n'),
60
 
            ('killed-a', 'a\n'),
61
61
            ('unchanged', 'c\n'),
62
62
            ('unchanged', 'd\n'),
63
63
            ('new-a', 'e\n'),
69
69
 
70
70
    def skip_if_no_reference(self, tree):
71
71
        if not getattr(tree, 'supports_tree_reference', lambda: False)():
72
 
            raise tests.TestSkipped('Tree references not supported')
 
72
            raise tests.TestNotApplicable('Tree references not supported')
73
73
 
74
74
    def create_nested(self):
75
75
        work_tree = self.make_branch_and_tree('wt')
88
88
 
89
89
    def test_get_reference_revision(self):
90
90
        tree = self.create_nested()
 
91
        tree.lock_read()
 
92
        self.addCleanup(tree.unlock)
91
93
        path = tree.id2path('sub-root')
92
94
        self.assertEqual('sub-1', tree.get_reference_revision('sub-root', path))
93
95
 
96
98
        tree.lock_read()
97
99
        self.addCleanup(tree.unlock)
98
100
        entry = tree.inventory['sub-root']
99
 
        self.assertEqual([(tree.abspath('subtree'), 'sub-root')],
 
101
        self.assertEqual([(u'subtree', 'sub-root')],
100
102
            list(tree.iter_references()))
101
103
 
102
104
    def test_get_root_id(self):
189
191
        work_tree = self.make_branch_and_tree('wt')
190
192
        tree = self._convert_tree(work_tree)
191
193
        self.assertIsInstance(tree.conflicts(), conflicts.ConflictList)
 
194
 
 
195
 
 
196
class TestIterEntriesByDir(TestCaseWithTree):
 
197
 
 
198
    def test_iteration_order(self):
 
199
        work_tree = self.make_branch_and_tree('.')
 
200
        self.build_tree(['a/', 'a/b/', 'a/b/c', 'a/d/', 'a/d/e', 'f/', 'f/g'])
 
201
        work_tree.add(['a', 'a/b', 'a/b/c', 'a/d', 'a/d/e', 'f', 'f/g'])
 
202
        tree = self._convert_tree(work_tree)
 
203
        output_order = [p for p, e in tree.iter_entries_by_dir()]
 
204
        self.assertEqual(['', 'a', 'f', 'a/b', 'a/d', 'a/b/c', 'a/d/e', 'f/g'],
 
205
                         output_order)