78
78
(third_revision, rev_tree3)])
79
79
self.assertConsistentParents(
80
80
[first_revision, second_revision, third_revision], t)
83
class TestAddParentId(TestParents):
85
def test_add_first_parent_id(self):
86
"""Test adding the first parent id"""
87
tree = self.make_branch_and_tree('.')
88
first_revision = tree.commit('first post')
89
uncommit(tree.branch, tree=tree)
90
tree.add_parent_tree_id(first_revision)
91
self.assertConsistentParents([first_revision], tree)
93
def test_add_first_parent_id_ghost(self):
94
"""Test adding the first parent id - as a ghost"""
95
tree = self.make_branch_and_tree('.')
96
tree.add_parent_tree_id('first-revision')
97
self.assertConsistentParents(['first-revision'], tree)
99
def test_add_second_parent_id(self):
100
"""Test adding the second parent id"""
101
tree = self.make_branch_and_tree('.')
102
first_revision = tree.commit('first post')
103
uncommit(tree.branch, tree=tree)
104
second_revision = tree.commit('second post')
105
tree.add_parent_tree_id(first_revision)
106
self.assertConsistentParents([second_revision, first_revision], tree)
108
def test_add_second_parent_id_ghost(self):
109
"""Test adding the second parent id - as a ghost"""
110
tree = self.make_branch_and_tree('.')
111
first_revision = tree.commit('first post')
112
tree.add_parent_tree_id('second')
113
self.assertConsistentParents([first_revision, 'second'], tree)