Patchwork D2753: graft: check for missing revision first before scanning working copy

login
register
mail settings
Submitter phabricator
Date March 9, 2018, 2:58 p.m.
Message ID <differential-rev-PHID-DREV-36gbztm7fle5mr7kw4ex-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29175/
State Superseded
Headers show

Comments

phabricator - March 9, 2018, 2:58 p.m.
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2753

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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()