28
28
tree = self.get_tree_no_parents_abc_content(work_tree)
29
29
tree_revision = getattr(tree, 'get_revision_id', lambda: 'current:')()
32
for revision, line in tree.annotate_iter('a-id'):
33
self.assertEqual('contents of a\n', line)
34
self.assertEqual(tree_revision, revision)
31
self.addCleanup(tree.unlock)
32
for revision, line in tree.annotate_iter('a-id'):
33
self.assertEqual('contents of a\n', line)
34
self.assertEqual(tree_revision, revision)
35
tree_revision = getattr(tree, 'get_revision_id', lambda: 'random:')()
36
for revision, line in tree.annotate_iter('a-id', 'random:'):
37
self.assertEqual('contents of a\n', line)
38
self.assertEqual(tree_revision, revision)
41
class TestPlanFileMerge(TestCaseWithTree):
43
def test_plan_file_merge(self):
44
work_a = self.make_branch_and_tree('wta')
45
self.build_tree_contents([('wta/file', 'a\nb\nc\nd\n')])
46
work_a.add('file', 'file-id')
47
work_a.commit('base version')
48
work_b = work_a.bzrdir.sprout('wtb').open_workingtree()
49
self.build_tree_contents([('wta/file', 'b\nc\nd\ne\n')])
50
tree_a = self.workingtree_to_test_tree(work_a)
52
self.addCleanup(tree_a.unlock)
53
self.build_tree_contents([('wtb/file', 'a\nc\nd\nf\n')])
54
tree_b = self.workingtree_to_test_tree(work_b)
56
self.addCleanup(tree_b.unlock)
64
], list(tree_a.plan_file_merge('file-id', tree_b)))
39
67
class TestReference(TestCaseWithTree):