revert: use opts.get
If you want to programatically perform a revert right now you need to
include a date=False parameter due to the use of opt["date"] instead
of opt.get("date").
--- a/mercurial/commands.py Tue Aug 17 08:38:31 2010 +0530
+++ b/mercurial/commands.py Fri Aug 13 13:59:26 2010 -0400
@@ -3066,8 +3066,8 @@
Returns 0 on success.
"""
- if opts["date"]:
- if opts["rev"]:
+ if opts.get("date"):
+ if opts.get("rev"):
raise util.Abort(_("you can't specify a revision and a date"))
opts["rev"] = cmdutil.finddate(ui, repo, opts["date"])