~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009-2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
21
21
from bzrlib import (
22
22
    branch as _mod_branch,
23
23
    bzrdir,
24
 
    controldir,
25
24
    errors,
26
25
    workingtree,
27
26
    )
38
37
 
39
38
    def setUp(self):
40
39
        super(TestCheckout, self).setUp()
41
 
        tree = controldir.ControlDir.create_standalone_workingtree('branch')
 
40
        tree = bzrdir.BzrDir.create_standalone_workingtree('branch')
42
41
        tree.commit('1', rev_id='1', allow_pointless=True)
43
42
        self.build_tree(['branch/added_in_2'])
44
43
        tree.add('added_in_2')
47
46
    def test_checkout_makes_bound_branch(self):
48
47
        self.run_bzr('checkout branch checkout')
49
48
        # if we have a checkout, the branch base should be 'branch'
50
 
        source = controldir.ControlDir.open('branch')
51
 
        result = controldir.ControlDir.open('checkout')
 
49
        source = bzrdir.BzrDir.open('branch')
 
50
        result = bzrdir.BzrDir.open('checkout')
52
51
        self.assertEqual(source.open_branch().bzrdir.root_transport.base,
53
52
                         result.open_branch().get_bound_location())
54
53
 
55
54
    def test_checkout_light_makes_checkout(self):
56
55
        self.run_bzr('checkout --lightweight branch checkout')
57
56
        # if we have a checkout, the branch base should be 'branch'
58
 
        source = controldir.ControlDir.open('branch')
59
 
        result = controldir.ControlDir.open('checkout')
 
57
        source = bzrdir.BzrDir.open('branch')
 
58
        result = bzrdir.BzrDir.open('checkout')
60
59
        self.assertEqual(source.open_branch().bzrdir.root_transport.base,
61
60
                         result.open_branch().bzrdir.root_transport.base)
62
61
 
64
63
        out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout'])
65
64
        # the working tree should now be at revision '1' with the content
66
65
        # from 1.
67
 
        result = controldir.ControlDir.open('checkout')
 
66
        result = bzrdir.BzrDir.open('checkout')
68
67
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
69
68
        self.assertPathDoesNotExist('checkout/added_in_2')
70
69
 
73
72
            'branch', 'checkout'])
74
73
        # the working tree should now be at revision '1' with the content
75
74
        # from 1.
76
 
        result = controldir.ControlDir.open('checkout')
 
75
        result = bzrdir.BzrDir.open('checkout')
77
76
        self.assertEqual(['1'], result.open_workingtree().get_parent_ids())
78
77
        self.assertPathDoesNotExist('checkout/added_in_2')
79
78
 
80
79
    def test_checkout_into_empty_dir(self):
81
80
        self.make_bzrdir('checkout')
82
81
        out, err = self.run_bzr(['checkout', 'branch', 'checkout'])
83
 
        result = controldir.ControlDir.open('checkout')
 
82
        result = bzrdir.BzrDir.open('checkout')
84
83
        tree = result.open_workingtree()
85
84
        branch = result.open_branch()
86
85
 
89
88
        # or a 'bzr checkout path' with path the name of a directory with
90
89
        # a branch with no tree will reconsistute the tree.
91
90
        os.mkdir('treeless-branch')
92
 
        branch = controldir.ControlDir.create_branch_convenience(
 
91
        branch = bzrdir.BzrDir.create_branch_convenience(
93
92
            'treeless-branch',
94
93
            force_new_tree=False,
95
94
            format=bzrdir.BzrDirMetaFormat1())
102
101
        out, err = self.run_bzr('diff treeless-branch')
103
102
 
104
103
        # now test with no parameters
105
 
        branch = controldir.ControlDir.create_branch_convenience(
 
104
        branch = bzrdir.BzrDir.create_branch_convenience(
106
105
            '.',
107
106
            force_new_tree=False,
108
107
            format=bzrdir.BzrDirMetaFormat1())
188
187
            working_dir='second')
189
188
        # We should always be creating a lighweight checkout for colocated
190
189
        # branches.
191
 
        self.assertEqual(
 
190
        self.assertEquals(
192
191
            target.open_branch(name='somebranch').base,
193
192
            target.get_branch_reference(name=""))
194
193
 
224
223
        # being too low. If rpc_count increases, more network roundtrips have
225
224
        # become necessary for this use case. Please do not adjust this number
226
225
        # upwards without agreement from bzr's network support maintainers.
227
 
        self.assertLength(13, self.hpss_calls)
 
226
        self.assertLength(15, self.hpss_calls)
228
227
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)