/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
        self.run_bzr(['commit', '-m', 'first commit', 'a'])
93
93
 
94
94
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
95
 
        self.build_tree_contents([('b/a_file', b'changes in b')])
 
95
        self.build_tree_contents([('b/a_file', 'changes in b')])
96
96
        self.run_bzr(['commit', '-m', 'first commit in b', 'b'])
97
97
 
98
 
        self.build_tree_contents([('a/a_file', b'new contents')])
 
98
        self.build_tree_contents([('a/a_file', 'new contents')])
99
99
        self.run_bzr(['commit', '-m', 'change in a', 'a'])
100
100
 
101
101
        b_tree.merge_from_branch(a_tree.branch)
126
126
    def test_verbose_commit_modified(self):
127
127
        # Verbose commit of modified file should say so
128
128
        wt = self.prepare_simple_history()
129
 
        self.build_tree_contents([('hello.txt', b'new contents')])
 
129
        self.build_tree_contents([('hello.txt', 'new contents')])
130
130
        out, err = self.run_bzr('commit -m modified')
131
131
        self.assertEqual('', out)
132
132
        self.assertContainsRe(err, '^Committing to: .*\n'
320
320
            other_tree.remove(['dirtoremove', 'filetoremove'])
321
321
            self.build_tree_contents([
322
322
                ('other/newdir/',),
323
 
                ('other/filetomodify', b'new content'),
324
 
                ('other/newfile', b'new file content')])
 
323
                ('other/filetomodify', 'new content'),
 
324
                ('other/newfile', 'new file content')])
325
325
            other_tree.add('newfile')
326
326
            other_tree.add('newdir/')
327
327
            other_tree.commit('modify all sample files and dirs.')
347
347
 
348
348
    def test_empty_commit_message(self):
349
349
        tree = self.make_branch_and_tree('.')
350
 
        self.build_tree_contents([('foo.c', b'int main() {}')])
 
350
        self.build_tree_contents([('foo.c', 'int main() {}')])
351
351
        tree.add('foo.c')
352
352
        self.run_bzr('commit -m ""')
353
353
 
357
357
        outer_tree = self.make_branch_and_tree('.')
358
358
        inner_tree = self.make_branch_and_tree('branch')
359
359
        self.build_tree_contents([
360
 
            ('branch/foo.c', b'int main() {}'),
361
 
            ('branch/bar.c', b'int main() {}')])
 
360
            ('branch/foo.c', 'int main() {}'),
 
361
            ('branch/bar.c', 'int main() {}')])
362
362
        inner_tree.add(['foo.c', 'bar.c'])
363
363
        # can't commit files in different trees; sane error
364
364
        self.run_bzr('commit -m newstuff branch/foo.c .', retcode=3)
403
403
        trunk = self.make_branch_and_tree('trunk')
404
404
 
405
405
        u1 = trunk.branch.create_checkout('u1')
406
 
        self.build_tree_contents([('u1/hosts', b'initial contents\n')])
 
406
        self.build_tree_contents([('u1/hosts', 'initial contents\n')])
407
407
        u1.add('hosts')
408
408
        self.run_bzr('commit -m add-hosts u1')
409
409
 
410
410
        u2 = trunk.branch.create_checkout('u2')
411
 
        self.build_tree_contents([('u2/hosts', b'altered in u2\n')])
 
411
        self.build_tree_contents([('u2/hosts', 'altered in u2\n')])
412
412
        self.run_bzr('commit -m checkin-from-u2 u2')
413
413
 
414
414
        # make an offline commits
415
 
        self.build_tree_contents([('u1/hosts', b'first offline change in u1\n')])
 
415
        self.build_tree_contents([('u1/hosts', 'first offline change in u1\n')])
416
416
        self.run_bzr('commit -m checkin-offline --local u1')
417
417
 
418
418
        # now try to pull in online work from u2, and then commit our offline
432
432
        # add a text change here to represent resolving the merge conflicts in
433
433
        # favour of a new version of the file not identical to either the u1
434
434
        # version or the u2 version.
435
 
        self.build_tree_contents([('u1/hosts', b'merge resolution\n')])
 
435
        self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
436
436
        self.run_bzr('commit -m checkin-merge-of-the-offline-work-from-u1 u1')
437
437
 
438
438
    def test_commit_exclude_excludes_modified_files(self):
759
759
        # then during partial commit we have error
760
760
        # parent_id {dir-XXX} not in inventory
761
761
        t.rename_one('dir/a', 'a')
762
 
        self.build_tree_contents([('test', b'changes in test')])
 
762
        self.build_tree_contents([('test', 'changes in test')])
763
763
        # partial commit
764
764
        out, err = self.run_bzr('commit test -m "partial commit"')
765
765
        self.assertEqual('', out)