graft: suggest the correct tool to continue (not graft)
authortimeless <timeless@mozdev.org>
Thu, 04 Feb 2016 03:45:44 +0000
changeset 28121 bd97ed121016
parent 28120 ed4d06f180b8
child 28122 6025ddb4e649
graft: suggest the correct tool to continue (not graft) Add test coverage for graft --continue without starting. Suggest committing (or whatever the current activity is), via wrongtooltocontinue which uses howtocontinue.
mercurial/commands.py
tests/test-graft.t
--- a/mercurial/commands.py	Sun Feb 14 16:16:17 2016 +0000
+++ b/mercurial/commands.py	Thu Feb 04 03:45:44 2016 +0000
@@ -3933,7 +3933,7 @@
         except IOError as inst:
             if inst.errno != errno.ENOENT:
                 raise
-            raise error.Abort(_("no graft state found, can't continue"))
+            cmdutil.wrongtooltocontinue(repo, _('graft'))
     else:
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
--- a/tests/test-graft.t	Sun Feb 14 16:16:17 2016 +0000
+++ b/tests/test-graft.t	Thu Feb 04 03:45:44 2016 +0000
@@ -46,6 +46,13 @@
   |
   o  test@0.public: 0
   
+Can't continue without starting:
+
+  $ hg rm -q e
+  $ hg graft --continue
+  abort: no graft in progress
+  [255]
+  $ hg revert -r . -q e
 
 Need to specify a rev: