~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-01 19:18:09 UTC
  • mfrom: (6459 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6460.
  • Revision ID: jelmer@samba.org-20120201191809-xn340a5i5v4fqsfu
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
656
656
        bundle = self.get_valid_bundle('null:', 'a@cset-0-4')
657
657
 
658
658
        # Modified files
659
 
        open('b1/sub/dir/WithCaps.txt', 'ab').write('\nAdding some text\n')
660
 
        open('b1/sub/dir/ pre space', 'ab').write(
 
659
        with open('b1/sub/dir/WithCaps.txt', 'ab') as f: f.write('\nAdding some text\n')
 
660
        with open('b1/sub/dir/ pre space', 'ab') as f: f.write(
661
661
             '\r\nAdding some\r\nDOS format lines\r\n')
662
 
        open('b1/sub/dir/nolastnewline.txt', 'ab').write('\n')
 
662
        with open('b1/sub/dir/nolastnewline.txt', 'ab') as f: f.write('\n')
663
663
        self.tree1.rename_one('sub/dir/ pre space',
664
664
                              'sub/ start space')
665
665
        self.tree1.commit('Modified files', rev_id='a@cset-0-5')
814
814
        self.tree1 = self.make_branch_and_tree('b1')
815
815
        self.b1 = self.tree1.branch
816
816
 
817
 
        open('b1/one', 'wb').write('one\n')
 
817
        with open('b1/one', 'wb') as f: f.write('one\n')
818
818
        self.tree1.add('one')
819
819
        self.tree1.commit('add file', rev_id='a@cset-0-1')
820
 
        open('b1/one', 'wb').write('two\n')
 
820
        with open('b1/one', 'wb') as f: f.write('two\n')
821
821
        self.tree1.commit('modify', rev_id='a@cset-0-2')
822
 
        open('b1/one', 'wb').write('three\n')
 
822
        with open('b1/one', 'wb') as f: f.write('three\n')
823
823
        self.tree1.commit('modify', rev_id='a@cset-0-3')
824
824
        bundle_file = StringIO()
825
825
        rev_ids = write_bundle(self.tree1.branch.repository, 'a@cset-0-3',
904
904
        bundle = self.get_valid_bundle('null:', 'white-1')
905
905
 
906
906
        # Modified
907
 
        open('b1/trailing space ', 'ab').write('add some text\n')
 
907
        with open('b1/trailing space ', 'ab') as f: f.write('add some text\n')
908
908
        self.tree1.commit('add text', rev_id='white-2')
909
909
 
910
910
        bundle = self.get_valid_bundle('white-1', 'white-2')