~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

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():