/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2007-03-30 02:36:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2388.
  • Revision ID: robertc@robertcollins.net-20070330023636-v6k82rwz5isl6k3a
Remove the --basis parameter to clone etc. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
            raise TestSkipped("cannot make working tree with transport %r"
137
137
                              % a_bzrdir.transport)
138
138
 
139
 
    def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None, basis=None,
 
139
    def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None,
140
140
                     force_new_repo=False):
141
141
        """Sprout from_bzrdir into to_url, or raise TestSkipped.
142
142
        
145
145
        """
146
146
        try:
147
147
            target = from_bzrdir.sprout(to_url, revision_id=revision_id,
148
 
                                        basis=basis,
149
148
                                        force_new_repo=force_new_repo)
150
149
        except errors.NotLocalUrl:
151
150
            raise TestSkipped('Cannot sprout to remote bzrdirs.')
494
493
        self.skipIfNoWorkingTree(target)
495
494
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
496
495
 
497
 
    def test_clone_bzrdir_incomplete_source_with_basis(self):
498
 
        # ensure that basis really does grab from the basis by having incomplete source
499
 
        tree = self.make_branch_and_tree('commit_tree')
500
 
        self.build_tree(['foo'], transport=tree.bzrdir.transport.clone('..'))
501
 
        tree.add('foo')
502
 
        tree.commit('revision 1', rev_id='1')
503
 
        source = self.make_branch_and_tree('source')
504
 
        # this gives us an incomplete repository
505
 
        tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
506
 
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
507
 
        tree.bzrdir.open_branch().copy_content_into(source.branch)
508
 
        tree.copy_content_into(source)
509
 
        self.assertFalse(source.branch.repository.has_revision('2'))
510
 
        dir = source.bzrdir
511
 
        target = dir.clone(self.get_url('target'), basis=tree.bzrdir)
512
 
        self.assertEqual('2', target.open_branch().last_revision())
513
 
        try:
514
 
            self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
515
 
        except errors.NoWorkingTree:
516
 
            # It should have a working tree if it's able to have one, so if
517
 
            # we're here make sure it really can't have one.
518
 
            self.assertRaises(errors.NotLocalUrl, target.create_workingtree)
519
 
        self.assertTrue(target.open_branch().repository.has_revision('2'))
520
 
 
521
496
    def test_sprout_bzrdir_empty(self):
522
497
        dir = self.make_bzrdir('source')
523
498
        target = self.sproutOrSkip(dir, self.get_url('target'))
935
910
        target = self.sproutOrSkip(dir, self.get_url('target'), revision_id='1')
936
911
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
937
912
 
938
 
    def test_sprout_bzrdir_incomplete_source_with_basis(self):
939
 
        # ensure that basis really does grab from the basis by having incomplete source
940
 
        tree = self.make_branch_and_tree('commit_tree')
941
 
        self.build_tree(['commit_tree/foo'])
942
 
        tree.add('foo')
943
 
        tree.commit('revision 1', rev_id='1')
944
 
        source = self.make_branch_and_tree('source')
945
 
        # this gives us an incomplete repository
946
 
        tree.bzrdir.open_repository().copy_content_into(source.branch.repository)
947
 
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
948
 
        tree.bzrdir.open_branch().copy_content_into(source.branch)
949
 
        tree.copy_content_into(source)
950
 
        self.assertFalse(source.branch.repository.has_revision('2'))
951
 
        dir = source.bzrdir
952
 
        target = self.sproutOrSkip(dir, self.get_url('target'),
953
 
                                   basis=tree.bzrdir)
954
 
        self.assertEqual('2', target.open_branch().last_revision())
955
 
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
956
 
        self.assertTrue(target.open_branch().repository.has_revision('2'))
957
 
 
958
913
    def test_format_initialize_find_open(self):
959
914
        # loopback test to check the current format initializes to itself.
960
915
        if not self.bzrdir_format.is_supported():