/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

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):
202
205
            builder = self.make_branch_builder('source')
203
206
        except errors.UninitializableFormat:
204
207
            raise TestNotApplicable('uninitializeable format')
205
 
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(builder)
 
208
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
 
209
            builder)
206
210
        target = source.controldir.sprout('target').open_branch()
207
211
        # Add a tag to the source, then pull from source
208
212
        try:
223
227
            builder = self.make_branch_builder('source')
224
228
        except errors.UninitializableFormat:
225
229
            raise TestNotApplicable('uninitializeable format')
226
 
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(builder)
 
230
        source, rev1, rev2 = fixtures.build_branch_with_non_ancestral_rev(
 
231
            builder)
227
232
        target = source.controldir.sprout('target').open_branch()
228
233
        # Add a new commit to the ancestry
229
234
        rev_2_again = builder.build_commit(message="Rev 2 again")
315
320
        rev1 = target.commit('rev 1')
316
321
        target.unlock()
317
322
        sourcedir = target.controldir.clone(self.get_url('source'))
318
 
        source = memorytree.MemoryTree.create_on_branch(sourcedir.open_branch())
 
323
        source = memorytree.MemoryTree.create_on_branch(
 
324
            sourcedir.open_branch())
319
325
        rev2 = source.commit('rev 2')
320
326
        branch.Branch.hooks.install_named_hook(
321
327
            'post_pull', self.capture_post_pull_hook, None)