/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_interbranch/test_pull.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:
35
35
        # become the revision-history.
36
36
        parent = self.make_from_branch_and_tree('parent')
37
37
        parent.commit('1st post', rev_id='P1', allow_pointless=True)
38
 
        mine = self.sprout_to(parent.bzrdir, 'mine').open_workingtree()
 
38
        mine = self.sprout_to(parent.controldir, 'mine').open_workingtree()
39
39
        mine.commit('my change', rev_id='M1', allow_pointless=True)
40
40
        parent.merge_from_branch(mine.branch)
41
41
        parent.commit('merge my change', rev_id='P2')
49
49
        # directly accessible.
50
50
        parent = self.make_from_branch_and_tree('parent')
51
51
        parent.commit('1st post', rev_id='P1', allow_pointless=True)
52
 
        mine = self.sprout_to(parent.bzrdir, 'mine').open_workingtree()
 
52
        mine = self.sprout_to(parent.controldir, 'mine').open_workingtree()
53
53
        mine.commit('my change', rev_id='M1', allow_pointless=True)
54
 
        other = self.sprout_to(parent.bzrdir, 'other').open_workingtree()
 
54
        other = self.sprout_to(parent.controldir, 'other').open_workingtree()
55
55
        other.merge_from_branch(mine.branch)
56
56
        other.commit('merge my change', rev_id='O2')
57
57
        parent.merge_from_branch(other.branch)
64
64
        master_tree = self.make_from_branch_and_tree('master')
65
65
        rev1 = master_tree.commit('master')
66
66
        checkout = master_tree.branch.create_checkout('checkout')
67
 
        other = self.sprout_to(master_tree.branch.bzrdir, 'other').open_workingtree()
 
67
        other = self.sprout_to(master_tree.branch.controldir, 'other').open_workingtree()
68
68
        rev2 = other.commit('other commit')
69
69
        # now pull, which should update both checkout and master.
70
70
        checkout.branch.pull(other.branch)
74
74
    def test_pull_raises_specific_error_on_master_connection_error(self):
75
75
        master_tree = self.make_from_branch_and_tree('master')
76
76
        checkout = master_tree.branch.create_checkout('checkout')
77
 
        other = self.sprout_to(master_tree.branch.bzrdir, 'other').open_branch()
 
77
        other = self.sprout_to(master_tree.branch.controldir, 'other').open_branch()
78
78
        # move the branch out of the way on disk to cause a connection
79
79
        # error.
80
 
        master_tree.branch.bzrdir.destroy_branch()
 
80
        master_tree.branch.controldir.destroy_branch()
81
81
        # try to pull, which should raise a BoundBranchConnectionFailure.
82
82
        self.assertRaises(errors.BoundBranchConnectionFailure,
83
83
                checkout.branch.pull, other)
85
85
    def test_pull_returns_result(self):
86
86
        parent = self.make_from_branch_and_tree('parent')
87
87
        parent.commit('1st post', rev_id='P1')
88
 
        mine = self.sprout_to(parent.bzrdir, 'mine').open_workingtree()
 
88
        mine = self.sprout_to(parent.controldir, 'mine').open_workingtree()
89
89
        mine.commit('my change', rev_id='M1')
90
90
        result = parent.branch.pull(mine.branch)
91
91
        self.assertIsNot(None, result)
102
102
    def test_pull_overwrite(self):
103
103
        tree_a = self.make_from_branch_and_tree('tree_a')
104
104
        tree_a.commit('message 1')
105
 
        tree_b = self.sprout_to(tree_a.bzrdir, 'tree_b').open_workingtree()
 
105
        tree_b = self.sprout_to(tree_a.controldir, 'tree_b').open_workingtree()
106
106
        tree_a.commit('message 2', rev_id='rev2a')
107
107
        tree_b.commit('message 2', rev_id='rev2b')
108
108
        self.assertRaises(errors.DivergedBranches, tree_a.pull, tree_b.branch)
195
195
        target.add('')
196
196
        rev1 = target.commit('rev 1')
197
197
        target.unlock()
198
 
        sourcedir = target.bzrdir.clone(self.get_url('source'))
 
198
        sourcedir = target.controldir.clone(self.get_url('source'))
199
199
        source = MemoryTree.create_on_branch(sourcedir.open_branch())
200
200
        rev2 = source.commit('rev 2')
201
201
        Branch.hooks.install_named_hook('post_pull',