~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Fix BzrDir.create_workingtree for NULL_REVISION

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                           NotBranchError,
34
34
                           )
35
35
import bzrlib.repository as repository
 
36
import bzrlib.revision
36
37
from bzrlib.tests import (
37
38
                          ChrootedTestCase,
38
39
                          TestCase,
142
143
            raise TestSkipped('Cannot sprout to remote bzrdirs.')
143
144
        return target
144
145
 
 
146
    def test_create_null_workingtree(self):
 
147
        dir = self.make_bzrdir('dir1')
 
148
        dir.create_repository()
 
149
        dir.create_branch()
 
150
        wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION)
 
151
        self.assertIs(wt.last_revision(), None)
 
152
 
145
153
    def test_clone_bzrdir_empty(self):
146
154
        dir = self.make_bzrdir('source')
147
155
        target = dir.clone(self.get_url('target'))