/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
    def test_checkout_light_dash_r(self):
74
74
        out, err = self.run_bzr(['checkout', '--lightweight', '-r', '-2',
75
 
            'branch', 'checkout'])
 
75
                                 'branch', 'checkout'])
76
76
        # the working tree should now be at revision '1' with the content
77
77
        # from 1.
78
78
        result = controldir.ControlDir.open('checkout')
96
96
            force_new_tree=False,
97
97
            format=bzrdir.BzrDirMetaFormat1())
98
98
        # check no tree was created
99
 
        self.assertRaises(errors.NoWorkingTree, branch.controldir.open_workingtree)
 
99
        self.assertRaises(errors.NoWorkingTree,
 
100
                          branch.controldir.open_workingtree)
100
101
        out, err = self.run_bzr('checkout treeless-branch')
101
102
        # we should have a tree now
102
103
        branch.controldir.open_workingtree()
109
110
            force_new_tree=False,
110
111
            format=bzrdir.BzrDirMetaFormat1())
111
112
        # check no tree was created
112
 
        self.assertRaises(errors.NoWorkingTree, branch.controldir.open_workingtree)
 
113
        self.assertRaises(errors.NoWorkingTree,
 
114
                          branch.controldir.open_workingtree)
113
115
        out, err = self.run_bzr('checkout')
114
116
        # we should have a tree now
115
117
        branch.controldir.open_workingtree()
119
121
    def _test_checkout_existing_dir(self, lightweight):
120
122
        source = self.make_branch_and_tree('source')
121
123
        self.build_tree_contents([('source/file1', b'content1'),
122
 
                                  ('source/file2', b'content2'),])
 
124
                                  ('source/file2', b'content2'), ])
123
125
        source.add(['file1', 'file2'])
124
126
        source.commit('added files')
125
127
        self.build_tree_contents([('target/', b''),
126
128
                                  ('target/file1', b'content1'),
127
 
                                  ('target/file2', b'content3'),])
 
129
                                  ('target/file2', b'content3'), ])
128
130
        cmd = ['checkout', 'source', 'target']
129
131
        if lightweight:
130
132
            cmd.append('--lightweight')
185
187
        source.add('file1')
186
188
        source.commit('added file')
187
189
        target = source.controldir.sprout('file:second,branch=somebranch',
188
 
            create_tree_if_local=False)
 
190
                                          create_tree_if_local=False)
189
191
        out, err = self.run_bzr('checkout file:,branch=somebranch .',
190
 
            working_dir='second')
 
192
                                working_dir='second')
191
193
        # We should always be creating a lighweight checkout for colocated
192
194
        # branches.
193
195
        self.assertEqual(
220
222
            t.commit(message='commit %d' % count)
221
223
        self.reset_smart_call_log()
222
224
        out, err = self.run_bzr(['checkout', '--lightweight', self.get_url('from'),
223
 
            'target'])
 
225
                                 'target'])
224
226
        # This figure represent the amount of work to perform this use case. It
225
227
        # is entirely ok to reduce this number if a test fails due to rpc_count
226
228
        # being too low. If rpc_count increases, more network roundtrips have