~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2012-01-05 10:44:12 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105104412-z03fi9m43h946fvs
Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        self.assertEqual('', out)
80
80
        self.assertEqual('Branched 2 revisions.\n', err)
81
81
        out, err = self.run_bzr('branches b')
82
 
        self.assertEqual(" thiswasa\n orig\n", out)
 
82
        self.assertEqual("  orig\n  thiswasa\n", out)
83
83
        self.assertEqual('', err)
84
84
        out,err = self.run_bzr('branch a file:b,branch=orig', retcode=3)
85
85
        self.assertEqual('', out)
331
331
        builder = self.make_branch_builder('source')
332
332
        source = fixtures.build_branch_with_non_ancestral_rev(builder)
333
333
        source.tags.set_tag('tag-a', 'rev-2')
334
 
        source.get_config().set_user_option('branch.fetch_tags', 'True')
 
334
        source.get_config_stack().set('branch.fetch_tags', True)
335
335
        # Now source has a tag not in its ancestry.  Make a branch from it.
336
336
        self.run_bzr('branch source new-branch')
337
337
        new_branch = branch.Branch.open('new-branch')
483
483
        # being too low. If rpc_count increases, more network roundtrips have
484
484
        # become necessary for this use case. Please do not adjust this number
485
485
        # upwards without agreement from bzr's network support maintainers.
 
486
        self.assertLength(2, self.hpss_connections)
486
487
        self.assertLength(33, self.hpss_calls)
487
488
        self.expectFailure("branching to the same branch requires VFS access",
488
489
            self.assertThat, self.hpss_calls, ContainsNoVfsCalls)
502
503
        # upwards without agreement from bzr's network support maintainers.
503
504
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
504
505
        self.assertLength(10, self.hpss_calls)
 
506
        self.assertLength(1, self.hpss_connections)
505
507
 
506
508
    def test_branch_from_trivial_stacked_branch_streaming_acceptance(self):
507
509
        self.setup_smart_server_with_call_log()
522
524
        # become necessary for this use case. Please do not adjust this number
523
525
        # upwards without agreement from bzr's network support maintainers.
524
526
        self.assertLength(15, self.hpss_calls)
 
527
        self.assertLength(1, self.hpss_connections)
525
528
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
526
529
 
527
530
    def test_branch_from_branch_with_tags(self):
528
531
        self.setup_smart_server_with_call_log()
529
532
        builder = self.make_branch_builder('source')
530
533
        source = fixtures.build_branch_with_non_ancestral_rev(builder)
531
 
        source.get_config().set_user_option('branch.fetch_tags', 'True')
 
534
        source.get_config_stack().set('branch.fetch_tags', True)
532
535
        source.tags.set_tag('tag-a', 'rev-2')
533
536
        source.tags.set_tag('tag-missing', 'missing-rev')
534
537
        # Now source has a tag not in its ancestry.  Make a branch from it.
541
544
        # upwards without agreement from bzr's network support maintainers.
542
545
        self.assertLength(10, self.hpss_calls)
543
546
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
547
        self.assertLength(1, self.hpss_connections)
544
548
 
545
549
    def test_branch_to_stacked_from_trivial_branch_streaming_acceptance(self):
546
550
        self.setup_smart_server_with_call_log()
559
563
        readvs_of_rix_files = [
560
564
            c for c in self.hpss_calls
561
565
            if c.call.method == 'readv' and c.call.args[-1].endswith('.rix')]
 
566
        self.assertLength(1, self.hpss_connections)
562
567
        self.assertLength(0, readvs_of_rix_files)
563
568
        self.expectFailure("branching to stacked requires VFS access",
564
569
            self.assertThat, self.hpss_calls, ContainsNoVfsCalls)