99
100
class TestCaseWithTree(TestCaseWithControlDir):
101
102
def make_branch_and_tree(self, relpath):
102
made_control = self.make_bzrdir(relpath, format=
103
self.workingtree_format._matchingbzrdir)
103
bzrdir_format = self.workingtree_format.get_controldir_for_branch()
104
made_control = self.make_bzrdir(relpath, format=bzrdir_format)
104
105
made_control.create_repository()
105
made_control.create_branch()
106
return self.workingtree_format.initialize(made_control)
106
b = made_control.create_branch()
107
if getattr(self, 'repo_is_remote', False):
108
# If the repo is remote, then we just create a local lightweight
110
# XXX: This duplicates a lot of Branch.create_checkout, but we know
111
# we want a) lightweight, and b) a specific WT format. We also
112
# know that nothing should already exist, etc.
113
t = transport.get_transport(relpath)
115
wt_dir = bzrdir_format.initialize_on_transport(t)
116
branch_ref = wt_dir.set_branch_reference(b)
117
wt = wt_dir.create_workingtree(None, from_branch=branch_ref)
119
wt = self.workingtree_format.initialize(made_control)
108
122
def workingtree_to_test_tree(self, tree):
109
123
return self._workingtree_to_test_tree(self, tree)