/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/per_branch/test_stacking.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 15:21:06 UTC
  • mto: This revision was merged to the branch mainline in revision 6928.
  • Revision ID: jelmer@jelmer.uk-20180218152106-m8bmfurzlspweyu4
Yet more bees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
415
415
        if not stack_on.branch._format.supports_stacking():
416
416
            raise TestNotApplicable("%r does not support stacking"
417
417
                % self.branch_format)
418
 
        text_lines = ['line %d blah blah blah\n' % i for i in range(20)]
419
 
        self.build_tree_contents([('stack-on/a', ''.join(text_lines))])
 
418
        text_lines = [b'line %d blah blah blah\n' % i for i in range(20)]
 
419
        self.build_tree_contents([('stack-on/a', b''.join(text_lines))])
420
420
        stack_on.add('a')
421
421
        stack_on.commit('base commit')
422
422
        stacked_dir = stack_on.controldir.sprout('stacked', stacked=True)
423
423
        stacked_branch = stacked_dir.open_branch()
424
424
        local_tree = stack_on.controldir.sprout('local').open_workingtree()
425
425
        for i in range(20):
426
 
            text_lines[0] = 'changed in %d\n' % i
427
 
            self.build_tree_contents([('local/a', ''.join(text_lines))])
 
426
            text_lines[0] = b'changed in %d\n' % i
 
427
            self.build_tree_contents([('local/a', b''.join(text_lines))])
428
428
            local_tree.commit('commit %d' % i)
429
429
            local_tree.branch.push(stacked_branch)
430
430
        stacked_branch.repository.pack()
435
435
            raise TestNotApplicable("%r does not support stacking"
436
436
                % self.branch_format)
437
437
        stack_on = self.make_branch_and_tree('stack-on')
438
 
        text_lines = ['line %d blah blah blah\n' % i for i in range(20)]
439
 
        self.build_tree_contents([('stack-on/a', ''.join(text_lines))])
 
438
        text_lines = [b'line %d blah blah blah\n' % i for i in range(20)]
 
439
        self.build_tree_contents([('stack-on/a', b''.join(text_lines))])
440
440
        stack_on.add('a')
441
441
        stack_on.commit('base commit')
442
442
        # make a stacked branch from the mainline
445
445
        # make a second non-stacked branch from the mainline
446
446
        other_dir = stack_on.controldir.sprout('other')
447
447
        other_tree = other_dir.open_workingtree()
448
 
        text_lines[9] = 'changed in other\n'
449
 
        self.build_tree_contents([('other/a', ''.join(text_lines))])
 
448
        text_lines[9] = b'changed in other\n'
 
449
        self.build_tree_contents([('other/a', b''.join(text_lines))])
450
450
        stacked_revid = other_tree.commit('commit in other')
451
451
        # this should have generated a delta; try to pull that across
452
452
        # bug 252821 caused a RevisionNotPresent here...
460
460
        # works without error.
461
461
        # Make the source tree.
462
462
        src_tree = self.make_branch_and_tree('src')
463
 
        self.build_tree_contents([('src/a', 'content')])
 
463
        self.build_tree_contents([('src/a', b'content')])
464
464
        src_tree.add('a')
465
465
        src_tree.commit('first commit')
466
466
 
475
475
            raise TestNotApplicable('Format does not support stacking.')
476
476
 
477
477
        # Change the source branch.
478
 
        self.build_tree_contents([('src/a', 'new content')])
 
478
        self.build_tree_contents([('src/a', b'new content')])
479
479
        rev2 = src_tree.commit('second commit')
480
480
 
481
481
        # Fetch changes to the target.