~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(robertc) Deprecate WorkingTree.pending_merges.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        dir.create_repository()
149
149
        dir.create_branch()
150
150
        wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION)
151
 
        self.assertIs(wt.last_revision(), None)
 
151
        self.assertEqual([], wt.get_parent_ids())
152
152
 
153
153
    def test_clone_bzrdir_empty(self):
154
154
        dir = self.make_bzrdir('source')
445
445
        dir = tree.bzrdir
446
446
        target = dir.clone(self.get_url('target'), revision_id='1')
447
447
        self.skipIfNoWorkingTree(target)
448
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
448
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
449
449
 
450
450
    def test_clone_bzrdir_incomplete_source_with_basis(self):
451
451
        # ensure that basis really does grab from the basis by having incomplete source
464
464
        target = dir.clone(self.get_url('target'), basis=tree.bzrdir)
465
465
        self.assertEqual('2', target.open_branch().last_revision())
466
466
        try:
467
 
            self.assertEqual('2', target.open_workingtree().last_revision())
 
467
            self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
468
468
        except errors.NoWorkingTree:
469
469
            # It should have a working tree if it's able to have one, so if
470
470
            # we're here make sure it really can't have one.
837
837
        # place
838
838
        target.open_repository()
839
839
        # we trust that the working tree sprouting works via the other tests.
840
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
840
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
841
841
        self.assertEqual('1', target.open_branch().last_revision())
842
842
 
843
843
    def test_sprout_bzrdir_tree_revision(self):
853
853
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
854
854
        dir = tree.bzrdir
855
855
        target = self.sproutOrSkip(dir, self.get_url('target'), revision_id='1')
856
 
        self.assertEqual('1', target.open_workingtree().last_revision())
 
856
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
857
857
 
858
858
    def test_sprout_bzrdir_incomplete_source_with_basis(self):
859
859
        # ensure that basis really does grab from the basis by having incomplete source
872
872
        target = self.sproutOrSkip(dir, self.get_url('target'),
873
873
                                   basis=tree.bzrdir)
874
874
        self.assertEqual('2', target.open_branch().last_revision())
875
 
        self.assertEqual('2', target.open_workingtree().last_revision())
 
875
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
876
876
        self.assertTrue(target.open_branch().repository.has_revision('2'))
877
877
 
878
878
    def test_format_initialize_find_open(self):
1019
1019
            made_tree = made_control.create_workingtree(revision_id='a')
1020
1020
        except errors.NotLocalUrl:
1021
1021
            raise TestSkipped("Can't make working tree on transport %r" % t)
1022
 
        self.assertEqual('a', made_tree.last_revision())
 
1022
        self.assertEqual(['a'], made_tree.get_parent_ids())
1023
1023
        
1024
1024
    def test_open_workingtree(self):
1025
1025
        if not self.bzrdir_format.is_supported():