2957
2957
# this obviously requires a format that supports branch references
2958
2958
# so check for that by checking bzrdir.BzrDirFormat.get_default_format()
2960
b = self.make_branch(relpath, format=format)
2962
return b.bzrdir.create_workingtree()
2963
except errors.NotLocalUrl:
2964
# We can only make working trees locally at the moment. If the
2965
# transport can't support them, then we keep the non-disk-backed
2966
# branch and create a local checkout.
2967
if self.vfs_transport_factory is test_server.LocalURLServer:
2968
# the branch is colocated on disk, we cannot create a checkout.
2969
# hopefully callers will expect this.
2970
local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))
2971
wt = local_controldir.create_workingtree()
2972
if wt.branch._format != b._format:
2974
# Make sure that assigning to wt._branch fixes wt.branch,
2975
# in case the implementation details of workingtree objects
2977
self.assertIs(b, wt.branch)
2980
return b.create_checkout(relpath, lightweight=True)
2960
format = self.resolve_format(format)
2961
if not format.supports_workingtrees:
2962
b = self.make_branch(relpath+".branch", format=format)
2963
return b.create_checkout(relpath, lightweight=True)
2965
b = self.make_branch(relpath, format=format)
2967
return b.bzrdir.create_workingtree()
2968
except errors.NotLocalUrl:
2969
# We can only make working trees locally at the moment. If the
2970
# transport can't support them, then we keep the non-disk-backed
2971
# branch and create a local checkout.
2972
if self.vfs_transport_factory is test_server.LocalURLServer:
2973
# the branch is colocated on disk, we cannot create a checkout.
2974
# hopefully callers will expect this.
2975
local_controldir = bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))
2976
wt = local_controldir.create_workingtree()
2977
if wt.branch._format != b._format:
2979
# Make sure that assigning to wt._branch fixes wt.branch,
2980
# in case the implementation details of workingtree objects
2982
self.assertIs(b, wt.branch)
2985
return b.create_checkout(relpath, lightweight=True)
2982
2987
def assertIsDirectory(self, relpath, transport):
2983
2988
"""Assert that relpath within transport is a directory.