~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge with extras

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from bzrlib import (
18
18
    errors,
 
19
    conflicts,
 
20
    revisiontree,
19
21
    tests,
20
 
    conflicts,
 
22
    workingtree_4,
21
23
    )
22
24
from bzrlib.tests import TestSkipped
23
25
from bzrlib.tests.tree_implementations import TestCaseWithTree
203
205
        output_order = [p for p, e in tree.iter_entries_by_dir()]
204
206
        self.assertEqual(['', 'a', 'f', 'a/b', 'a/d', 'a/b/c', 'a/d/e', 'f/g'],
205
207
                         output_order)
 
208
 
 
209
 
 
210
class TestExtras(TestCaseWithTree):
 
211
 
 
212
    def test_extras(self):
 
213
        work_tree = self.make_branch_and_tree('tree')
 
214
        self.build_tree(['tree/file', 'tree/versioned-file'])
 
215
        work_tree.add(['file', 'versioned-file'])
 
216
        work_tree.commit('add files')
 
217
        work_tree.remove('file')
 
218
        tree = self._convert_tree(work_tree)
 
219
        if isinstance(tree,
 
220
                      (revisiontree.RevisionTree,
 
221
                       workingtree_4.DirStateRevisionTree)):
 
222
            expected = []
 
223
        else:
 
224
            expected = ['file']
 
225
        tree.lock_read()
 
226
        self.addCleanup(tree.unlock)
 
227
        self.assertEqual(expected, list(tree.extras()))