129
129
def test_record_initial_ghost_merge(self):
130
130
"""A pending merge with no revision present is still a merge."""
131
131
branch = Branch.initialize('.')
132
branch.add_pending_merge('non:existent@rev--ision--0--2')
132
branch.working_tree().add_pending_merge('non:existent@rev--ision--0--2')
133
133
branch.commit('pretend to merge nonexistent-revision', rev_id='first')
134
134
rev = branch.get_revision(branch.last_revision())
135
135
self.assertEqual(len(rev.parent_ids), 1)
149
149
def test_pending_merges(self):
150
150
"""Tracking pending-merged revisions."""
151
151
b = Branch.initialize('.')
153
self.assertEquals(b.pending_merges(), [])
154
b.add_pending_merge('foo@azkhazan-123123-abcabc')
155
self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
156
b.add_pending_merge('foo@azkhazan-123123-abcabc')
157
self.assertEquals(b.pending_merges(), ['foo@azkhazan-123123-abcabc'])
158
b.add_pending_merge('wibble@fofof--20050401--1928390812')
159
self.assertEquals(b.pending_merges(),
152
wt = b.working_tree()
153
self.assertEquals(wt.pending_merges(), [])
154
wt.add_pending_merge('foo@azkhazan-123123-abcabc')
155
self.assertEquals(wt.pending_merges(), ['foo@azkhazan-123123-abcabc'])
156
wt.add_pending_merge('foo@azkhazan-123123-abcabc')
157
self.assertEquals(wt.pending_merges(), ['foo@azkhazan-123123-abcabc'])
158
wt.add_pending_merge('wibble@fofof--20050401--1928390812')
159
self.assertEquals(wt.pending_merges(),
160
160
['foo@azkhazan-123123-abcabc',
161
161
'wibble@fofof--20050401--1928390812'])
162
162
b.commit("commit from base with two merges")
167
167
self.assertEquals(rev.parent_ids[1],
168
168
'wibble@fofof--20050401--1928390812')
169
169
# list should be cleared when we do a commit
170
self.assertEquals(b.pending_merges(), [])
170
self.assertEquals(wt.pending_merges(), [])
172
172
def test_sign_existing_revision(self):
173
173
branch = Branch.initialize('.')