~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_sprout.py

(spiv) Fetch tagged revisions (not just tags) during branch,
 merge and pull. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
        self.assertEqual((2, 'rev2-alt'), branch2.last_revision_info())
112
112
        self.assertEqual(['rev1', 'rev2-alt'], branch2.revision_history())
113
113
 
 
114
    def test_sprout_preserves_tags(self):
 
115
        """Sprout preserves tags, even tags of absent revisions."""
 
116
        try:
 
117
            builder = self.make_branch_builder('source')
 
118
        except errors.UninitializableFormat:
 
119
            raise tests.TestSkipped('Uninitializable branch format')
 
120
        builder.build_commit(message="Rev 1", rev_id='rev-1')
 
121
        source = builder.get_branch()
 
122
        try:
 
123
            source.tags.set_tag('tag-a', 'missing-rev')
 
124
        except errors.TagsNotSupported:
 
125
            raise tests.TestNotApplicable(
 
126
                'Branch format does not support tags.')
 
127
        # Now source has a tag pointing to an absent revision.  Sprout it.
 
128
        target_bzrdir = self.make_repository('target').bzrdir
 
129
        new_branch = source.sprout(target_bzrdir)
 
130
        # The tag is present in the target
 
131
        self.assertEqual('missing-rev', new_branch.tags.lookup_tag('tag-a'))
 
132
 
114
133
    def test_sprout_from_any_repo_revision(self):
115
134
        """We should be able to sprout from any revision."""
116
135
        wt = self.make_branch_and_tree('source')