135
135
preview = tt.get_preview_tree()
136
136
self.assertEqual(wt.get_root_id(), preview.get_root_id())
138
def test_merge_unrelated_retains_root(self):
139
wt = self.make_branch_and_tree('tree')
140
root_id_before_merge = wt.get_root_id()
141
other_tree = self.make_branch_and_tree('other')
142
# Do a commit so there is something to merge
143
other_tree.commit('commit other')
144
self.assertNotEquals(root_id_before_merge, other_tree.get_root_id())
145
wt.merge_from_branch(other_tree.branch,
146
from_revision=_mod_revision.NULL_REVISION)
147
self.assertEqual(root_id_before_merge, wt.get_root_id())
149
def test_merge_preview_unrelated_retains_root(self):
150
wt = self.make_branch_and_tree('tree')
151
other_tree = self.make_branch_and_tree('other')
152
# Do a commit so there is something to merge
153
other_tree.commit('commit other')
154
merger = _mod_merge.Merge3Merger(wt, wt, wt.basis_tree(), other_tree,
155
this_branch=wt.branch,
157
with merger.make_preview_transform() as tt:
158
preview = tt.get_preview_tree()
159
self.assertEqual(wt.get_root_id(), preview.get_root_id())
138
161
def test_create_rename(self):
139
162
"""Rename an inventory entry while creating the file"""
140
163
tree =self.make_branch_and_tree('.')