67
66
branch = self.make_branch('branch')
68
67
checkout = branch.create_checkout('checkout')
69
68
self.run_bzr('reconfigure --lightweight-checkout checkout')
71
def test_standalone_to_use_shared(self):
72
self.build_tree(['repo/'])
73
tree = self.make_branch_and_tree('repo/tree')
74
repo = self.make_repository('repo', shared=True)
75
self.run_bzr('reconfigure --use-shared', working_dir='repo/tree')
76
tree = workingtree.WorkingTree.open('repo/tree')
77
self.assertNotEqual(tree.bzrdir.root_transport.base,
78
tree.branch.repository.bzrdir.root_transport.base)
80
def test_use_shared_to_standalone(self):
81
repo = self.make_repository('repo', shared=True)
82
branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')
83
self.assertNotEqual(branch.bzrdir.root_transport.base,
84
branch.repository.bzrdir.root_transport.base)
85
self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
86
tree = workingtree.WorkingTree.open('repo/tree')
87
self.assertEqual(tree.bzrdir.root_transport.base,
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')