mercurial/commands.py
changeset 35147 3da4bd50103d
parent 35128 fd8b6b183073
child 35163 ee64e677c3cf
equal deleted inserted replaced
35146:0b5716ec8500 35147:3da4bd50103d
  4558     earlier changeset.
  4558     earlier changeset.
  4559 
  4559 
  4560     Returns 0 on success.
  4560     Returns 0 on success.
  4561     """
  4561     """
  4562 
  4562 
       
  4563     opts = pycompat.byteskwargs(opts)
  4563     if opts.get("date"):
  4564     if opts.get("date"):
  4564         if opts.get("rev"):
  4565         if opts.get("rev"):
  4565             raise error.Abort(_("you can't specify a revision and a date"))
  4566             raise error.Abort(_("you can't specify a revision and a date"))
  4566         opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
  4567         opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])
  4567 
  4568 
  4593             hint = _("uncommitted changes, use --all to discard all changes")
  4594             hint = _("uncommitted changes, use --all to discard all changes")
  4594         else:
  4595         else:
  4595             hint = _("use --all to revert all files")
  4596             hint = _("use --all to revert all files")
  4596         raise error.Abort(msg, hint=hint)
  4597         raise error.Abort(msg, hint=hint)
  4597 
  4598 
  4598     return cmdutil.revert(ui, repo, ctx, (parent, p2), *pats, **opts)
  4599     return cmdutil.revert(ui, repo, ctx, (parent, p2), *pats,
       
  4600                           **pycompat.strkwargs(opts))
  4599 
  4601 
  4600 @command('rollback', dryrunopts +
  4602 @command('rollback', dryrunopts +
  4601          [('f', 'force', False, _('ignore safety measures'))])
  4603          [('f', 'force', False, _('ignore safety measures'))])
  4602 def rollback(ui, repo, **opts):
  4604 def rollback(ui, repo, **opts):
  4603     """roll back the last transaction (DANGEROUS) (DEPRECATED)
  4605     """roll back the last transaction (DANGEROUS) (DEPRECATED)