/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/per_interbranch/test_push.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-21 04:40:09 UTC
  • mfrom: (7494.1.1 trunk-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200221044009-cijpllwtz5ql9tar
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-3.1/+merge/379600

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
        self.overrideAttr(SmartServerRepositoryGetParentMap,
375
375
                          'no_extra_results', True)
376
376
 
 
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')
 
384
        try:
 
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())
 
396
 
377
397
 
378
398
class TestPushHook(TestCaseWithInterBranch):
379
399