Rev 2175: Fix some tests in bzrdir_implementations that assumed make_branch_and_tree returns a tree with the same bzrdir as the branch. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

Andrew Bennetts andrew.bennetts at canonical.com
Tue Mar 27 14:58:05 BST 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

------------------------------------------------------------
revno: 2175
revision-id: andrew.bennetts at canonical.com-20070327135702-vnyrun2ejnj5ji7j
parent: andrew.bennetts at canonical.com-20070327134409-img1fcrrh0dznei8
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Tue 2007-03-27 23:57:02 +1000
message:
  Fix some tests in bzrdir_implementations that assumed make_branch_and_tree returns a tree with the same bzrdir as the branch.
modified:
  bzrlib/tests/bzrdir_implementations/test_bzrdir.py test_bzrdir.py-20060131065642-0ebeca5e30e30866
=== modified file 'bzrlib/tests/bzrdir_implementations/test_bzrdir.py'
--- a/bzrlib/tests/bzrdir_implementations/test_bzrdir.py	2007-03-27 13:44:09 +0000
+++ b/bzrlib/tests/bzrdir_implementations/test_bzrdir.py	2007-03-27 13:57:02 +0000
@@ -316,12 +316,12 @@
 
     def test_clone_bzrdir_branch_and_repo(self):
         tree = self.make_branch_and_tree('commit_tree')
-        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
+        self.build_tree(['foo'], transport=tree.bzrdir.root_transport)
         tree.add('foo')
         tree.commit('revision 1')
         source = self.make_branch('source')
-        tree.bzrdir.open_repository().copy_content_into(source.repository)
-        tree.bzrdir.open_branch().copy_content_into(source)
+        tree.branch.repository.copy_content_into(source.repository)
+        tree.branch.copy_content_into(source)
         dir = source.bzrdir
         target = dir.clone(self.get_url('target'))
         self.assertNotEqual(dir.transport.base, target.transport.base)
@@ -337,12 +337,12 @@
     def test_clone_bzrdir_branch_and_repo_into_shared_repo(self):
         # by default cloning into a shared repo uses the shared repo.
         tree = self.make_branch_and_tree('commit_tree')
-        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
+        self.build_tree(['foo'], transport=tree.bzrdir.root_transport)
         tree.add('foo')
         tree.commit('revision 1')
         source = self.make_branch('source')
-        tree.bzrdir.open_repository().copy_content_into(source.repository)
-        tree.bzrdir.open_branch().copy_content_into(source)
+        tree.branch.repository.copy_content_into(source.repository)
+        tree.branch.copy_content_into(source)
         try:
             self.make_repository('target', shared=True)
         except errors.IncompatibleFormat:
@@ -357,12 +357,12 @@
     def test_clone_bzrdir_branch_and_repo_into_shared_repo_force_new_repo(self):
         # by default cloning into a shared repo uses the shared repo.
         tree = self.make_branch_and_tree('commit_tree')
-        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
+        self.build_tree(['foo'], transport=tree.bzrdir.root_transport)
         tree.add('foo')
         tree.commit('revision 1')
         source = self.make_branch('source')
-        tree.bzrdir.open_repository().copy_content_into(source.repository)
-        tree.bzrdir.open_branch().copy_content_into(source)
+        tree.branch.repository.copy_content_into(source.repository)
+        tree.branch.copy_content_into(source)
         try:
             self.make_repository('target', shared=True)
         except errors.IncompatibleFormat:
@@ -402,8 +402,8 @@
         tree.commit('revision 1', rev_id='1')
         tree.commit('revision 2', rev_id='2', allow_pointless=True)
         source = self.make_branch('source')
-        tree.bzrdir.open_repository().copy_content_into(source.repository)
-        tree.bzrdir.open_branch().copy_content_into(source)
+        tree.branch.repository.copy_content_into(source.repository)
+        tree.branch.copy_content_into(source)
         dir = source.bzrdir
         target = dir.clone(self.get_url('target'), revision_id='1')
         self.assertEqual('1', target.open_branch().last_revision())




More information about the bazaar-commits mailing list