253
def do_checkout_test(self, lightweight=False):
254
tree = self.make_branch_and_tree('source', format='experimental-knit3')
255
subtree = self.make_branch_and_tree('source/subtree',
256
format='experimental-knit3')
257
subsubtree = self.make_branch_and_tree('source/subtree/subsubtree',
258
format='experimental-knit3')
259
self.build_tree(['source/subtree/file',
260
'source/subtree/subsubtree/file'])
261
subsubtree.add('file')
263
subtree.add_reference(subsubtree)
264
tree.add_reference(subtree)
265
tree.commit('a revision')
266
subtree.commit('a subtree file')
267
subsubtree.commit('a subsubtree file')
268
tree.branch.create_checkout('target', lightweight=lightweight)
269
self.failUnlessExists('target')
270
self.failUnlessExists('target/subtree')
271
self.failUnlessExists('target/subtree/file')
272
self.failUnlessExists('target/subtree/subsubtree/file')
273
subbranch = _mod_branch.Branch.open('target/subtree/subsubtree')
275
self.assertEndsWith(subbranch.base, 'source/subtree/subsubtree/')
277
self.assertEndsWith(subbranch.base, 'target/subtree/subsubtree/')
280
def test_checkout_with_references(self):
281
self.do_checkout_test()
283
def test_light_checkout_with_references(self):
284
self.do_checkout_test(lightweight=True)
254
286
class TestBranchReference(TestCaseWithTransport):
255
287
"""Tests for the branch reference facility."""