~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
        transform.create_file('contents', trans_id2)
78
78
        transform.set_executability(False, trans_id2)
79
79
        transform.version_file('my_pretties2', trans_id2)
80
 
        transform.apply()
 
80
        modified_paths = transform.apply().modified_paths
81
81
        self.assertEqual('contents', self.wt.get_file_byname('name').read())
82
82
        self.assertEqual(self.wt.path2id('name'), 'my_pretties')
83
83
        self.assertIs(self.wt.is_executable('my_pretties'), True)
84
84
        self.assertIs(self.wt.is_executable('my_pretties2'), False)
85
85
        self.assertEqual('directory', file_kind(self.wt.abspath('oz')))
 
86
        self.assertEqual(len(modified_paths), 3)
 
87
        tree_mod_paths = [self.wt.id2abspath(f) for f in 
 
88
                          ('ozzie', 'my_pretties', 'my_pretties2')]
 
89
        self.assertSubset(tree_mod_paths, modified_paths)
86
90
        # is it safe to finalize repeatedly?
87
91
        transform.finalize()
88
92
        transform.finalize()
554
558
        self.assertEqual(this.wt.get_file_byname('i.OTHER').read(),
555
559
                         'h\ni\nj\nk\n')
556
560
        self.assertEqual(os.path.exists(this.wt.abspath('i.BASE')), False)
 
561
        modified = ['a', 'b', 'c', 'h', 'i']
 
562
        merge_modified = this.wt.merge_modified()
 
563
        self.assertSubset(merge_modified, modified)
 
564
        self.assertEqual(len(merge_modified), len(modified))
 
565
        file(this.wt.id2abspath('a'), 'wb').write('booga')
 
566
        modified.pop(0)
 
567
        merge_modified = this.wt.merge_modified()
 
568
        self.assertSubset(merge_modified, modified)
 
569
        self.assertEqual(len(merge_modified), len(modified))
557
570
 
558
571
    def test_file_merge(self):
559
572
        if not has_symlinks():