136
136
tree.commit('foo', rev_id='foo', local=True)
137
137
self.failIf(master.repository.has_revision('foo'))
138
138
self.assertEqual(None, master.last_revision())
140
def test_record_initial_ghost(self):
141
"""The working tree needs to record ghosts during commit."""
142
wt = self.make_branch_and_tree('.')
143
wt.set_parent_ids(['non:existent@rev--ision--0--2'],
144
allow_leftmost_as_ghost=True)
145
rev_id = wt.commit('commit against a ghost first parent.')
146
rev = wt.branch.repository.get_revision(rev_id)
147
self.assertEqual(rev.parent_ids, ['non:existent@rev--ision--0--2'])
148
# parent_sha1s is not populated now, WTF. rbc 20051003
149
self.assertEqual(len(rev.parent_sha1s), 0)
151
def test_record_two_ghosts(self):
152
"""The working tree should preserve all the parents during commit."""
153
wt = self.make_branch_and_tree('.')
155
'foo@azkhazan-123123-abcabc',
156
'wibble@fofof--20050401--1928390812',
158
allow_leftmost_as_ghost=True)
159
rev_id = wt.commit("commit from ghost base with one merge")
160
# the revision should have been committed with two parents
161
rev = wt.branch.repository.get_revision(rev_id)
162
self.assertEqual(['foo@azkhazan-123123-abcabc',
163
'wibble@fofof--20050401--1928390812'],
141
166
class TestCommitProgress(TestCaseWithWorkingTree):