69
70
self.assertEqual('1', result.open_workingtree().last_revision())
70
71
self.failIfExists('checkout/added_in_2')
73
def test_checkout_reconstitutes_working_trees(self):
74
# doing a 'bzr checkout' in the directory of a branch with no tree
75
# or a 'bzr checkout path' with path the name of a directory with
76
# a branch with no tree will reconsistute the tree.
77
os.mkdir('treeless-branch')
78
branch = bzrdir.BzrDir.create_branch_convenience(
81
format=bzrdir.BzrDirMetaFormat1())
82
# check no tree was created
83
self.assertRaises(errors.NoWorkingTree, branch.bzrdir.open_workingtree)
84
out, err = self.run_bzr('checkout', 'treeless-branch')
85
# we should have a tree now
86
branch.bzrdir.open_workingtree()
88
out, err = self.run_bzr('diff', 'treeless-branch')
90
# now test with no parameters
91
branch = bzrdir.BzrDir.create_branch_convenience(
94
format=bzrdir.BzrDirMetaFormat1())
95
# check no tree was created
96
self.assertRaises(errors.NoWorkingTree, branch.bzrdir.open_workingtree)
97
out, err = self.run_bzr('checkout')
98
# we should have a tree now
99
branch.bzrdir.open_workingtree()
101
out, err = self.run_bzr('diff')