/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_pull.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 00:17:06 UTC
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610001706-xn6jiuev350246mr
Rename a number of attributes from bzrdir to controldir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        if sys.platform not in ('win32', 'cygwin'):
67
67
            self.run_bzr('pull', working_dir='a')
68
68
 
69
 
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
69
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
70
70
        self.run_bzr('pull', working_dir='b')
71
71
        os.mkdir('b/subdir')
72
72
        b_tree.add('subdir')
83
83
        b_tree.commit(message='blah3', allow_pointless=True)
84
84
        # no overwrite
85
85
        self.run_bzr('pull ../a', retcode=3, working_dir='b')
86
 
        b_tree.bzrdir.sprout('overwriteme')
 
86
        b_tree.controldir.sprout('overwriteme')
87
87
        self.run_bzr('pull --overwrite ../a', working_dir='overwriteme')
88
88
        overwritten = branch.Branch.open('overwriteme')
89
89
        self.assertEqual(overwritten.last_revision(),
125
125
        a_tree.add('goodbye2')
126
126
        a_tree.commit(message="setup")
127
127
 
128
 
        b_tree = a_tree.bzrdir.sprout('b',
 
128
        b_tree = a_tree.controldir.sprout('b',
129
129
                   revision_id=a_tree.branch.get_rev_id(1)).open_workingtree()
130
130
        self.run_bzr('pull -r 2', working_dir='b')
131
131
        a = branch.Branch.open('a')
145
145
        builder = self.make_branch_builder('source')
146
146
        source = fixtures.build_branch_with_non_ancestral_rev(builder)
147
147
        source.get_config_stack().set('branch.fetch_tags', True)
148
 
        target_bzrdir = source.bzrdir.sprout('target')
 
148
        target_bzrdir = source.controldir.sprout('target')
149
149
        source.tags.set_tag('tag-a', 'rev-2')
150
150
        # Pull from source
151
151
        self.run_bzr('pull -d target source')
163
163
        a_tree.add('foo')
164
164
        a_tree.commit(message='initial commit')
165
165
 
166
 
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
166
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
167
167
 
168
168
        self.build_tree_contents([('a/foo', 'changed\n')])
169
169
        a_tree.commit(message='later change')
191
191
        a_tree.add('foo')
192
192
        a_tree.commit(message='initial commit')
193
193
 
194
 
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
194
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
195
195
 
196
196
        self.build_tree_contents([('a/foo', 'changed\n')])
197
197
        a_tree.commit(message='later change')
227
227
        self.build_tree(['branch_a/a'])
228
228
        tree_a.add('a')
229
229
        tree_a.commit('commit a')
230
 
        tree_b = branch_a.bzrdir.sprout('branch_b').open_workingtree()
 
230
        tree_b = branch_a.controldir.sprout('branch_b').open_workingtree()
231
231
        branch_b = tree_b.branch
232
 
        tree_c = branch_a.bzrdir.sprout('branch_c').open_workingtree()
 
232
        tree_c = branch_a.controldir.sprout('branch_c').open_workingtree()
233
233
        branch_c = tree_c.branch
234
234
        self.build_tree(['branch_a/b'])
235
235
        tree_a.add('b')
253
253
                ('','brz: ERROR: These branches have diverged.'
254
254
                    ' Use the missing command to see how.\n'
255
255
                    'Use the merge command to reconcile them.\n'))
256
 
        tree_b = tree_b.bzrdir.open_workingtree()
 
256
        tree_b = tree_b.controldir.open_workingtree()
257
257
        branch_b = tree_b.branch
258
258
        self.assertEqual(parent, branch_b.get_parent())
259
259
        # test implicit --remember after resolving previous failure
261
261
        t.delete('branch_b/d')
262
262
        self.run_bzr('pull', working_dir='branch_b')
263
263
        # Refresh the branch object as 'pull' modified it
264
 
        branch_b = branch_b.bzrdir.open_branch()
 
264
        branch_b = branch_b.controldir.open_branch()
265
265
        self.assertEqual(branch_b.get_parent(), parent)
266
266
        # test explicit --remember
267
267
        self.run_bzr('pull ../branch_c --remember', working_dir='branch_b')
268
268
        # Refresh the branch object as 'pull' modified it
269
 
        branch_b = branch_b.bzrdir.open_branch()
270
 
        self.assertEqual(branch_c.bzrdir.root_transport.base,
 
269
        branch_b = branch_b.controldir.open_branch()
 
270
        self.assertEqual(branch_c.controldir.root_transport.base,
271
271
                         branch_b.get_parent())
272
272
 
273
273
    def test_pull_bundle(self):
279
279
        tree_a.add('a')
280
280
        tree_a.commit('message')
281
281
 
282
 
        tree_b = tree_a.bzrdir.sprout('branch_b').open_workingtree()
 
282
        tree_b = tree_a.controldir.sprout('branch_b').open_workingtree()
283
283
 
284
284
        # Make a change to 'a' that 'b' can pull
285
285
        with open('branch_a/a', 'wb') as f:
328
328
        self.build_tree(['tree_a/foo'])
329
329
        tree_a.add('foo')
330
330
        revision_id = tree_a.commit('bar')
331
 
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
 
331
        tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
332
332
        out, err = self.run_bzr('pull --quiet -d tree_b')
333
333
        self.assertEqual(out, '')
334
334
        self.assertEqual(err, '')
344
344
    def test_pull_from_directory_service(self):
345
345
        source = self.make_branch_and_tree('source')
346
346
        source.commit('commit 1')
347
 
        target = source.bzrdir.sprout('target').open_workingtree()
 
347
        target = source.controldir.sprout('target').open_workingtree()
348
348
        source_last = source.commit('commit 2')
349
349
        class FooService(object):
350
350
            """A directory service that always returns source"""
377
377
        self.setup_smart_server_with_call_log()
378
378
        parent = self.make_branch_and_tree('parent')
379
379
        parent.commit(message='first commit')
380
 
        child = parent.bzrdir.sprout('child').open_workingtree()
 
380
        child = parent.controldir.sprout('child').open_workingtree()
381
381
        child.commit(message='second commit')
382
382
        checkout = parent.branch.create_checkout('checkout')
383
383
        self.run_bzr(['pull', self.get_url('child')], working_dir='checkout')
396
396
        parent = self.make_branch_and_tree('parent', format='1.9')
397
397
        parent.commit(message='first commit')
398
398
        parent.commit(message='second commit')
399
 
        local = parent.bzrdir.sprout('local').open_workingtree()
 
399
        local = parent.controldir.sprout('local').open_workingtree()
400
400
        local.commit(message='local commit')
401
401
        local.branch.create_clone_on_transport(
402
402
            self.get_transport('stacked'), stacked_on=self.get_url('parent'))
448
448
        self.assertIsInstance(from_tree.branch, remote.RemoteBranch)
449
449
        from_tree.commit(message='first commit')
450
450
        out, err = self.run_bzr(['pull', '-d', 'to',
451
 
            from_tree.branch.bzrdir.root_transport.base])
 
451
            from_tree.branch.controldir.root_transport.base])
452
452
        self.assertContainsRe(err,
453
453
            "(?m)Doing on-the-fly conversion")
454
454
 
479
479
        # create two trees with conflicts, setup conflict, check that
480
480
        # conflicted file looks correct
481
481
        a_tree = self.example_branch('a')
482
 
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
482
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
483
483
 
484
484
        with open(osutils.pathjoin('a', 'hello'),'wt') as f:
485
485
            f.write('fee')