~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge with list_files

Show diffs side-by-side

added added

removed removed

Lines of Context:
2283
2283
        preview.set_executability(True, preview.trans_id_file_id('file-id'))
2284
2284
        preview_tree = preview.get_preview_tree()
2285
2285
        self.assertEqual(True, preview_tree.is_executable('file-id'))
 
2286
 
 
2287
    def test_plan_file_merge(self):
 
2288
        work_a = self.make_branch_and_tree('wta')
 
2289
        self.build_tree_contents([('wta/file', 'a\nb\nc\nd\n')])
 
2290
        work_a.add('file', 'file-id')
 
2291
        work_a.commit('base version')
 
2292
        tree_b = work_a.bzrdir.sprout('wtb').open_workingtree()
 
2293
        preview = TransformPreview(work_a)
 
2294
        self.addCleanup(preview.finalize)
 
2295
        trans_id = preview.trans_id_file_id('file-id')
 
2296
        preview.delete_contents(trans_id)
 
2297
        preview.create_file('b\nc\nd\ne\n', trans_id)
 
2298
        self.build_tree_contents([('wtb/file', 'a\nc\nd\nf\n')])
 
2299
        tree_a = preview.get_preview_tree()
 
2300
        self.assertEqual([
 
2301
            ('killed-b', 'b\n'),
 
2302
            ('killed-a', 'a\n'),
 
2303
            ('unchanged', 'c\n'),
 
2304
            ('unchanged', 'd\n'),
 
2305
            ('new-a', 'e\n'),
 
2306
            ('new-b', 'f\n'),
 
2307
        ], list(tree_a.plan_file_merge('file-id', tree_b)))