/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_workingtree/test_pull.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-06 01:18:08 UTC
  • mfrom: (7143 work)
  • mto: This revision was merged to the branch mainline in revision 7151.
  • Revision ID: jelmer@jelmer.uk-20181106011808-y870f4vq0ork3ahu
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    def test_pull_merges_tree_content(self):
56
56
        tree_a, tree_b, rev_a = self.get_pullable_trees()
57
57
        tree_b.pull(tree_a.branch)
58
 
        self.assertFileEqual('contents of from/file\n', 'to/file')
 
58
        self.assertFileEqual(b'contents of from/file\n', 'to/file')
59
59
 
60
60
    def test_pull_changes_root_id(self):
61
61
        tree = self.make_branch_and_tree('from')
66
66
        tree.add(['file'])
67
67
        tree.commit('first')
68
68
        to_tree = tree.controldir.sprout('to').open_workingtree()
69
 
        self.assertEqual('first_root_id', to_tree.get_root_id())
 
69
        self.assertEqual(b'first_root_id', to_tree.get_root_id())
70
70
        tree.set_root_id(b'second_root_id')
71
71
        tree.commit('second')
72
72
        to_tree.pull(tree.branch)
73
 
        self.assertEqual('second_root_id', to_tree.get_root_id())
 
73
        self.assertEqual(b'second_root_id', to_tree.get_root_id())
74
74
 
75
75
 
76
76
class TestPullWithOrphans(per_workingtree.TestCaseWithWorkingTree):
83
83
 
84
84
        # Create an empty trunk
85
85
        builder.build_snapshot(None, [
86
 
                ('add', ('', 'root-id', 'directory', ''))],
87
 
                revision_id='1')
88
 
        builder.build_snapshot(['1'], [
89
 
                ('add', ('dir', 'dir-id', 'directory', '')),
90
 
                ('add', ('file', 'file-id', 'file', 'trunk content\n')),],
91
 
                revision_id='2')
92
 
        builder.build_snapshot(['2'], [
 
86
                ('add', ('', b'root-id', 'directory', ''))],
 
87
                revision_id=b'1')
 
88
        builder.build_snapshot([b'1'], [
 
89
                ('add', ('dir', b'dir-id', 'directory', '')),
 
90
                ('add', ('file', b'file-id', 'file', b'trunk content\n')),],
 
91
                revision_id=b'2')
 
92
        builder.build_snapshot([b'2'], [
93
93
                ('unversion', 'dir'),],
94
 
                revision_id='3')
 
94
                revision_id=b'3')
95
95
        builder.finish_series()
96
96
        return builder.get_branch()
97
97
 
101
101
                '%r does not support missing parent conflicts' %
102
102
                    self.workingtree_format)
103
103
        trunk = self.make_branch_deleting_dir('trunk')
104
 
        work = trunk.controldir.sprout('work', revision_id='2').open_workingtree()
 
104
        work = trunk.controldir.sprout('work', revision_id=b'2').open_workingtree()
105
105
        work.branch.get_config_stack().set(
106
106
            'transform.orphan_policy', 'move')
107
107
        # Add some unversioned files in dir