/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: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from breezy.tests.per_interbranch import TestCaseWithInterBranch
26
26
 
27
27
 
28
 
# The tests here are based on the tests in 
 
28
# The tests here are based on the tests in
29
29
# breezy.tests.per_branch.test_pull
30
30
 
31
31
 
86
86
        master_tree.commit('master')
87
87
        checkout = master_tree.branch.create_checkout('checkout')
88
88
        try:
89
 
            other = self.sprout_to(master_tree.branch.controldir, 'other').open_workingtree()
 
89
            other = self.sprout_to(
 
90
                master_tree.branch.controldir, 'other').open_workingtree()
90
91
        except errors.NoRoundtrippingSupport:
91
92
            raise TestNotApplicable(
92
93
                'lossless push between %r and %r not supported' %
105
106
    def test_pull_raises_specific_error_on_master_connection_error(self):
106
107
        master_tree = self.make_from_branch_and_tree('master')
107
108
        checkout = master_tree.branch.create_checkout('checkout')
108
 
        other = self.sprout_to(master_tree.branch.controldir, 'other').open_branch()
 
109
        other = self.sprout_to(
 
110
            master_tree.branch.controldir, 'other').open_branch()
109
111
        # move the branch out of the way on disk to cause a connection
110
112
        # error.
111
113
        try:
148
150
        tree_a = self.make_from_branch_and_tree('tree_a')
149
151
        tree_a.commit('message 1')
150
152
        try:
151
 
            tree_b = self.sprout_to(tree_a.controldir, 'tree_b').open_workingtree()
 
153
            tree_b = self.sprout_to(
 
154
                tree_a.controldir, 'tree_b').open_workingtree()
152
155
        except errors.NoRoundtrippingSupport:
153
156
            raise TestNotApplicable(
154
157
                'lossless push between %r and %r not supported' %
157
160
        rev2a = tree_a.commit('message 2a')
158
161
        rev2b = tree_b.commit('message 2b')
159
162
        try:
160
 
            self.assertRaises(errors.DivergedBranches, tree_a.pull, tree_b.branch)
 
163
            self.assertRaises(errors.DivergedBranches,
 
164
                              tree_a.pull, tree_b.branch)
161
165
        except errors.NoRoundtrippingSupport:
162
166
            raise TestNotApplicable(
163
167
                'lossless push between %r and %r not supported' %
206
210
        target = self.make_to_branch('target')
207
211
        source = self.make_from_branch('source')
208
212
        Branch.hooks.install_named_hook('post_pull',
209
 
            self.capture_post_pull_hook, None)
 
213
                                        self.capture_post_pull_hook, None)
210
214
        target.pull(source)
211
215
        # with nothing there we should still get a notification, and
212
216
        # have both branches locked at the notification time.
235
239
            local.bind(target)
236
240
        source = self.make_from_branch('source')
237
241
        Branch.hooks.install_named_hook('post_pull',
238
 
            self.capture_post_pull_hook, None)
 
242
                                        self.capture_post_pull_hook, None)
239
243
        local.pull(source)
240
244
        # with nothing there we should still get a notification, and
241
245
        # have both branches locked at the notification time.
255
259
        source = MemoryTree.create_on_branch(sourcedir.open_branch())
256
260
        rev2 = source.commit('rev 2')
257
261
        Branch.hooks.install_named_hook('post_pull',
258
 
            self.capture_post_pull_hook, None)
 
262
                                        self.capture_post_pull_hook, None)
259
263
        target.branch.pull(source.branch)
260
264
        # with nothing there we should still get a notification, and
261
265
        # have both branches locked at the notification time.