~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(andrew) Correctly do stub initialization of pre-metadir trees over sftp for compatability with 0.7 and earlier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
988
988
            # because the default open will not open them and
989
989
            # they may not be initializable.
990
990
            return
991
 
        # this has to be tested with local access as we still support creating 
992
 
        # format 6 bzrdirs
993
 
        t = get_transport('.')
 
991
        t = self.get_transport()
994
992
        made_control = self.bzrdir_format.initialize(t.base)
995
993
        made_repo = made_control.create_repository()
996
994
        made_branch = made_control.create_branch()
997
 
        made_tree = made_control.create_workingtree()
 
995
        made_tree = self.createWorkingTreeOrSkip(made_control)
998
996
        self.failUnless(isinstance(made_tree, workingtree.WorkingTree))
999
997
        self.assertEqual(made_control, made_tree.bzrdir)
1000
998
        
1001
999
    def test_create_workingtree_revision(self):
1002
1000
        # a bzrdir can construct a working tree for itself @ a specific revision.
 
1001
        t = self.get_transport()
1003
1002
        source = self.make_branch_and_tree('source')
1004
1003
        source.commit('a', rev_id='a', allow_pointless=True)
1005
1004
        source.commit('b', rev_id='b', allow_pointless=True)
1006
1005
        self.build_tree(['new/'])
1007
 
        made_control = self.bzrdir_format.initialize('new')
 
1006
        t_new = t.clone('new')
 
1007
        made_control = self.bzrdir_format.initialize_on_transport(t_new)
1008
1008
        source.branch.repository.clone(made_control)
1009
1009
        source.branch.clone(made_control)
1010
 
        made_tree = made_control.create_workingtree(revision_id='a')
 
1010
        try:
 
1011
            made_tree = made_control.create_workingtree(revision_id='a')
 
1012
        except errors.NotLocalUrl:
 
1013
            raise TestSkipped("Can't make working tree on transport %r" % t)
1011
1014
        self.assertEqual('a', made_tree.last_revision())
1012
1015
        
1013
1016
    def test_open_workingtree(self):