~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_pull.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:
142
142
        self.run_bzr('pull -r 4')
143
143
        self.assertEqual(a.revision_history(), b.revision_history())
144
144
 
 
145
    def test_pull_tags(self):
 
146
        """Tags are updated by pull, and revisions named in those tags are
 
147
        fetched.
 
148
        """
 
149
        # Make a source, sprout a target off it
 
150
        builder = self.make_branch_builder('source')
 
151
        builder.build_commit(message="Rev 1", rev_id='rev-1')
 
152
        source = builder.get_branch()
 
153
        target_bzrdir = source.bzrdir.sprout('target')
 
154
        # Add a non-ancestry tag to source
 
155
        builder.build_commit(message="Rev 2", rev_id='rev-2')
 
156
        source.tags.set_tag('tag-a', 'rev-2')
 
157
        source.set_last_revision_info(1, 'rev-1')
 
158
        # Pull from source
 
159
        self.run_bzr('pull -d target source')
 
160
        target = target_bzrdir.open_branch()
 
161
        # The tag is present, and so is its revision.
 
162
        self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
 
163
        target.repository.get_revision('rev-2')
 
164
 
145
165
    def test_overwrite_uptodate(self):
146
166
        # Make sure pull --overwrite overwrites
147
167
        # even if the target branch has merged