/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_send.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        super(TestSend, self).setUp()
66
66
        grandparent_tree = ControlDir.create_standalone_workingtree(
67
67
            'grandparent')
68
 
        self.build_tree_contents([('grandparent/file1', 'grandparent')])
 
68
        self.build_tree_contents([('grandparent/file1', b'grandparent')])
69
69
        grandparent_tree.add('file1')
70
 
        grandparent_tree.commit('initial commit', rev_id='rev1')
 
70
        grandparent_tree.commit('initial commit', rev_id=b'rev1')
71
71
 
72
72
        parent_bzrdir = grandparent_tree.controldir.sprout('parent')
73
73
        parent_tree = parent_bzrdir.open_workingtree()
74
 
        parent_tree.commit('next commit', rev_id='rev2')
 
74
        parent_tree.commit('next commit', rev_id=b'rev2')
75
75
 
76
76
        branch_tree = parent_tree.controldir.sprout('branch').open_workingtree()
77
 
        self.build_tree_contents([('branch/file1', 'branch')])
78
 
        branch_tree.commit('last commit', rev_id='rev3')
 
77
        self.build_tree_contents([('branch/file1', b'branch')])
 
78
        branch_tree.commit('last commit', rev_id=b'rev3')
79
79
 
80
80
    def assertFormatIs(self, fmt_string, md):
81
81
        self.assertEqual(fmt_string, md.get_raw_bundle().splitlines()[0])
276
276
    def make_parent_and_local_branches(self):
277
277
        # Create a 'parent' branch as the base
278
278
        self.parent_tree = ControlDir.create_standalone_workingtree('parent')
279
 
        self.build_tree_contents([('parent/file', 'parent')])
 
279
        self.build_tree_contents([('parent/file', b'parent')])
280
280
        self.parent_tree.add('file')
281
 
        self.parent_tree.commit('first commit', rev_id='parent')
 
281
        self.parent_tree.commit('first commit', rev_id=b'parent')
282
282
        # Branch 'local' from parent and do a change
283
283
        local_bzrdir = self.parent_tree.controldir.sprout('local')
284
284
        self.local_tree = local_bzrdir.open_workingtree()
285
 
        self.build_tree_contents([('local/file', 'local')])
286
 
        self.local_tree.commit('second commit', rev_id='local')
 
285
        self.build_tree_contents([('local/file', b'local')])
 
286
        self.local_tree.commit('second commit', rev_id=b'local')
287
287
 
288
288
    _default_command = ['send', '-o-', '../parent']
289
289
    _default_wd = 'local'
380
380
    def _uncommitted_changes(self):
381
381
        self.make_parent_and_local_branches()
382
382
        # Make a change without committing it
383
 
        self.build_tree_contents([('local/file', 'modified')])
 
383
        self.build_tree_contents([('local/file', b'modified')])
384
384
 
385
385
    def _pending_merges(self):
386
386
        self.make_parent_and_local_branches()
387
387
        # Create 'other' branch containing a new file
388
388
        other_bzrdir = self.parent_tree.controldir.sprout('other')
389
389
        other_tree = other_bzrdir.open_workingtree()
390
 
        self.build_tree_contents([('other/other-file', 'other')])
 
390
        self.build_tree_contents([('other/other-file', b'other')])
391
391
        other_tree.add('other-file')
392
 
        other_tree.commit('other commit', rev_id='other')
 
392
        other_tree.commit('other commit', rev_id=b'other')
393
393
        # Merge and revert, leaving a pending merge
394
394
        self.local_tree.merge_from_branch(other_tree.branch)
395
395
        self.local_tree.revert(filenames=['other-file'], backups=False)
398
398
        self.make_parent_and_local_branches()
399
399
        self.run_bzr(['checkout', '--lightweight', 'local', 'checkout'])
400
400
        # Make a change and commit it
401
 
        self.build_tree_contents([('local/file', 'modified in local')])
402
 
        self.local_tree.commit('modify file', rev_id='modified-in-local')
 
401
        self.build_tree_contents([('local/file', b'modified in local')])
 
402
        self.local_tree.commit('modify file', rev_id=b'modified-in-local')
403
403
        # Exercise commands from the checkout directory
404
404
        self._default_wd = 'checkout'
405
405
        self._default_errors = ["Working tree is out of date, please run"
448
448
    def test_send(self):
449
449
        self.setup_smart_server_with_call_log()
450
450
        t = self.make_branch_and_tree('branch')
451
 
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
451
        self.build_tree_contents([('branch/foo', b'thecontents')])
452
452
        t.add("foo")
453
453
        t.commit("message")
454
454
        local = t.controldir.sprout('local-branch').open_workingtree()
455
 
        self.build_tree_contents([('branch/foo', 'thenewcontents')])
 
455
        self.build_tree_contents([('branch/foo', b'thenewcontents')])
456
456
        local.commit("anothermessage")
457
457
        self.reset_smart_call_log()
458
458
        out, err = self.run_bzr(