~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2011-05-04 02:34:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5839.
  • Revision ID: andrew.bennetts@canonical.com-20110504023405-2o1o97b5d759db9b
Be a little more clever about constructing a parents provider for stacked repositories, so that get_parent_map with local-stacked-on-remote doesn't use HPSS VFS calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
478
478
        # upwards without agreement from bzr's network support maintainers.
479
479
        self.assertLength(9, self.hpss_calls)
480
480
 
 
481
    def test_branch_to_stacked_from_trivial_branch_streaming_acceptance(self):
 
482
        self.setup_smart_server_with_call_log()
 
483
        t = self.make_branch_and_tree('from')
 
484
        for count in range(9):
 
485
            t.commit(message='commit %d' % count)
 
486
        self.reset_smart_call_log()
 
487
        out, err = self.run_bzr(['branch', '--stacked', self.get_url('from'),
 
488
            'local-target'])
 
489
        # XXX: the number of hpss calls for this case isn't yet deterministic,
 
490
        # so we can't easily assert about the number of calls.
 
491
        #self.assertLength(XXX, self.hpss_calls)
 
492
        # We can assert that none of the calls were readv requests for rix
 
493
        # files, though (demonstrating that at least get_parent_map calls are
 
494
        # not using VFS RPCs).
 
495
        readvs_of_rix_files = [
 
496
            c for c in self.hpss_calls
 
497
            if c.call.method == 'readv' and c.call.args[-1].endswith('.rix')]
 
498
        self.assertLength(0, readvs_of_rix_files)
 
499
 
481
500
 
482
501
class TestRemoteBranch(TestCaseWithSFTPServer):
483
502