240
240
def create_duplicate_lines_tree(self):
241
tree1 = self.make_branch_and_tree('tree1')
241
builder = self.make_branch_builder('branch')
242
builder.start_series()
243
self.addCleanup(builder.finish_series)
242
244
base_text = ''.join(l for r, l in duplicate_base)
243
245
a_text = ''.join(l for r, l in duplicate_A)
244
246
b_text = ''.join(l for r, l in duplicate_B)
245
247
c_text = ''.join(l for r, l in duplicate_C)
246
248
d_text = ''.join(l for r, l in duplicate_D)
247
249
e_text = ''.join(l for r, l in duplicate_E)
248
self.build_tree_contents([('tree1/file', base_text)])
249
tree1.add(['file'], ['file-id'])
250
tree1.commit('base', rev_id='rev-base')
251
tree2 = tree1.bzrdir.sprout('tree2').open_workingtree()
253
self.build_tree_contents([('tree1/file', a_text),
254
('tree2/file', b_text)])
255
tree1.commit('A', rev_id='rev-A')
256
tree2.commit('B', rev_id='rev-B')
258
tree2.merge_from_branch(tree1.branch)
259
conflicts.resolve(tree2, None) # Resolve the conflicts
260
self.build_tree_contents([('tree2/file', d_text)])
261
tree2.commit('D', rev_id='rev-D')
263
self.build_tree_contents([('tree1/file', c_text)])
264
tree1.commit('C', rev_id='rev-C')
266
tree1.merge_from_branch(tree2.branch)
267
conflicts.resolve(tree1, None) # Resolve the conflicts
268
self.build_tree_contents([('tree1/file', e_text)])
269
tree1.commit('E', rev_id='rev-E')
250
builder.build_snapshot('rev-base', None, [
251
('add', ('', 'root-id', 'directory', None)),
252
('add', ('file', 'file-id', 'file', base_text)),
254
builder.build_snapshot('rev-A', ['rev-base'], [
255
('modify', ('file-id', a_text))])
256
builder.build_snapshot('rev-B', ['rev-base'], [
257
('modify', ('file-id', b_text))])
258
builder.build_snapshot('rev-C', ['rev-A'], [
259
('modify', ('file-id', c_text))])
260
builder.build_snapshot('rev-D', ['rev-B', 'rev-A'], [
261
('modify', ('file-id', d_text))])
262
builder.build_snapshot('rev-E', ['rev-C', 'rev-D'], [
263
('modify', ('file-id', e_text))])
272
266
def assertRepoAnnotate(self, expected, repo, file_id, revision_id):
273
267
"""Assert that the revision is properly annotated."""