375
375
self.overrideAttr(SmartServerRepositoryGetParentMap,
376
376
'no_extra_results', True)
378
def test_push_tag_selector(self):
379
if not self.branch_format_from.supports_tags():
380
raise tests.TestNotApplicable('from format does not support tags')
381
if not self.branch_format_to.supports_tags():
382
raise tests.TestNotApplicable('to format does not support tags')
383
tree_a = self.make_from_branch_and_tree('tree_a')
384
revid1 = tree_a.commit('message 1')
386
tree_b = self.sprout_to(
387
tree_a.controldir, 'tree_b').open_workingtree()
388
except errors.NoRoundtrippingSupport:
389
raise tests.TestNotApplicable(
390
'lossless push between %r and %r not supported' %
391
(self.branch_format_from, self.branch_format_to))
392
tree_b.branch.tags.set_tag('tag1', revid1)
393
tree_b.branch.tags.set_tag('tag2', revid1)
394
tree_b.branch.get_config_stack().set('branch.fetch_tags', True)
395
tree_b.branch.push(tree_a.branch, tag_selector=lambda x: x == 'tag1')
396
self.assertEqual({'tag1': revid1}, tree_a.branch.tags.get_tag_dict())
379
399
class TestPushHook(TestCaseWithInterBranch):