Rev 4523: Add a couple more annotate-after-merge tests for WT. in http://bazaar.launchpad.net/~jameinel/bzr/1.17-rework-annotate
John Arbash Meinel
john at arbash-meinel.com
Mon Jul 6 22:18:41 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/1.17-rework-annotate
------------------------------------------------------------
revno: 4523
revision-id: john at arbash-meinel.com-20090706211812-1w3mteni33dhv2kh
parent: john at arbash-meinel.com-20090706211330-kwyrjqhhzdo415st
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.17-rework-annotate
timestamp: Mon 2009-07-06 16:18:12 -0500
message:
Add a couple more annotate-after-merge tests for WT.
-------------- next part --------------
=== modified file 'bzrlib/tests/workingtree_implementations/test_annotate_iter.py'
--- a/bzrlib/tests/workingtree_implementations/test_annotate_iter.py 2009-07-06 21:13:30 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_annotate_iter.py 2009-07-06 21:18:12 +0000
@@ -132,3 +132,58 @@
self.assertEqual([('rev-2', 'initial content\n'),
('current:', 'new content\n'),
], annotations)
+
+ def test_annotate_same_as_merge_parent(self):
+ builder = self.make_branch_builder('branch')
+ builder.start_series()
+ builder.build_snapshot('rev-1', None, [
+ ('add', ('', 'TREE_ROOT', 'directory', None)),
+ ('add', ('file', 'file-id', 'file', 'initial content\n')),
+ ])
+ builder.build_snapshot('rev-2', ['rev-1'], [
+ ])
+ builder.build_snapshot('rev-3', ['rev-1'], [
+ ('modify', ('file-id', 'initial content\ncontent in 3\n')),
+ ])
+ builder.finish_series()
+ b = builder.get_branch()
+ tree = b.create_checkout('tree', revision_id='rev-2', lightweight=True)
+ tree.lock_write()
+ self.addCleanup(tree.unlock)
+ tree.set_parent_ids(['rev-2', 'rev-3'])
+ self.build_tree_contents([('tree/file',
+ 'initial content\ncontent in 3\n')])
+ annotations = tree.annotate_iter('file-id')
+ self.assertEqual([('rev-1', 'initial content\n'),
+ ('rev-3', 'content in 3\n'),
+ ], annotations)
+
+ def test_annotate_same_as_merge_parent_supersedes(self):
+ builder = self.make_branch_builder('branch')
+ builder.start_series()
+ builder.build_snapshot('rev-1', None, [
+ ('add', ('', 'TREE_ROOT', 'directory', None)),
+ ('add', ('file', 'file-id', 'file', 'initial content\n')),
+ ])
+ builder.build_snapshot('rev-2', ['rev-1'], [
+ ('modify', ('file-id', 'initial content\nnew content\n')),
+ ])
+ builder.build_snapshot('rev-3', ['rev-2'], [
+ ('modify', ('file-id', 'initial content\ncontent in 3\n')),
+ ])
+ builder.build_snapshot('rev-4', ['rev-3'], [
+ ('modify', ('file-id', 'initial content\nnew content\n')),
+ ])
+ # In this case, the content locally is the same as content in basis
+ # tree, but the merge revision states that *it* should win
+ builder.finish_series()
+ b = builder.get_branch()
+ tree = b.create_checkout('tree', revision_id='rev-2', lightweight=True)
+ tree.lock_write()
+ self.addCleanup(tree.unlock)
+ tree.set_parent_ids(['rev-2', 'rev-4'])
+ annotations = tree.annotate_iter('file-id')
+ self.assertEqual([('rev-1', 'initial content\n'),
+ ('rev-4', 'new content\n'),
+ ], annotations)
+
More information about the bazaar-commits
mailing list