/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/per_branch/test_push.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 16:40:42 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610164042-zrxqgy2htyduvke2
MergeĀ rename-controldirĀ branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        # become the revision-history.
53
53
        mine = self.make_branch_and_tree('mine')
54
54
        mine.commit('1st post', rev_id='P1', allow_pointless=True)
55
 
        other = mine.bzrdir.sprout('other').open_workingtree()
 
55
        other = mine.controldir.sprout('other').open_workingtree()
56
56
        other.commit('my change', rev_id='M1', allow_pointless=True)
57
57
        mine.merge_from_branch(other.branch)
58
58
        mine.commit('merge my change', rev_id='P2')
69
69
        # directly accessible.
70
70
        mine = self.make_branch_and_tree('mine')
71
71
        mine.commit('1st post', rev_id='P1', allow_pointless=True)
72
 
        target = mine.bzrdir.sprout('target').open_workingtree()
 
72
        target = mine.controldir.sprout('target').open_workingtree()
73
73
        target.commit('my change', rev_id='M1', allow_pointless=True)
74
 
        other = mine.bzrdir.sprout('other').open_workingtree()
 
74
        other = mine.controldir.sprout('other').open_workingtree()
75
75
        other.merge_from_branch(target.branch)
76
76
        other.commit('merge my change', rev_id='O2')
77
77
        mine.merge_from_branch(other.branch)
90
90
            return
91
91
        rev1 = checkout.commit('master')
92
92
 
93
 
        other = master_tree.branch.bzrdir.sprout('other').open_workingtree()
 
93
        other = master_tree.branch.controldir.sprout('other').open_workingtree()
94
94
        rev2 = other.commit('other commit')
95
95
        # now push, which should update both checkout and master.
96
96
        other.branch.push(checkout.branch)
105
105
        except errors.UpgradeRequired:
106
106
            # cant bind this format, the test is irrelevant.
107
107
            return
108
 
        other = master_tree.branch.bzrdir.sprout('other').open_workingtree()
 
108
        other = master_tree.branch.controldir.sprout('other').open_workingtree()
109
109
        # move the branch out of the way on disk to cause a connection
110
110
        # error.
111
111
        os.rename('master', 'master_gone')
121
121
        except errors.UpgradeRequired:
122
122
            raise tests.TestNotApplicable(
123
123
                'Format does not support bound branches')
124
 
        other = bound.bzrdir.sprout('other').open_branch()
 
124
        other = bound.controldir.sprout('other').open_branch()
125
125
        try:
126
126
            other.tags.set_tag('new-tag', 'some-rev')
127
127
        except errors.TagsNotSupported:
160
160
            return
161
161
        # This is a little bit trickier because make_branch_and_tree will not
162
162
        # re-use a shared repository.
163
 
        a_bzrdir = self.make_bzrdir('repo/tree')
 
163
        a_controldir = self.make_controldir('repo/tree')
164
164
        try:
165
 
            a_branch = self.branch_format.initialize(a_bzrdir)
 
165
            a_branch = self.branch_format.initialize(a_controldir)
166
166
        except (errors.UninitializableFormat):
167
167
            # Cannot create these branches
168
168
            return
169
169
        try:
170
 
            tree = a_branch.bzrdir.create_workingtree()
 
170
            tree = a_branch.controldir.create_workingtree()
171
171
        except errors.NotLocalUrl:
172
172
            if self.vfs_transport_factory is test_server.LocalURLServer:
173
173
                # the branch is colocated on disk, we cannot create a checkout.
181
181
        tree.add(['a'])
182
182
        tree.commit('a')
183
183
 
184
 
        to_bzrdir = self.make_bzrdir('repo/branch')
 
184
        to_bzrdir = self.make_controldir('repo/branch')
185
185
        to_branch = self.branch_format.initialize(to_bzrdir)
186
186
        tree.branch.push(to_branch)
187
187
 
286
286
        builder.finish_series()
287
287
        trunk = builder.get_branch()
288
288
        # Sprout rev-1 to "trunk", so that we can stack on it.
289
 
        trunk.bzrdir.sprout(self.get_url('trunk'), revision_id='rev-1')
 
289
        trunk.controldir.sprout(self.get_url('trunk'), revision_id='rev-1')
290
290
        # Set a default stacking policy so that new branches will automatically
291
291
        # stack on trunk.
292
 
        self.make_bzrdir('.').get_config().set_default_stack_on('trunk')
 
292
        self.make_controldir('.').get_config().set_default_stack_on('trunk')
293
293
        # Push rev-2 to a new branch "remote".  It will be stacked on "trunk".
294
294
        output = BytesIO()
295
295
        push._show_push_branch(trunk, 'rev-2', self.get_url('remote'), output)
375
375
        target.add('')
376
376
        rev1 = target.commit('rev 1')
377
377
        target.unlock()
378
 
        sourcedir = target.bzrdir.clone(self.get_url('source'))
 
378
        sourcedir = target.controldir.clone(self.get_url('source'))
379
379
        source = memorytree.MemoryTree.create_on_branch(sourcedir.open_branch())
380
380
        rev2 = source.commit('rev 2')
381
381
        branch.Branch.hooks.install_named_hook(