changeset 28032:8157c6b82f40

update: check command line before modifying repo A failed command should not have any effect on the repo.
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 07 Feb 2016 22:18:24 -0800
parents 6f248ba85309
children 0707bbec682d
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Feb 07 21:44:38 2016 -0800
+++ b/mercurial/commands.py	Sun Feb 07 22:18:24 2016 -0800
@@ -6959,24 +6959,24 @@
     if rev is None or rev == '':
         rev = node
 
+    if date and rev is not None:
+        raise error.Abort(_("you can't specify a revision and a date"))
+
+    if check and clean:
+        raise error.Abort(_("cannot specify both -c/--check and -C/--clean"))
+
     warndest = False
 
     with repo.wlock():
         cmdutil.clearunfinished(repo)
 
         if date:
-            if rev is not None:
-                raise error.Abort(_("you can't specify a revision and a date"))
             rev = cmdutil.finddate(ui, repo, date)
 
         # if we defined a bookmark, we have to remember the original name
         brev = rev
         rev = scmutil.revsingle(repo, rev, rev).rev()
 
-        if check and clean:
-            raise error.Abort(_("cannot specify both -c/--check and -C/--clean")
-                             )
-
         if check:
             cmdutil.bailifchanged(repo, merge=False)
         if rev is None: