mercurial/commands.py
changeset 31024 0b8356705de6
parent 31022 705ecab649ea
child 31028 3c22ad83868b
equal deleted inserted replaced
31023:aea06029919e 31024:0b8356705de6
    42     minirst,
    42     minirst,
    43     obsolete,
    43     obsolete,
    44     patch,
    44     patch,
    45     phases,
    45     phases,
    46     pycompat,
    46     pycompat,
    47     revset,
    47     revsetlang,
    48     scmutil,
    48     scmutil,
    49     server,
    49     server,
    50     sshserver,
    50     sshserver,
    51     streamclone,
    51     streamclone,
    52     templatekw,
    52     templatekw,
  3412 
  3412 
  3413     Returns 0 on success.
  3413     Returns 0 on success.
  3414 
  3414 
  3415     """
  3415     """
  3416     if opts.get('follow') and opts.get('rev'):
  3416     if opts.get('follow') and opts.get('rev'):
  3417         opts['rev'] = [revset.formatspec('reverse(::%lr)', opts.get('rev'))]
  3417         opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))]
  3418         del opts['follow']
  3418         del opts['follow']
  3419 
  3419 
  3420     if opts.get('graph'):
  3420     if opts.get('graph'):
  3421         return cmdutil.graphlog(ui, repo, *pats, **opts)
  3421         return cmdutil.graphlog(ui, repo, *pats, **opts)
  3422 
  3422 
  4091             raise error.Abort(_("specified revisions evaluate to an empty set"),
  4091             raise error.Abort(_("specified revisions evaluate to an empty set"),
  4092                              hint=_("use different revision arguments"))
  4092                              hint=_("use different revision arguments"))
  4093     elif path.pushrev:
  4093     elif path.pushrev:
  4094         # It doesn't make any sense to specify ancestor revisions. So limit
  4094         # It doesn't make any sense to specify ancestor revisions. So limit
  4095         # to DAG heads to make discovery simpler.
  4095         # to DAG heads to make discovery simpler.
  4096         expr = revset.formatspec('heads(%r)', path.pushrev)
  4096         expr = revsetlang.formatspec('heads(%r)', path.pushrev)
  4097         revs = scmutil.revrange(repo, [expr])
  4097         revs = scmutil.revrange(repo, [expr])
  4098         revs = [repo[rev].node() for rev in revs]
  4098         revs = [repo[rev].node() for rev in revs]
  4099         if not revs:
  4099         if not revs:
  4100             raise error.Abort(_('default push revset for path evaluates to an '
  4100             raise error.Abort(_('default push revset for path evaluates to an '
  4101                                 'empty set'))
  4101                                 'empty set'))