~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-19 15:22:23 UTC
  • mfrom: (6123.11.18 log-omit-merges)
  • Revision ID: pqm@pqm.ubuntu.com-20110919152223-o7lh1428tge31dg1
(jr) Add options --omit-merges and --include-merged for bzr log and missing,
 deprecating --include-merges. (Martin von Gagern)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2100
2100
                                         ' one or two revision specifiers'))
2101
2101
 
2102
2102
        if using is not None and format is not None:
2103
 
            raise errors.BzrCommandError(gettext('--using and --format are mutually '
2104
 
                'exclusive.'))
 
2103
            raise errors.BzrCommandError(gettext(
 
2104
                '{0} and {1} are mutually exclusive').format(
 
2105
                '--using', '--format'))
2105
2106
 
2106
2107
        (old_tree, new_tree,
2107
2108
         old_branch, new_branch,
2421
2422
            Option('show-diff',
2422
2423
                   short_name='p',
2423
2424
                   help='Show changes made in each revision as a patch.'),
2424
 
            Option('include-merges',
 
2425
            Option('include-merged',
2425
2426
                   help='Show merged revisions like --levels 0 does.'),
 
2427
            Option('include-merges', hidden=True,
 
2428
                   help='Historical alias for --include-merged.'),
 
2429
            Option('omit-merges',
 
2430
                   help='Do not report commits with more than one parent.'),
2426
2431
            Option('exclude-common-ancestry',
2427
2432
                   help='Display only the revisions that are not part'
2428
2433
                   ' of both ancestries (require -rX..Y)'
2465
2470
            message=None,
2466
2471
            limit=None,
2467
2472
            show_diff=False,
2468
 
            include_merges=False,
 
2473
            include_merged=None,
2469
2474
            authors=None,
2470
2475
            exclude_common_ancestry=False,
2471
2476
            signatures=False,
2474
2479
            match_committer=None,
2475
2480
            match_author=None,
2476
2481
            match_bugs=None,
 
2482
            omit_merges=False,
 
2483
            include_merges=symbol_versioning.DEPRECATED_PARAMETER,
2477
2484
            ):
2478
2485
        from bzrlib.log import (
2479
2486
            Logger,
2481
2488
            _get_info_for_log_files,
2482
2489
            )
2483
2490
        direction = (forward and 'forward') or 'reverse'
 
2491
        if symbol_versioning.deprecated_passed(include_merges):
 
2492
            ui.ui_factory.show_user_warning(
 
2493
                'deprecated_command_option',
 
2494
                deprecated_name='--include-merges',
 
2495
                recommended_name='--include-merged',
 
2496
                deprecated_in_version='2.5',
 
2497
                command=self.invoked_as)
 
2498
            if include_merged is None:
 
2499
                include_merged = include_merges
 
2500
            else:
 
2501
                raise errors.BzrCommandError(gettext(
 
2502
                    '{0} and {1} are mutually exclusive').format(
 
2503
                    '--include-merges', '--include-merged'))
 
2504
        if include_merged is None:
 
2505
            include_merged = False
2484
2506
        if (exclude_common_ancestry
2485
2507
            and (revision is None or len(revision) != 2)):
2486
2508
            raise errors.BzrCommandError(gettext(
2487
2509
                '--exclude-common-ancestry requires -r with two revisions'))
2488
 
        if include_merges:
 
2510
        if include_merged:
2489
2511
            if levels is None:
2490
2512
                levels = 0
2491
2513
            else:
2492
2514
                raise errors.BzrCommandError(gettext(
2493
 
                    '--levels and --include-merges are mutually exclusive'))
 
2515
                    '{0} and {1} are mutually exclusive').format(
 
2516
                    '--levels', '--include-merged'))
2494
2517
 
2495
2518
        if change is not None:
2496
2519
            if len(change) > 1:
2497
2520
                raise errors.RangeInChangeOption()
2498
2521
            if revision is not None:
2499
2522
                raise errors.BzrCommandError(gettext(
2500
 
                    '--revision and --change are mutually exclusive'))
 
2523
                    '{0} and {1} are mutually exclusive').format(
 
2524
                    '--revision', '--change'))
2501
2525
            else:
2502
2526
                revision = change
2503
2527
 
2603
2627
            message_search=message, delta_type=delta_type,
2604
2628
            diff_type=diff_type, _match_using_deltas=match_using_deltas,
2605
2629
            exclude_common_ancestry=exclude_common_ancestry, match=match_dict,
2606
 
            signature=signatures
 
2630
            signature=signatures, omit_merges=omit_merges,
2607
2631
            )
2608
2632
        Logger(b, rqst).show(lf)
2609
2633
 
4605
4629
            type=_parse_revision_str,
4606
4630
            help='Filter on local branch revisions (inclusive). '
4607
4631
                'See "help revisionspec" for details.'),
4608
 
        Option('include-merges',
 
4632
        Option('include-merged',
4609
4633
               'Show all revisions in addition to the mainline ones.'),
 
4634
        Option('include-merges', hidden=True,
 
4635
               help='Historical alias for --include-merged.'),
4610
4636
        ]
4611
4637
    encoding_type = 'replace'
4612
4638
 
4615
4641
            theirs_only=False,
4616
4642
            log_format=None, long=False, short=False, line=False,
4617
4643
            show_ids=False, verbose=False, this=False, other=False,
4618
 
            include_merges=False, revision=None, my_revision=None,
4619
 
            directory=u'.'):
 
4644
            include_merged=None, revision=None, my_revision=None,
 
4645
            directory=u'.',
 
4646
            include_merges=symbol_versioning.DEPRECATED_PARAMETER):
4620
4647
        from bzrlib.missing import find_unmerged, iter_log_revisions
4621
4648
        def message(s):
4622
4649
            if not is_quiet():
4623
4650
                self.outf.write(s)
4624
4651
 
 
4652
        if symbol_versioning.deprecated_passed(include_merges):
 
4653
            ui.ui_factory.show_user_warning(
 
4654
                'deprecated_command_option',
 
4655
                deprecated_name='--include-merges',
 
4656
                recommended_name='--include-merged',
 
4657
                deprecated_in_version='2.5',
 
4658
                command=self.invoked_as)
 
4659
            if include_merged is None:
 
4660
                include_merged = include_merges
 
4661
            else:
 
4662
                raise errors.BzrCommandError(gettext(
 
4663
                    '{0} and {1} are mutually exclusive').format(
 
4664
                    '--include-merges', '--include-merged'))
 
4665
        if include_merged is None:
 
4666
            include_merged = False
4625
4667
        if this:
4626
4668
            mine_only = this
4627
4669
        if other:
4666
4708
        local_extra, remote_extra = find_unmerged(
4667
4709
            local_branch, remote_branch, restrict,
4668
4710
            backward=not reverse,
4669
 
            include_merges=include_merges,
 
4711
            include_merged=include_merged,
4670
4712
            local_revid_range=local_revid_range,
4671
4713
            remote_revid_range=remote_revid_range)
4672
4714