/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_bound_branches.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:
54
54
        tree.add('a', 'b')
55
55
        tree.commit(message='init')
56
56
 
57
 
        tree.bzrdir.sprout('child')
 
57
        tree.controldir.sprout('child')
58
58
 
59
59
        self.run_bzr('bind ../base', working_dir='child')
60
60
 
126
126
 
127
127
    def test_double_binding(self):
128
128
        child_tree = self.create_branches()[1]
129
 
        child_tree.bzrdir.sprout('child2')
 
129
        child_tree.controldir.sprout('child2')
130
130
 
131
131
        # Double binding succeeds, but committing to child2 should fail
132
132
        self.run_bzr('bind ../child', working_dir='child2')
151
151
        self.check_revno(1, 'child')
152
152
        self.run_bzr('unbind', working_dir='child')
153
153
        # Refresh the child tree/branch objects as 'unbind' modified them
154
 
        child_tree = child_tree.bzrdir.open_workingtree()
 
154
        child_tree = child_tree.controldir.open_workingtree()
155
155
        child_tree.commit(message='child')
156
156
        self.check_revno(2, 'child')
157
157
 
159
159
        # It is not possible to commit to a branch
160
160
        # which is bound to a branch which is bound
161
161
        base_tree, child_tree = self.create_branches()
162
 
        base_tree.bzrdir.sprout('newbase')
 
162
        base_tree.controldir.sprout('newbase')
163
163
 
164
164
        # There is no way to know that B has already
165
165
        # been bound by someone else, otherwise it
171
171
 
172
172
    def test_pull_updates_both(self):
173
173
        base_tree = self.create_branches()[0]
174
 
        newchild_tree = base_tree.bzrdir.sprout('newchild').open_workingtree()
 
174
        newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
175
175
        self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
176
176
        newchild_tree.commit(message='newchild')
177
177
        self.check_revno(2, 'newchild')
184
184
 
185
185
    def test_pull_local_updates_local(self):
186
186
        base_tree = self.create_branches()[0]
187
 
        newchild_tree = base_tree.bzrdir.sprout('newchild').open_workingtree()
 
187
        newchild_tree = base_tree.controldir.sprout('newchild').open_workingtree()
188
188
        self.build_tree_contents([('newchild/b', 'newchild b contents\n')])
189
189
        newchild_tree.commit(message='newchild')
190
190
        self.check_revno(2, 'newchild')
203
203
        self.run_bzr('unbind', working_dir='child')
204
204
 
205
205
        # Refresh the child tree/branch objects as 'unbind' modified them
206
 
        child_tree = child_tree.bzrdir.open_workingtree()
 
206
        child_tree = child_tree.controldir.open_workingtree()
207
207
        child_tree.commit(message='child', allow_pointless=True)
208
208
        self.check_revno(2, 'child')
209
209
 
215
215
        self.run_bzr('bind ../base', working_dir='child')
216
216
 
217
217
        # Refresh the child tree/branch objects as 'bind' modified them
218
 
        child_tree = child_tree.bzrdir.open_workingtree()
 
218
        child_tree = child_tree.controldir.open_workingtree()
219
219
        # This should turn the local commit into a merge
220
220
        child_tree.update()
221
221
        child_tree.commit(message='merged')
255
255
 
256
256
        self.run_bzr('unbind', working_dir='child')
257
257
        # Refresh the child tree/branch objects as 'bind' modified them
258
 
        child_tree = child_tree.bzrdir.open_workingtree()
 
258
        child_tree = child_tree.controldir.open_workingtree()
259
259
        child_tree.commit(message='child', allow_pointless=True)
260
260
        self.check_revno(2, 'child')
261
261
        self.check_revno(1, 'base')
290
290
        # operation, because it can be without violating
291
291
        # the binding invariants.
292
292
        # But we can't fail afterwards
293
 
        other_tree = child_tree.bzrdir.sprout('other').open_workingtree()
 
293
        other_tree = child_tree.controldir.sprout('other').open_workingtree()
294
294
        other_branch = other_tree.branch
295
295
 
296
296
        self.build_tree_contents([('other/c', 'file c\n')])
320
320
        # XXX: This test should be moved to branch-implemenations/test_pull
321
321
        child_tree = self.create_branches()[1]
322
322
 
323
 
        other_tree = child_tree.bzrdir.sprout('other').open_workingtree()
 
323
        other_tree = child_tree.controldir.sprout('other').open_workingtree()
324
324
 
325
325
        self.build_tree_contents([('other/a', 'new contents\n')])
326
326
        other_tree.commit(message='changed a')
353
353
        tree.add('a', 'b')
354
354
        tree.commit(message='init')
355
355
        branch = tree.branch
356
 
        tree.bzrdir.sprout('child')
 
356
        tree.controldir.sprout('child')
357
357
        self.run_bzr('bind --directory=child base')
358
358
        d = controldir.ControlDir.open('child')
359
359
        self.assertNotEqual(None, d.open_branch().get_master_branch())