/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

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        dir.create_repository()
150
150
        dir.create_branch()
151
151
        wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION)
152
 
        self.assertIs(wt.last_revision(), None)
 
152
        self.assertEqual([], wt.get_parent_ids())
153
153
 
154
154
    def test_clone_bzrdir_empty(self):
155
155
        dir = self.make_bzrdir('source')
446
446
        dir = tree.bzrdir
447
447
        target = dir.clone(self.get_url('target'), revision_id='1')
448
448
        self.skipIfNoWorkingTree(target)
449
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
449
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
450
450
 
451
451
    def test_clone_bzrdir_incomplete_source_with_basis(self):
452
452
        # ensure that basis really does grab from the basis by having incomplete source
465
465
        target = dir.clone(self.get_url('target'), basis=tree.bzrdir)
466
466
        self.assertEqual('2', target.open_branch().last_revision())
467
467
        try:
468
 
            self.assertEqual('2', target.open_workingtree().last_revision())
 
468
            self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
469
469
        except errors.NoWorkingTree:
470
470
            # It should have a working tree if it's able to have one, so if
471
471
            # we're here make sure it really can't have one.
855
855
        # place
856
856
        target.open_repository()
857
857
        # we trust that the working tree sprouting works via the other tests.
858
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
858
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
859
859
        self.assertEqual('1', target.open_branch().last_revision())
860
860
 
861
861
    def test_sprout_bzrdir_tree_revision(self):
871
871
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
872
872
        dir = tree.bzrdir
873
873
        target = self.sproutOrSkip(dir, self.get_url('target'), revision_id='1')
874
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
874
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
875
875
 
876
876
    def test_sprout_bzrdir_incomplete_source_with_basis(self):
877
877
        # ensure that basis really does grab from the basis by having incomplete source
890
890
        target = self.sproutOrSkip(dir, self.get_url('target'),
891
891
                                   basis=tree.bzrdir)
892
892
        self.assertEqual('2', target.open_branch().last_revision())
893
 
        self.assertEqual('2', target.open_workingtree().last_revision())
 
893
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
894
894
        self.assertTrue(target.open_branch().repository.has_revision('2'))
895
895
 
896
896
    def test_format_initialize_find_open(self):
1037
1037
            made_tree = made_control.create_workingtree(revision_id='a')
1038
1038
        except errors.NotLocalUrl:
1039
1039
            raise TestSkipped("Can't make working tree on transport %r" % t)
1040
 
        self.assertEqual('a', made_tree.last_revision())
 
1040
        self.assertEqual(['a'], made_tree.get_parent_ids())
1041
1041
        
1042
1042
    def test_open_workingtree(self):
1043
1043
        if not self.bzrdir_format.is_supported():