~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-20 21:00:27 UTC
  • mfrom: (3427.3.8 missing)
  • Revision ID: pqm@pqm.ubuntu.com-20080520210027-wetfxldz1ggc5u2a
(jam) 'bzr missing' uses Graph.find* rather than using whole ancestry
        comparisons (bug #174625)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3308
3308
        from bzrlib.missing import find_unmerged, iter_log_revisions
3309
3309
 
3310
3310
        if this:
3311
 
          mine_only = this
 
3311
            mine_only = this
3312
3312
        if other:
3313
 
          theirs_only = other
 
3313
            theirs_only = other
 
3314
        # TODO: We should probably check that we don't have mine-only and
 
3315
        #       theirs-only set, but it gets complicated because we also have
 
3316
        #       this and other which could be used.
 
3317
        restrict = 'all'
 
3318
        if mine_only:
 
3319
            restrict = 'local'
 
3320
        elif theirs_only:
 
3321
            restrict = 'remote'
3314
3322
 
3315
3323
        local_branch = Branch.open_containing(u".")[0]
3316
3324
        parent = local_branch.get_parent()
3330
3338
        try:
3331
3339
            remote_branch.lock_read()
3332
3340
            try:
3333
 
                local_extra, remote_extra = find_unmerged(local_branch,
3334
 
                                                          remote_branch)
 
3341
                local_extra, remote_extra = find_unmerged(
 
3342
                    local_branch, remote_branch, restrict)
 
3343
 
3335
3344
                if log_format is None:
3336
3345
                    registry = log.log_formatter_registry
3337
3346
                    log_format = registry.get_default(local_branch)
3339
3348
                                show_ids=show_ids,
3340
3349
                                show_timezone='original')
3341
3350
                if reverse is False:
3342
 
                    local_extra.reverse()
3343
 
                    remote_extra.reverse()
 
3351
                    if local_extra is not None:
 
3352
                        local_extra.reverse()
 
3353
                    if remote_extra is not None:
 
3354
                        remote_extra.reverse()
 
3355
 
 
3356
                status_code = 0
3344
3357
                if local_extra and not theirs_only:
3345
3358
                    self.outf.write("You have %d extra revision(s):\n" %
3346
3359
                                    len(local_extra))
3349
3362
                                        verbose):
3350
3363
                        lf.log_revision(revision)
3351
3364
                    printed_local = True
 
3365
                    status_code = 1
3352
3366
                else:
3353
3367
                    printed_local = False
 
3368
 
3354
3369
                if remote_extra and not mine_only:
3355
3370
                    if printed_local is True:
3356
3371
                        self.outf.write("\n\n\n")
3360
3375
                                        remote_branch.repository,
3361
3376
                                        verbose):
3362
3377
                        lf.log_revision(revision)
3363
 
                if not remote_extra and not local_extra:
3364
 
                    status_code = 0
 
3378
                    status_code = 1
 
3379
 
 
3380
                if mine_only and not local_extra:
 
3381
                    # We checked local, and found nothing extra
 
3382
                    self.outf.write('This branch is up to date.\n')
 
3383
                elif theirs_only and not remote_extra:
 
3384
                    # We checked remote, and found nothing extra
 
3385
                    self.outf.write('Other branch is up to date.\n')
 
3386
                elif not (mine_only or theirs_only or local_extra or
 
3387
                          remote_extra):
 
3388
                    # We checked both branches, and neither one had extra
 
3389
                    # revisions
3365
3390
                    self.outf.write("Branches are up to date.\n")
3366
 
                else:
3367
 
                    status_code = 1
3368
3391
            finally:
3369
3392
                remote_branch.unlock()
3370
3393
        finally: