533
533
self.assertEqual(out,
534
534
('1 tag(s) updated.\n', ''))
536
def test_overwrite_tags(self):
537
"""--overwrite-tags only overwrites tags, not revisions."""
538
from_tree = self.make_branch_and_tree('from')
539
from_tree.branch.tags.set_tag("mytag", "somerevid")
540
to_tree = self.make_branch_and_tree('to')
541
to_tree.branch.tags.set_tag("mytag", "anotherrevid")
542
revid1 = to_tree.commit('my commit')
543
out = self.run_bzr(['pull', '-d', 'to', 'from'], retcode=1)
544
self.assertEquals(out,
545
('No revisions to pull.\nConflicting tags:\n mytag\n', ''))
546
out = self.run_bzr(['pull', '-d', 'to', '--overwrite-tags', 'from'])
547
self.assertEquals(out, ('1 tag(s) updated.\n', ''))
549
self.assertEquals(to_tree.branch.tags.lookup_tag('mytag'),
551
self.assertEquals(to_tree.branch.last_revision(), revid1)
536
553
def test_pull_tag_overwrite(self):
537
554
"""pulling tags with --overwrite only reports changed tags."""
538
555
# create a branch, see that --show-base fails