~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_checkout.py

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import sys
25
25
 
26
26
import bzrlib.bzrdir as bzrdir
 
27
import bzrlib.errors as errors
27
28
from bzrlib.tests.blackbox import ExternalBase
28
29
 
29
30
 
69
70
        self.assertEqual('1', result.open_workingtree().last_revision())
70
71
        self.failIfExists('checkout/added_in_2')
71
72
 
 
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(
 
79
            'treeless-branch',
 
80
            force_new_tree=False,
 
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()
 
87
        # with no diff
 
88
        out, err = self.run_bzr('diff', 'treeless-branch')
 
89
 
 
90
        # now test with no parameters
 
91
        branch = bzrdir.BzrDir.create_branch_convenience(
 
92
            '.',
 
93
            force_new_tree=False,
 
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()
 
100
        # with no diff
 
101
        out, err = self.run_bzr('diff')