~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2008-09-03 16:33:27 UTC
  • mto: (3705.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 3708.
  • Revision ID: v.ladeuil+lp@free.fr-20080903163327-hpgcpvx2ziit96og
Begin fixing bug #233817.

* tests/test_missing.py:
revnos returned by fin_unmerged are strings, update tests.
(TestFindUnmerged.test_include_merges): Check that we get the
merged revisions too.

* missing.py:
(find_unmerged): Add 'reverse' and 'include_merges' parameters.
(_enumerate_mainline): Add reverse parameter so that we reverse
the mainline revision list only when needed.
(_enumerate_with_merges): When including merges, building the
revision list is a bit more work.
(_find_unmerged): Build the revision list depending on
include_merges.

* log.py:
(LineLogFormatter.log_string): Fix doc string, the revno may be a
string.

* builtins.py:
(cmd_missing): Add an '--include-merges' option. Let fin_unmerged
handles the ordering.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3318
3318
            Option('other', 'Same as --theirs-only.'),
3319
3319
            'log-format',
3320
3320
            'show-ids',
3321
 
            'verbose'
 
3321
            'verbose',
 
3322
            Option('include-merges', 'Show merged revisions.'),
3322
3323
            ]
3323
3324
    encoding_type = 'replace'
3324
3325
 
3325
3326
    @display_command
3326
3327
    def run(self, other_branch=None, reverse=False, mine_only=False,
3327
 
            theirs_only=False, log_format=None, long=False, short=False, line=False, 
3328
 
            show_ids=False, verbose=False, this=False, other=False):
 
3328
            theirs_only=False,
 
3329
            log_format=None, long=False, short=False, line=False,
 
3330
            show_ids=False, verbose=False, this=False, other=False,
 
3331
            include_merges=False):
3329
3332
        from bzrlib.missing import find_unmerged, iter_log_revisions
3330
3333
 
3331
3334
        if this:
3361
3364
            remote_branch.lock_read()
3362
3365
            try:
3363
3366
                local_extra, remote_extra = find_unmerged(
3364
 
                    local_branch, remote_branch, restrict)
 
3367
                    local_branch, remote_branch, restrict,
 
3368
                    reverse=reverse,
 
3369
                    include_merges=include_merges)
3365
3370
 
3366
3371
                if log_format is None:
3367
3372
                    registry = log.log_formatter_registry
3369
3374
                lf = log_format(to_file=self.outf,
3370
3375
                                show_ids=show_ids,
3371
3376
                                show_timezone='original')
3372
 
                if reverse is False:
3373
 
                    if local_extra is not None:
3374
 
                        local_extra.reverse()
3375
 
                    if remote_extra is not None:
3376
 
                        remote_extra.reverse()
3377
3377
 
3378
3378
                status_code = 0
3379
3379
                if local_extra and not theirs_only: