135
139
self.assertEqual(tree_b.branch.revision_history(),
136
140
tree_a.branch.revision_history())
142
def test_pull_merges_and_fetches_tags(self):
143
"""Tags are updated by br.pull(source), and revisions named in those
146
# Make a source, sprout a target off it
148
builder = self.make_branch_builder('source')
149
except errors.UninitializableFormat:
150
raise TestNotApplicable('uninitializeable format')
151
source = fixtures.build_branch_with_non_ancestral_rev(builder)
152
target = source.bzrdir.sprout('target').open_branch()
153
# Add a tag to the source, then pull from source
155
source.tags.set_tag('tag-a', 'rev-2')
156
except errors.TagsNotSupported:
157
raise TestNotApplicable('format does not support tags.')
158
source.tags.set_tag('tag-a', 'rev-2')
160
# The tag is present, and so is its revision.
161
self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
162
target.repository.get_revision('rev-2')
164
def test_pull_stop_revision_merges_and_fetches_tags(self):
165
"""br.pull(source, stop_revision=REV) updates and fetches tags."""
166
# Make a source, sprout a target off it
168
builder = self.make_branch_builder('source')
169
except errors.UninitializableFormat:
170
raise TestNotApplicable('uninitializeable format')
171
source = fixtures.build_branch_with_non_ancestral_rev(builder)
172
target = source.bzrdir.sprout('target').open_branch()
173
# Add a new commit to the ancestry
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.')
180
target.pull(source, 'rev-2-again')
181
# The tag is present, and so is its revision.
182
self.assertEqual('rev-2', target.tags.lookup_tag('tag-a'))
183
target.repository.get_revision('rev-2')
139
186
class TestPullHook(per_branch.TestCaseWithBranch):