[PATCH 2 of 5 v4] graft: suggest the correct tool to continue (not graft)

timeless timeless at mozdev.org
Fri Feb 12 15:54:10 EST 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1454557544 0
#      Thu Feb 04 03:45:44 2016 +0000
# Node ID 3f9f1a901281a14ac336d340bc597485629a4daa
# Parent  f66f87ca38782cb9ff6619309f5aa1687be0b5df
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.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3928,7 +3928,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)
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -40,6 +40,13 @@
   |
   o  test at 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:
 


More information about the Mercurial-devel mailing list