~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Martin Pool
  • Date: 2006-05-19 06:04:00 UTC
  • mfrom: (1714 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1717.
  • Revision ID: mbp@sourcefrog.net-20060519060400-df4657a818d9008a
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
        self.assertNotEqual(dir.transport.base, target.transport.base)
172
172
        self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
173
173
        self.assertTrue(shared_repo.has_revision('1'))
 
174
 
 
175
    def test_clone_bzrdir_repository_branch_only_source_under_shared(self):
 
176
        try:
 
177
            shared_repo = self.make_repository('shared', shared=True)
 
178
        except errors.IncompatibleFormat:
 
179
            return
 
180
        tree = self.make_branch_and_tree('commit_tree')
 
181
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
182
        tree.add('foo')
 
183
        tree.commit('revision 1', rev_id='1')
 
184
        tree.bzrdir.open_branch().set_revision_history([])
 
185
        tree.set_last_revision(None)
 
186
        tree.commit('revision 2', rev_id='2')
 
187
        tree.bzrdir.open_repository().copy_content_into(shared_repo)
 
188
        shared_repo.set_make_working_trees(False)
 
189
        self.assertFalse(shared_repo.make_working_trees())
 
190
        self.assertTrue(shared_repo.has_revision('1'))
 
191
        dir = self.make_bzrdir('shared/source')
 
192
        dir.create_branch()
 
193
        target = dir.clone(self.get_url('target'))
 
194
        self.assertNotEqual(dir.transport.base, target.transport.base)
 
195
        self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
 
196
        branch = target.open_branch()
 
197
        self.assertTrue(branch.repository.has_revision('1'))
 
198
        self.assertFalse(branch.repository.make_working_trees())
 
199
        self.assertTrue(branch.repository.is_shared())
174
200
        
175
201
    def test_clone_bzrdir_repository_under_shared_force_new_repo(self):
176
202
        tree = self.make_branch_and_tree('commit_tree')
480
506
        self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
481
507
        self.assertTrue(shared_repo.has_revision('1'))
482
508
 
 
509
    def test_sprout_bzrdir_repository_branch_only_source_under_shared(self):
 
510
        try:
 
511
            shared_repo = self.make_repository('shared', shared=True)
 
512
        except errors.IncompatibleFormat:
 
513
            return
 
514
        tree = self.make_branch_and_tree('commit_tree')
 
515
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
 
516
        tree.add('foo')
 
517
        tree.commit('revision 1', rev_id='1')
 
518
        tree.bzrdir.open_branch().set_revision_history([])
 
519
        tree.set_last_revision(None)
 
520
        tree.commit('revision 2', rev_id='2')
 
521
        tree.bzrdir.open_repository().copy_content_into(shared_repo)
 
522
        shared_repo.set_make_working_trees(False)
 
523
        self.assertFalse(shared_repo.make_working_trees())
 
524
        self.assertTrue(shared_repo.has_revision('1'))
 
525
        dir = self.make_bzrdir('shared/source')
 
526
        dir.create_branch()
 
527
        target = dir.sprout(self.get_url('target'))
 
528
        self.assertNotEqual(dir.transport.base, target.transport.base)
 
529
        self.assertNotEqual(dir.transport.base, shared_repo.bzrdir.transport.base)
 
530
        branch = target.open_branch()
 
531
        self.assertTrue(branch.repository.has_revision('1'))
 
532
        self.assertTrue(branch.repository.make_working_trees())
 
533
        self.assertFalse(branch.repository.is_shared())
 
534
 
483
535
    def test_sprout_bzrdir_repository_under_shared_force_new_repo(self):
484
536
        tree = self.make_branch_and_tree('commit_tree')
485
537
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))