Rev 2458: Add another (failing) test case. in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/rename_iter_changes_109993

John Arbash Meinel john at arbash-meinel.com
Wed Apr 25 22:54:26 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/rename_iter_changes_109993

------------------------------------------------------------
revno: 2458
revision-id: john at arbash-meinel.com-20070425215414-3zso9m2xndcd4rwp
parent: john at arbash-meinel.com-20070425184156-weys7l94o2nn6d4l
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: rename_iter_changes_109993
timestamp: Wed 2007-04-25 16:54:14 -0500
message:
  Add another (failing) test case.
  If we unversion a file, but it is still on disk
  we should get 2 records from _iter_changes
  one to indicate the removal
  the other to indicate the unknown file on disk
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 18:41:56 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py	2007-04-25 21:54:14 +0000
@@ -1281,3 +1281,34 @@
             ])
         self.assertEqual(expected,
                          self.do_iter_changes(tree1, tree2))
+
+    def test_deleted_and_unknown(self):
+        """Test a file marked removed, but still present on disk."""
+        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 should be:
+        # bzr add a b c
+        # bzr rm --keep b
+        self.build_tree_contents([
+            ('tree1/a', 'a contents\n'),
+            ('tree1/b', 'b contents\n'),
+            ('tree1/c', 'c contents\n'),
+            ('tree2/a', 'a contents\n'),
+            ('tree2/b', 'b contents\n'),
+            ('tree2/c', 'c contents\n'),
+            ])
+        tree1.add(['a', 'b', 'c'], ['a-id', 'b-id', 'c-id'])
+        tree2.add(['a', 'c'], ['a-id', 'c-id'])
+
+        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
+
+        expected = sorted([
+            self.deleted(tree1, 'b-id'),
+            self.unversioned(tree2, 'b'),
+            ])
+        self.assertEqual(expected,
+                         self.do_iter_changes(tree1, tree2,
+                                              want_unversioned=True))



More information about the bazaar-commits mailing list