~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-03-08 18:30:33 UTC
  • mfrom: (6487 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6488.
  • Revision ID: v.ladeuil+lp@free.fr-20120308183033-bccqnbr1tpozs711
Merge bzr.dev resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import (
22
22
    branch as _mod_branch,
23
23
    bzrdir,
 
24
    controldir,
24
25
    errors,
25
26
    workingtree,
26
27
    )
37
38
 
38
39
    def setUp(self):
39
40
        super(TestCheckout, self).setUp()
40
 
        tree = bzrdir.BzrDir.create_standalone_workingtree('branch')
 
41
        tree = controldir.ControlDir.create_standalone_workingtree('branch')
41
42
        tree.commit('1', rev_id='1', allow_pointless=True)
42
43
        self.build_tree(['branch/added_in_2'])
43
44
        tree.add('added_in_2')
46
47
    def test_checkout_makes_bound_branch(self):
47
48
        self.run_bzr('checkout branch checkout')
48
49
        # if we have a checkout, the branch base should be 'branch'
49
 
        source = bzrdir.BzrDir.open('branch')
50
 
        result = bzrdir.BzrDir.open('checkout')
 
50
        source = controldir.ControlDir.open('branch')
 
51
        result = controldir.ControlDir.open('checkout')
51
52
        self.assertEqual(source.open_branch().bzrdir.root_transport.base,
52
53
                         result.open_branch().get_bound_location())
53
54
 
54
55
    def test_checkout_light_makes_checkout(self):
55
56
        self.run_bzr('checkout --lightweight branch checkout')
56
57
        # if we have a checkout, the branch base should be 'branch'
57
 
        source = bzrdir.BzrDir.open('branch')
58
 
        result = bzrdir.BzrDir.open('checkout')
 
58
        source = controldir.ControlDir.open('branch')
 
59
        result = controldir.ControlDir.open('checkout')
59
60
        self.assertEqual(source.open_branch().bzrdir.root_transport.base,
60
61
                         result.open_branch().bzrdir.root_transport.base)
61
62
 
63
64
        out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout'])
64
65
        # the working tree should now be at revision '1' with the content
65
66
        # from 1.
66
 
        result = bzrdir.BzrDir.open('checkout')
 
67
        result = controldir.ControlDir.open('checkout')
67
68
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
68
69
        self.assertPathDoesNotExist('checkout/added_in_2')
69
70
 
72
73
            'branch', 'checkout'])
73
74
        # the working tree should now be at revision '1' with the content
74
75
        # from 1.
75
 
        result = bzrdir.BzrDir.open('checkout')
 
76
        result = controldir.ControlDir.open('checkout')
76
77
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
77
78
        self.assertPathDoesNotExist('checkout/added_in_2')
78
79
 
79
80
    def test_checkout_into_empty_dir(self):
80
81
        self.make_bzrdir('checkout')
81
82
        out, err = self.run_bzr(['checkout', 'branch', 'checkout'])
82
 
        result = bzrdir.BzrDir.open('checkout')
 
83
        result = controldir.ControlDir.open('checkout')
83
84
        tree = result.open_workingtree()
84
85
        branch = result.open_branch()
85
86
 
88
89
        # or a 'bzr checkout path' with path the name of a directory with
89
90
        # a branch with no tree will reconsistute the tree.
90
91
        os.mkdir('treeless-branch')
91
 
        branch = bzrdir.BzrDir.create_branch_convenience(
 
92
        branch = controldir.ControlDir.create_branch_convenience(
92
93
            'treeless-branch',
93
94
            force_new_tree=False,
94
95
            format=bzrdir.BzrDirMetaFormat1())
101
102
        out, err = self.run_bzr('diff treeless-branch')
102
103
 
103
104
        # now test with no parameters
104
 
        branch = bzrdir.BzrDir.create_branch_convenience(
 
105
        branch = controldir.ControlDir.create_branch_convenience(
105
106
            '.',
106
107
            force_new_tree=False,
107
108
            format=bzrdir.BzrDirMetaFormat1())