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