revert: use opts.get
authorXavier Snelgrove <xs@wxs.ca>
Fri, 13 Aug 2010 13:59:26 -0400
changeset 11941 4532c44bb62d
parent 11940 106311e7740f
child 11942 50a4e55aa278
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").
mercurial/commands.py
--- 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"])