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