58
58
checkout = branch.create_checkout('checkout', lightweight=True)
59
59
self.run_bzr('reconfigure --checkout checkout')
61
def test_lightweight_checkout_to_tree(self):
62
branch = self.make_branch('branch')
63
checkout = branch.create_checkout('checkout', lightweight=True)
64
self.run_bzr('reconfigure --tree checkout')
61
66
def test_no_args(self):
62
67
branch = self.make_branch('branch')
63
68
self.run_bzr_error(['No target configuration specified'],
127
132
working_dir='repo/branch')
128
133
self.failUnlessExists('repo/branch/foo')
129
134
tree = workingtree.WorkingTree.open('repo/branch')
136
def test_shared_format_to_standalone(self, format=None):
137
repo = self.make_repository('repo', shared=True, format=format)
138
branch = bzrdir.BzrDir.create_branch_convenience('repo/tree')
139
self.assertNotEqual(branch.bzrdir.root_transport.base,
140
branch.repository.bzrdir.root_transport.base)
141
tree = workingtree.WorkingTree.open('repo/tree')
142
self.build_tree_contents([('repo/tree/file', 'foo\n')]);
144
tree.commit('added file')
145
self.run_bzr('reconfigure --standalone', working_dir='repo/tree')
146
tree = workingtree.WorkingTree.open('repo/tree')
147
self.build_tree_contents([('repo/tree/file', 'bar\n')]);
148
self.check_file_contents('repo/tree/file', 'bar\n')
149
self.run_bzr('revert', working_dir='repo/tree')
150
self.check_file_contents('repo/tree/file', 'foo\n')
151
self.assertEqual(tree.bzrdir.root_transport.base,
152
tree.branch.repository.bzrdir.root_transport.base)
154
def test_shared_knit_to_standalone(self):
155
self.test_shared_format_to_standalone('knit')
157
def test_shared_pack092_to_standalone(self):
158
self.test_shared_format_to_standalone('pack-0.92')
160
def test_shared_rich_root_pack_to_standalone(self):
161
self.test_shared_format_to_standalone('rich-root-pack')
163
def test_lightweight_format_checkout_to_tree(self, format=None):
164
branch = self.make_branch('branch', format=format)
165
checkout = branch.create_checkout('checkout', lightweight=True)
166
tree = workingtree.WorkingTree.open('checkout')
167
self.build_tree_contents([('checkout/file', 'foo\n')]);
169
tree.commit('added file')
170
self.run_bzr('reconfigure --tree', working_dir='checkout')
171
tree = workingtree.WorkingTree.open('checkout')
172
self.build_tree_contents([('checkout/file', 'bar\n')]);
173
self.check_file_contents('checkout/file', 'bar\n')
174
self.run_bzr('revert', working_dir='checkout')
175
self.check_file_contents('checkout/file', 'foo\n')
177
def test_lightweight_knit_checkout_to_tree(self, format=None):
178
self.test_lightweight_format_checkout_to_tree('knit')
180
def test_lightweight_pack092_checkout_to_tree(self, format=None):
181
self.test_lightweight_format_checkout_to_tree('pack-0.92')
183
def test_lightweight_rich_root_pack_checkout_to_tree(self, format=None):
184
self.test_lightweight_format_checkout_to_tree('rich-root-pack')