~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-02-03 02:22:57 UTC
  • mfrom: (5639.1.2 doc-lint-2.4)
  • Revision ID: pqm@pqm.ubuntu.com-20110203022257-caoghu6higq98tak
(spiv) Link to What's New in 2.4 (rather than 2.3) in doc index,
 and add missing comma in doc. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    branch,
24
24
    bzrdir,
25
25
    errors,
 
26
    repository,
26
27
    revision as _mod_revision,
27
28
    )
28
29
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
29
30
from bzrlib.tests import TestCaseWithTransport
30
31
from bzrlib.tests import (
 
32
    KnownFailure,
31
33
    HardlinkFeature,
32
34
    test_server,
33
35
    )
268
270
        self.run_bzr('checkout --lightweight a b')
269
271
        self.assertLength(2, calls)
270
272
 
271
 
    def test_branch_fetches_all_tags(self):
272
 
        builder = self.make_branch_builder('source')
273
 
        builder.build_commit(message="Rev 1", rev_id='rev-1')
274
 
        builder.build_commit(message="Rev 2", rev_id='rev-2')
275
 
        source = builder.get_branch()
276
 
        source.tags.set_tag('tag-a', 'rev-2')
277
 
        source.set_last_revision_info(1, 'rev-1')
278
 
        # Now source has a tag not in its ancestry.  Make a branch from it.
279
 
        self.run_bzr('branch source new-branch')
280
 
        new_branch = branch.Branch.open('new-branch')
281
 
        # The tag is present, and so is its revision.
282
 
        self.assertEqual('rev-2', new_branch.tags.lookup_tag('tag-a'))
283
 
        new_branch.repository.get_revision('rev-2')
284
 
 
285
273
 
286
274
class TestBranchStacked(TestCaseWithTransport):
287
275
    """Tests for branch --stacked"""
463
451
        # upwards without agreement from bzr's network support maintainers.
464
452
        self.assertLength(14, self.hpss_calls)
465
453
 
466
 
    def test_branch_from_branch_with_tags(self):
467
 
        self.setup_smart_server_with_call_log()
468
 
        builder = self.make_branch_builder('source')
469
 
        builder.build_commit(message="Rev 1", rev_id='rev-1')
470
 
        builder.build_commit(message="Rev 2", rev_id='rev-2')
471
 
        source = builder.get_branch()
472
 
        source.tags.set_tag('tag-a', 'rev-2')
473
 
        source.tags.set_tag('tag-missing', 'missing-rev')
474
 
        source.set_last_revision_info(1, 'rev-1')
475
 
        # Now source has a tag not in its ancestry.  Make a branch from it.
476
 
        self.reset_smart_call_log()
477
 
        out, err = self.run_bzr(['branch', self.get_url('source'), 'target'])
478
 
        # This figure represent the amount of work to perform this use case. It
479
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
480
 
        # being too low. If rpc_count increases, more network roundtrips have
481
 
        # become necessary for this use case. Please do not adjust this number
482
 
        # upwards without agreement from bzr's network support maintainers.
483
 
        self.assertLength(9, self.hpss_calls)
484
 
 
485
454
 
486
455
class TestRemoteBranch(TestCaseWithSFTPServer):
487
456