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')
60
60
def test_pull_changes_root_id(self):
61
61
tree = self.make_branch_and_tree('from')
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())
76
76
class TestPullWithOrphans(per_workingtree.TestCaseWithWorkingTree):
84
84
# Create an empty trunk
85
85
builder.build_snapshot(None, [
86
('add', ('', 'root-id', 'directory', ''))],
88
builder.build_snapshot(['1'], [
89
('add', ('dir', 'dir-id', 'directory', '')),
90
('add', ('file', 'file-id', 'file', 'trunk content\n')),],
92
builder.build_snapshot(['2'], [
86
('add', ('', b'root-id', 'directory', ''))],
88
builder.build_snapshot([b'1'], [
89
('add', ('dir', b'dir-id', 'directory', '')),
90
('add', ('file', b'file-id', 'file', b'trunk content\n')),],
92
builder.build_snapshot([b'2'], [
93
93
('unversion', 'dir'),],
95
95
builder.finish_series()
96
96
return builder.get_branch()
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