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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        rev1 = master_tree.commit('master')
68
68
        checkout = master_tree.branch.create_checkout('checkout')
69
69
 
70
 
        other = master_tree.branch.controldir.sprout('other').open_workingtree()
 
70
        other = master_tree.branch.controldir.sprout(
 
71
            'other').open_workingtree()
71
72
        rev2 = other.commit('other commit')
72
73
        # now pull, which should update both checkout and master.
73
74
        checkout.branch.pull(other.branch)
81
82
        rev1 = master_tree.commit('master')
82
83
        checkout = master_tree.branch.create_checkout('checkout')
83
84
 
84
 
        other = master_tree.branch.controldir.sprout('other').open_workingtree()
 
85
        other = master_tree.branch.controldir.sprout(
 
86
            'other').open_workingtree()
85
87
        rev2 = other.commit('other commit')
86
88
        # now pull local, which should update checkout but not master.
87
 
        checkout.branch.pull(other.branch, local = True)
 
89
        checkout.branch.pull(other.branch, local=True)
88
90
        self.assertEqual(rev2, checkout.branch.last_revision())
89
91
        self.assertEqual(rev1, master_tree.branch.last_revision())
90
92
 
93
95
        master_tree = self.make_branch_and_tree('branch')
94
96
        rev1 = master_tree.commit('master')
95
97
 
96
 
        other = master_tree.branch.controldir.sprout('other').open_workingtree()
 
98
        other = master_tree.branch.controldir.sprout(
 
99
            'other').open_workingtree()
97
100
        rev2 = other.commit('other commit')
98
101
        # now pull --local, which should raise LocalRequiresBoundBranch error.
99
102
        self.assertRaises(errors.LocalRequiresBoundBranch,
100
 
                          master_tree.branch.pull, other.branch, local = True)
 
103
                          master_tree.branch.pull, other.branch, local=True)
101
104
        self.assertEqual(rev1, master_tree.branch.last_revision())
102
105
 
103
106
    def test_pull_returns_result(self):
147
150
            builder = self.make_branch_builder('source')
148
151
        except errors.UninitializableFormat:
149
152
            raise TestNotApplicable('uninitializeable format')
150
 
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(builder)
 
153
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
 
154
            builder)
151
155
        target = source.controldir.sprout('target').open_branch()
152
156
        # Add a tag to the source, then pull from source
153
157
        try:
168
172
            builder = self.make_branch_builder('source')
169
173
        except errors.UninitializableFormat:
170
174
            raise TestNotApplicable('uninitializeable format')
171
 
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(builder)
 
175
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
 
176
            builder)
172
177
        target = source.controldir.sprout('target').open_branch()
173
178
        # Add a new commit to the ancestry
174
179
        rev_2_again = builder.build_commit(message="Rev 2 again")
260
265
        rev1 = target.commit('rev 1')
261
266
        target.unlock()
262
267
        sourcedir = target.controldir.clone(self.get_url('source'))
263
 
        source = memorytree.MemoryTree.create_on_branch(sourcedir.open_branch())
 
268
        source = memorytree.MemoryTree.create_on_branch(
 
269
            sourcedir.open_branch())
264
270
        rev2 = source.commit('rev 2')
265
271
        branch.Branch.hooks.install_named_hook(
266
272
            'post_pull', self.capture_post_pull_hook, None)