~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2011-02-09 06:36:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5660.
  • Revision ID: andrew.bennetts@canonical.com-20110209063635-77bt3r16v9oz565k
Simplify new fixture slightly, and other test tweaks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
            builder = self.make_branch_builder('source')
149
149
        except errors.UninitializableFormat:
150
150
            raise TestNotApplicable('uninitializeable format')
151
 
        source = fixtures.build_branch_with_non_ancestral_tag(builder)
152
 
        source.tags.delete_tag('tag-a')
 
151
        source = fixtures.build_branch_with_non_ancestral_rev(builder)
153
152
        target = source.bzrdir.sprout('target').open_branch()
 
153
        # Add a tag to the source, then pull from source
 
154
        try:
 
155
            source.tags.set_tag('tag-a', 'rev-2')
 
156
        except errors.TagsNotSupported:
 
157
            raise TestNotApplicable('format does not support tags.')
154
158
        source.tags.set_tag('tag-a', 'rev-2')
155
 
        # Pull from source
156
159
        target.pull(source)
157
160
        # The tag is present, and so is its revision.
158
161
        self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
165
168
            builder = self.make_branch_builder('source')
166
169
        except errors.UninitializableFormat:
167
170
            raise TestNotApplicable('uninitializeable format')
168
 
        source = fixtures.build_branch_with_non_ancestral_tag(builder)
169
 
        source.tags.delete_tag('tag-a')
 
171
        source = fixtures.build_branch_with_non_ancestral_rev(builder)
170
172
        target = source.bzrdir.sprout('target').open_branch()
171
 
        source.tags.set_tag('tag-a', 'rev-2')
172
173
        # Add a new commit to the ancestry
173
174
        builder.build_commit(message="Rev 2 again", rev_id='rev-2-again')
174
 
        # Pull from source
 
175
        # Add a tag to the source, then pull rev-2-again from source
 
176
        try:
 
177
            source.tags.set_tag('tag-a', 'rev-2')
 
178
        except errors.TagsNotSupported:
 
179
            raise TestNotApplicable('format does not support tags.')
175
180
        target.pull(source, 'rev-2-again')
176
181
        # The tag is present, and so is its revision.
177
182
        self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))