~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge with extras

Show diffs side-by-side

added added

removed removed

Lines of Context:
2376
2376
        expected = [(('', 'tree-root'),
2377
2377
                    [('a', 'a', 'file', None, 'a-id', 'file')])]
2378
2378
        self.assertEqual(expected, list(preview_tree.walkdirs()))
 
2379
 
 
2380
    def test_extras(self):
 
2381
        work_tree = self.make_branch_and_tree('tree')
 
2382
        self.build_tree(['tree/removed-file', 'tree/existing-file',
 
2383
                         'tree/not-removed-file'])
 
2384
        work_tree.add(['removed-file', 'not-removed-file'])
 
2385
        preview = TransformPreview(work_tree)
 
2386
        self.addCleanup(preview.finalize)
 
2387
        preview.new_file('new-file', preview.root, 'contents')
 
2388
        preview.new_file('new-versioned-file', preview.root, 'contents',
 
2389
                         'new-versioned-id')
 
2390
        tree = preview.get_preview_tree()
 
2391
        preview.unversion_file(preview.trans_id_tree_path('removed-file'))
 
2392
        self.assertEqual(set(['new-file', 'removed-file', 'existing-file']),
 
2393
                         set(tree.extras()))