Rev 2923: Add failing tests exposing part of bug #114615 in http://bzr.arbash-meinel.com/branches/bzr/0.92-dev/bogus_removal_114615

John Arbash Meinel john at arbash-meinel.com
Tue Oct 23 19:13:12 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.92-dev/bogus_removal_114615

------------------------------------------------------------
revno: 2923
revision-id:john at arbash-meinel.com-20071023181218-in3x181fnemz3vfj
parent: pqm at pqm.ubuntu.com-20071022014712-mpln8namgmsywr75
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bogus_removal_114615
timestamp: Tue 2007-10-23 13:12:18 -0500
message:
  Add failing tests exposing part of bug #114615
modified:
  bzrlib/tests/workingtree_implementations/test_commit.py test_commit.py-20060421013633-1610ec2331c8190f
-------------- next part --------------
=== modified file 'bzrlib/tests/workingtree_implementations/test_commit.py'
--- a/bzrlib/tests/workingtree_implementations/test_commit.py	2007-09-20 07:59:48 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_commit.py	2007-10-23 18:12:18 +0000
@@ -22,6 +22,7 @@
     branch,
     bzrdir,
     errors,
+    osutils,
     revision as _mod_revision,
     ui,
     uncommit,
@@ -88,6 +89,29 @@
 
 class TestCommit(TestCaseWithWorkingTree):
 
+    def test_autodelete_renamed(self):
+        tree_a = self.make_branch_and_tree('a')
+        self.build_tree(['a/dir/', 'a/dir/f1', 'a/dir/f2'])
+        tree_a.add(['dir', 'dir/f1', 'dir/f2'], ['dir-id', 'f1-id', 'f2-id'])
+        rev_id1 = tree_a.commit('init')
+        # Start off by renaming entries,
+        # but then actually auto delete the whole tree
+        # https://bugs.launchpad.net/bzr/+bug/114615
+        tree_a.rename_one('dir/f1', 'dir/a')
+        tree_a.rename_one('dir/f2', 'dir/z')
+        osutils.rmtree('a/dir')
+        tree_a.commit('autoremoved')
+
+        tree_a.lock_read()
+        try:
+            root_id = tree_a.inventory.root.file_id
+            paths = [(path, ie.file_id)
+                     for path, ie in tree_a.iter_entries_by_dir()]
+        finally:
+            tree_a.unlock()
+        # The only paths left should be the root
+        self.assertEqual([('', root_id)], paths)
+
     def test_commit_sets_last_revision(self):
         tree = self.make_branch_and_tree('tree')
         committed_id = tree.commit('foo', rev_id='foo')



More information about the bazaar-commits mailing list