Rev 2466: Add a (failing) test exposing the bug in _iter_changes in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/status_after_merge_110256
John Arbash Meinel
john at arbash-meinel.com
Thu Apr 26 21:46:04 BST 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/status_after_merge_110256
------------------------------------------------------------
revno: 2466
revision-id: john at arbash-meinel.com-20070426204553-sfw4mo98pxggdrfm
parent: pqm at pqm.ubuntu.com-20070426181928-ot99t6eyhjjfj5h3
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: status_after_merge_110256
timestamp: Thu 2007-04-26 15:45:53 -0500
message:
Add a (failing) test exposing the bug in _iter_changes
If you bzr mv a => b, and then bzr add a (for a new a), bzr can get
confused as to the state of 'a'.
modified:
bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
-------------- next part --------------
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py 2007-04-25 22:45:55 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py 2007-04-26 20:45:53 +0000
@@ -1318,3 +1318,39 @@
self.assertEqual(expected,
self.do_iter_changes(tree1, tree2,
want_unversioned=False))
+
+ def test_renamed_and_added(self):
+ """Test when we have renamed a file, and put another in its place."""
+ tree1 = self.make_branch_and_tree('tree1')
+ tree2 = self.make_to_branch_and_tree('tree2')
+ root_id = tree1.get_root_id()
+ tree2.set_root_id(root_id)
+
+ # The final changes are:
+ # bzr add b c
+ # bzr mv b a
+ # bzr mv c d
+ # bzr add b c
+
+ self.build_tree_contents([
+ ('tree1/b', 'b contents\n'),
+ ('tree1/c', 'c contents\n'),
+ ('tree2/a', 'b contents\n'),
+ ('tree2/b', 'new b contents\n'),
+ ('tree2/c', 'new c contents\n'),
+ ('tree2/d', 'c contents\n'),
+ ])
+ tree1.add(['b', 'c'], ['b1-id', 'c1-id'])
+ tree2.add(['a', 'b', 'c', 'd'], ['b1-id', 'b2-id', 'c2-id', 'c1-id'])
+
+ tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+
+ expected = sorted([
+ self.renamed(tree1, tree2, 'b1-id', False),
+ self.renamed(tree1, tree2, 'c1-id', False),
+ self.added(tree2, 'b2-id'),
+ self.added(tree2, 'c2-id'),
+ ])
+ self.assertEqual(expected,
+ self.do_iter_changes(tree1, tree2,
+ want_unversioned=True))
More information about the bazaar-commits
mailing list