86
86
tree = workingtree.WorkingTree.open('repo/tree')
87
87
self.assertEqual(tree.bzrdir.root_transport.base,
88
88
tree.branch.repository.bzrdir.root_transport.base)
90
def test_make_with_trees(self):
91
repo = self.make_repository('repo', shared=True)
92
repo.set_make_working_trees(False)
93
self.run_bzr('reconfigure --with-trees', working_dir='repo')
94
self.assertIs(True, repo.make_working_trees())
96
def test_make_with_trees_already_trees(self):
97
repo = self.make_repository('repo', shared=True)
98
repo.set_make_working_trees(True)
99
self.run_bzr_error([" already creates working trees"],
100
'reconfigure --with-trees repo')
102
def test_make_without_trees(self):
103
repo = self.make_repository('repo', shared=True)
104
repo.set_make_working_trees(True)
105
self.run_bzr('reconfigure --with-no-trees', working_dir='repo')
106
self.assertIs(False, repo.make_working_trees())
108
def test_make_without_trees_already_no_trees(self):
109
repo = self.make_repository('repo', shared=True)
110
repo.set_make_working_trees(False)
111
self.run_bzr_error([" already doesn't create working trees"],
112
'reconfigure --with-no-trees repo')
114
def test_make_with_trees_nonshared_repo(self):
115
branch = self.make_branch('branch')
117
["Requested reconfiguration of '.*' is not supported"],
118
'reconfigure --with-trees branch')
120
def test_make_without_trees_leaves_tree_alone(self):
121
repo = self.make_repository('repo', shared=True)
122
branch = bzrdir.BzrDir.create_branch_convenience('repo/branch')
123
tree = workingtree.WorkingTree.open('repo/branch')
124
self.build_tree(['repo/branch/foo'])
126
self.run_bzr('reconfigure --with-no-trees --force',
127
working_dir='repo/branch')
128
self.failUnlessExists('repo/branch/foo')
129
tree = workingtree.WorkingTree.open('repo/branch')