~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

Merge bzr.dev 4187, and revert the change to fix refcycle issues.

I apparently didn't run the smart fetch tests. Which show that we access inv+chk pages
as a fulltext, and then insert the stream, which expects to get the block as a compressed
block. :(.
Need to rethink how to do it, possibly with weakrefs.


This also brings in CommitBuilder.record_iter_changes() and the updates to btree_index
and backing indices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
        self.assertContainsRe(err,
393
393
                              'Using default stacking branch stack_on at .*')
394
394
 
 
395
    def test_push_stacks_with_default_stacking_if_target_is_stackable(self):
 
396
        self.make_branch('stack_on', format='1.6')
 
397
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
398
        self.make_branch('from', format='pack-0.92')
 
399
        out, err = self.run_bzr('push -d from to')
 
400
        branch = Branch.open('to')
 
401
        self.assertEqual('../stack_on', branch.get_stacked_on_url())
 
402
 
 
403
    def test_push_does_not_change_format_with_default_if_target_cannot(self):
 
404
        self.make_branch('stack_on', format='pack-0.92')
 
405
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
406
        self.make_branch('from', format='pack-0.92')
 
407
        out, err = self.run_bzr('push -d from to')
 
408
        branch = Branch.open('to')
 
409
        self.assertRaises(errors.UnstackableBranchFormat,
 
410
            branch.get_stacked_on_url)
 
411
 
395
412
    def test_push_doesnt_create_broken_branch(self):
396
413
        """Pushing a new standalone branch works even when there's a default
397
414
        stacking policy at the destination.