Rev 6512: Now that we have 2 possible locations where things exist, we must cleanup both. in http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

John Arbash Meinel john at arbash-meinel.com
Thu Sep 6 08:58:12 UTC 2012


At http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

------------------------------------------------------------
revno: 6512
revision-id: john at arbash-meinel.com-20120906085746-avc41t9oqw0dyyha
parent: john at arbash-meinel.com-20120906084428-n56g3myxk9mhj03n
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-remote-wt-tests-1046697
timestamp: Thu 2012-09-06 12:57:46 +0400
message:
  Now that we have 2 possible locations where things exist, we must cleanup both.
  
  test_kind_change was re-using the 'tree' location for each permutation of the test, and
  using osutils.rmtree() to cleanup. However that won't clean up the RemoteRepository
  location at all.
  So switch to using tree.bzrdir.root_transport.delete_tree(), and also check if the
  branch location needs to be cleaned up separately.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_parents.py'
--- a/bzrlib/tests/per_workingtree/test_parents.py	2011-06-14 01:26:41 +0000
+++ b/bzrlib/tests/per_workingtree/test_parents.py	2012-09-06 08:57:46 +0000
@@ -21,9 +21,7 @@
 
 from bzrlib import (
     errors,
-    osutils,
     revision as _mod_revision,
-    tests,
     )
 from bzrlib.inventory import (
     Inventory,
@@ -475,7 +473,12 @@
         # large hammer, this is a particularly sensitive area of code, so the
         # extra assurance is well worth it.
         tree._validate()
-        osutils.rmtree('tree')
+        # If tree.branch is remote
+        if (tree.bzrdir.root_transport.base
+            != tree.branch.bzrdir.root_transport.base):
+            # We have a lightweight checkout, delete both locations
+            tree.branch.bzrdir.root_transport.delete_tree('.')
+        tree.bzrdir.root_transport.delete_tree('.')
 
     def test_no_parents_just_root(self):
         """Test doing an empty commit - no parent, set a root only."""



More information about the bazaar-commits mailing list