diff mercurial/commands.py @ 26286:4b685712fa45

bookmark: do not crash when active bookmark is forward and --date is used The logic that decides where to update according to the active bookmark location (when not on ".") was setting the rev to update to before we process --date. This lead to --date processing aborting because of duplicated specification. We reorder the two pieces of code and add a test for this.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 17 Sep 2015 16:08:10 -0700
parents 69da16b366ad
children 5ba3358ebc7f
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Sep 17 17:17:54 2015 -0700
+++ b/mercurial/commands.py	Thu Sep 17 16:08:10 2015 -0700
@@ -6480,6 +6480,11 @@
     try:
         cmdutil.clearunfinished(repo)
 
+        if date:
+            if rev is not None:
+                raise util.Abort(_("you can't specify a revision and a date"))
+            rev = cmdutil.finddate(ui, repo, date)
+
         # with no argument, we also move the active bookmark, if any
         rev, movemarkfrom = bookmarks.calculateupdate(ui, repo, rev)
 
@@ -6490,11 +6495,6 @@
         if check and clean:
             raise util.Abort(_("cannot specify both -c/--check and -C/--clean"))
 
-        if date:
-            if rev is not None:
-                raise util.Abort(_("you can't specify a revision and a date"))
-            rev = cmdutil.finddate(ui, repo, date)
-
         if check:
             cmdutil.bailifchanged(repo, merge=False)
             if rev is None: