Rev 2235: Add some comments to test_clone_bzrdir_repository_branch_both_under_shared. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/
Andrew Bennetts
andrew.bennetts at canonical.com
Wed Apr 18 12:25:53 BST 2007
At sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/
------------------------------------------------------------
revno: 2235
revision-id: andrew.bennetts at canonical.com-20070418112453-r2711iqib94kutx0
parent: andrew.bennetts at canonical.com-20070418053831-u9bbsbljuzymrz6z
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Wed 2007-04-18 21:24:53 +1000
message:
Add some comments to test_clone_bzrdir_repository_branch_both_under_shared.
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-04-18 05:38:31 +0000
+++ b/bzrlib/tests/bzrdir_implementations/test_bzrdir.py 2007-04-18 11:24:53 +0000
@@ -232,23 +232,34 @@
self.assertRaises(errors.NoRepositoryPresent, target.open_repository)
def test_clone_bzrdir_repository_branch_both_under_shared(self):
+ # Create a shared repository
try:
shared_repo = self.make_repository('shared', shared=True)
except errors.IncompatibleFormat:
return
+ # Make a branch, 'commit_tree', and working tree outside of the shared
+ # repository, and commit some revisions to it.
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', rev_id='1')
tree.bzrdir.open_branch().set_revision_history([])
tree.set_parent_trees([])
tree.commit('revision 2', rev_id='2')
+ # Copy the content (i.e. revisions) from the 'commit_tree' branch's
+ # repository into the shared repository.
tree.branch.repository.copy_content_into(shared_repo)
+ # Make a branch 'source' inside the shared repository.
dir = self.make_bzrdir('shared/source')
dir.create_branch()
+ # Clone 'source' to 'target', also inside the shared repository.
target = dir.clone(self.get_url('shared/target'))
+ # 'source', 'target', and the shared repo all have distinct bzrdirs.
self.assertNotEqual(dir.transport.base, target.transport.base)
self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
+ # The shared repository will contain revisions from the 'commit_tree'
+ # repository, even revisions that are not part of the history of the
+ # 'commit_tree' branch.
self.assertTrue(shared_repo.has_revision('1'))
def test_clone_bzrdir_repository_branch_only_source_under_shared(self):
More information about the bazaar-commits
mailing list