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

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 4, 2016, 3:56 a.m.
Message ID <1586929e0a93cd4e3f75.1454558183@waste.org>
Download mbox | patch
Permalink /patch/12973/
State Superseded
Commit 6c1b7f80f90f7599495948380c4361ce14e51bc8
Headers show

Comments

timeless@mozdev.org - Feb. 4, 2016, 3:56 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454557620 0
#      Thu Feb 04 03:47:00 2016 +0000
# Node ID 1586929e0a93cd4e3f75ad1fb5182cf3684feeeb
# Parent  d577b5731cdd4b8af7be8ff32905dff807e5b9a8
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]