118
118
[first_revision, second_revision, third_revision], t)
121
class TestAddParentId(TestParents):
121
class TestAddParent(TestParents):
123
123
def test_add_first_parent_id(self):
124
124
"""Test adding the first parent id"""
149
149
first_revision = tree.commit('first post')
150
150
tree.add_parent_tree_id('second')
151
151
self.assertConsistentParents([first_revision, 'second'], tree)
153
def test_add_first_parent_tree(self):
154
"""Test adding the first parent id"""
155
tree = self.make_branch_and_tree('.')
156
first_revision = tree.commit('first post')
157
uncommit(tree.branch, tree=tree)
158
tree.add_parent_tree((first_revision,
159
tree.branch.repository.revision_tree(first_revision)))
160
self.assertConsistentParents([first_revision], tree)
162
def test_add_first_parent_tree_ghost(self):
163
"""Test adding the first parent id - as a ghost"""
164
tree = self.make_branch_and_tree('.')
165
tree.add_parent_tree(('first-revision', None))
166
self.assertConsistentParents(['first-revision'], tree)
168
def test_add_second_parent_tree(self):
169
"""Test adding the second parent id"""
170
tree = self.make_branch_and_tree('.')
171
first_revision = tree.commit('first post')
172
uncommit(tree.branch, tree=tree)
173
second_revision = tree.commit('second post')
174
tree.add_parent_tree((first_revision,
175
tree.branch.repository.revision_tree(first_revision)))
176
self.assertConsistentParents([second_revision, first_revision], tree)
178
def test_add_second_parent_tree_ghost(self):
179
"""Test adding the second parent id - as a ghost"""
180
tree = self.make_branch_and_tree('.')
181
first_revision = tree.commit('first post')
182
tree.add_parent_tree(('second', None))
183
self.assertConsistentParents([first_revision, 'second'], tree)