Rev 2441: Add 2 new WT.move() tests, one of which exposes bug #105479 in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/rename_directory_105479

John Arbash Meinel john at arbash-meinel.com
Fri Apr 20 19:13:46 BST 2007


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

------------------------------------------------------------
revno: 2441
revision-id: john at arbash-meinel.com-20070420181339-dzr68u9iywq2elxs
parent: john at arbash-meinel.com-20070420175713-64x3r196vbqad3y2
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: rename_directory_105479
timestamp: Fri 2007-04-20 13:13:39 -0500
message:
  Add 2 new WT.move() tests, one of which exposes bug #105479
modified:
  bzrlib/tests/workingtree_implementations/test_move.py test_move.py-20070225171927-mohn2vqj5fx7edc6-1
-------------- next part --------------
=== modified file 'bzrlib/tests/workingtree_implementations/test_move.py'
--- a/bzrlib/tests/workingtree_implementations/test_move.py	2007-03-22 23:47:20 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_move.py	2007-04-20 18:13:39 +0000
@@ -358,6 +358,44 @@
                                ('a/c/d', 'd-id')], tree.basis_tree())
         tree._validate()
 
+    def test_move_directory_into_parent(self):
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['c/', 'c/b/', 'c/b/d/'])
+        tree.add(['c', 'c/b', 'c/b/d'],
+                 ['c-id', 'b-id', 'd-id'])
+        tree.commit('initial', rev_id='rev-1')
+        root_id = tree.get_root_id()
+
+        self.assertEqual([('c/b', 'b')],
+                         tree.move(['c/b'], ''))
+        self.assertTreeLayout([('', root_id),
+                               ('b', 'b-id'),
+                               ('c', 'c-id'),
+                               ('b/d', 'd-id'),
+                              ], tree)
+        tree._validate()
+
+    def test_move_directory_into_parent_with_new_child(self):
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['c/', 'c/b/', 'c/b/d/'])
+        tree.add(['c', 'c/b', 'c/b/d'],
+                 ['c-id', 'b-id', 'd-id'])
+        tree.commit('initial', rev_id='rev-1')
+        root_id = tree.get_root_id()
+
+        self.build_tree(['c/b/a/'])
+        tree.add(['c/b/a'], ['a-id'])
+
+        self.assertEqual([('c/b', 'b')],
+                         tree.move(['c/b'], ''))
+        self.assertTreeLayout([('', root_id),
+                               ('b', 'b-id'),
+                               ('c', 'c-id'),
+                               ('b/a', 'a-id'),
+                               ('b/d', 'd-id'),
+                              ], tree)
+        tree._validate()
+
     def test_move_moved(self):
         """Moving a moved entry works as expected."""
         tree = self.make_branch_and_tree('.')



More information about the bazaar-commits mailing list