~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_controldir/test_controldir.py

  • Committer: Andrew Bennetts
  • Date: 2010-12-06 02:42:26 UTC
  • mto: This revision was merged to the branch mainline in revision 5648.
  • Revision ID: andrew.bennetts@canonical.com-20101206024226-gpcin9qr2yzyv74y
Remove XXX, add some test coverage to prove it works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
705
705
        new_branch = target.open_branch()
706
706
        self.assertEqual('missing-rev', new_branch.tags.lookup_tag('tag-a'))
707
707
 
 
708
    def test_sprout_bzrdir_passing_source_branch_with_absent_tag(self):
 
709
        # tags referencing absent revisions are copied (and those absent
 
710
        # revisions do not prevent the sprout.)
 
711
        builder = self.make_branch_builder('source')
 
712
        builder.build_commit(message="Rev 1", rev_id='rev-1')
 
713
        source = builder.get_branch()
 
714
        try:
 
715
            source.tags.set_tag('tag-a', 'missing-rev')
 
716
        except errors.TagsNotSupported:
 
717
            raise TestNotApplicable('Branch format does not support tags.')
 
718
        # Now source has a tag pointing to an absent revision.  Sprout its
 
719
        # controldir.
 
720
        dir = source.bzrdir
 
721
        target = dir.sprout(self.get_url('target'), source_branch=source)
 
722
        # The tag is present in the target
 
723
        new_branch = target.open_branch()
 
724
        self.assertEqual('missing-rev', new_branch.tags.lookup_tag('tag-a'))
 
725
 
708
726
    def test_sprout_bzrdir_tree_branch_reference(self):
709
727
        # sprouting should create a repository if needed and a sprouted branch.
710
728
        # the tree state should not be copied.