graft: check for missing revision first before scanning working copy
authorJoerg Sonnenberger <joerg@bec.de>
Fri, 09 Mar 2018 15:57:16 +0100
changeset 36842 ff541b8cdee0
parent 36841 9c636ec1ef37
child 36843 31581528f242
graft: check for missing revision first before scanning working copy Differential Revision: https://phab.mercurial-scm.org/D2753
mercurial/commands.py
--- a/mercurial/commands.py	Sat Mar 10 22:02:58 2018 -0500
+++ b/mercurial/commands.py	Fri Mar 09 15:57:16 2018 +0100
@@ -2181,10 +2181,10 @@
                 raise
             cmdutil.wrongtooltocontinue(repo, _('graft'))
     else:
+        if not revs:
+            raise error.Abort(_('no revisions specified'))
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
-        if not revs:
-            raise error.Abort(_('no revisions specified'))
         revs = scmutil.revrange(repo, revs)
 
     skipped = set()