~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_bound_sftp.py

  • Committer: Alexander Belchenko
  • Date: 2007-02-02 09:14:30 UTC
  • mfrom: (2256 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2259.
  • Revision ID: bialix@ukr.net-20070202091430-vdgouvazded1yfqw
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        self.assertEqual(['r@b-1'], wt_child.branch.revision_history())
185
185
        self.assertEqual(['r@b-1'], sftp_b_newbase.revision_history())
186
186
 
187
 
    def test_pull_updates_both(self):
188
 
        b_base, wt_child = self.create_branches()
189
 
 
190
 
        wt_newchild = b_base.bzrdir.sprout('newchild').open_workingtree()
191
 
        open('newchild/b', 'wb').write('newchild b contents\n')
192
 
        wt_newchild.commit('newchild', rev_id='r@d-2')
193
 
        self.assertEqual(['r@b-1', 'r@d-2'], wt_newchild.branch.revision_history())
194
 
 
195
 
        wt_child.pull(wt_newchild.branch)
196
 
        self.assertEqual(['r@b-1', 'r@d-2'], wt_child.branch.revision_history())
197
 
        self.assertEqual(['r@b-1', 'r@d-2'], b_base.revision_history())
198
 
 
199
187
    def test_bind_diverged(self):
200
188
        from bzrlib.builtins import merge
201
189
 
333
321
        self.assertRaises(errors.BoundBranchConnectionFailure,
334
322
                wt_child.commit, 'added text', rev_id='r@c-2')
335
323
 
336
 
    def test_pull_fails(self):
337
 
        b_base, wt_child = self.create_branches()
338
 
 
339
 
        wt_other = wt_child.bzrdir.sprout('other').open_workingtree()
340
 
        open('other/a', 'wb').write('new contents\n')
341
 
        wt_other.commit('changed a', rev_id='r@d-2')
342
 
 
343
 
        self.assertEqual(['r@b-1'], b_base.revision_history())
344
 
        self.assertEqual(['r@b-1'], wt_child.branch.revision_history())
345
 
        self.assertEqual(['r@b-1', 'r@d-2'], wt_other.branch.revision_history())
346
 
 
347
 
        # this deletes the branch from memory
348
 
        del b_base
349
 
        # and this moves it out of the way on disk
350
 
        os.rename('base', 'hidden_base')
351
 
 
352
 
        self.assertRaises(errors.BoundBranchConnectionFailure,
353
 
                wt_child.pull, wt_other.branch)
354
 
 
355
324
    # TODO: jam 20051231 We need invasive failure tests, so that we can show
356
325
    #       performance even when something fails.
357
326