/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2017-06-10 18:39:27 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • Revision ID: breezy.the.bot@gmail.com-20170610183927-8yn4wmsk1ki92xc3
Rename ``bzrdir`` attribute to ``controldir``.

Merged from https://code.launchpad.net/~jelmer/brz/rename-controldir/+merge/325433

Show diffs side-by-side

added added

removed removed

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