Patchwork [4,of,5,v2] histedit: suggest the correct tool to continue (not histedit)

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 7, 2016, 7:57 a.m.
Message ID <80d58999b7343efe3cc9.1454831859@waste.org>
Download mbox | patch
Permalink /patch/13031/
State Superseded
Commit 6c1b7f80f90f7599495948380c4361ce14e51bc8
Headers show

Comments

timeless@mozdev.org - Feb. 7, 2016, 7:57 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454557620 0
#      Thu Feb 04 03:47:00 2016 +0000
# Node ID 80d58999b7343efe3cc9b0ab90d402f400ec35fc
# Parent  edf2e3fb9181ae830977428515e8e36246a42b5e
histedit: suggest the correct tool to continue (not histedit)

Suggest committing (or whatever the current activity is), via
wrongtooltocontinue which uses howtocontinue.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -279,7 +279,8 @@ 
         except IOError as err:
             if err.errno != errno.ENOENT:
                 raise
-            raise error.Abort(_('no histedit in progress'))
+            cmdutil.wrongtooltocontinue(self.repo,
+                _('no histedit in progress'))
 
         if state.startswith('v1\n'):
             data = self._load()
diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -44,9 +44,12 @@ 
 histedit --continue/--abort with no existing state
 --------------------------------------------------
 
+  $ hg rm -q alpha
   $ hg histedit --continue
   abort: no histedit in progress
+  (continue: hg commit)
   [255]
+  $ hg revert -r . -q alpha
   $ hg histedit --abort
   abort: no histedit in progress
   [255]
@@ -133,6 +136,11 @@ 
   (hg histedit --continue to resume)
   [1]
 
+  $ hg graft --continue
+  abort: no graft state found, can't continue
+  (continue: hg histedit --continue)
+  [255]
+
   $ mv .hg/histedit-state .hg/histedit-state.back
   $ hg update --quiet --clean 2
   $ echo alpha >> alpha