Patchwork [3,of,5,v3] rebase: suggest the correct tool to continue (not rebase)

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 12, 2016, 7:03 p.m.
Message ID <edf2e3fb9181ae830977.1455303819@waste.org>
Download mbox | patch
Permalink /patch/13146/
State Superseded
Headers show

Comments

timeless@mozdev.org - Feb. 12, 2016, 7:03 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454557598 0
#      Thu Feb 04 03:46:38 2016 +0000
# Node ID edf2e3fb9181ae830977428515e8e36246a42b5e
# Parent  6573cdf318d3aa45e2cd4db738d6071aadb411a5
rebase: suggest the correct tool to continue (not rebase)

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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -915,7 +915,7 @@ 
     except IOError as err:
         if err.errno != errno.ENOENT:
             raise
-        raise error.Abort(_('no rebase in progress'))
+        cmdutil.wrongtooltocontinue(repo, _('no rebase in progress'))
 
     if keepbranches is None:
         raise error.Abort(_('.hg/rebasestate is incomplete'))
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -56,9 +56,12 @@ 
   
 Try to call --continue:
 
+  $ hg rm -q extra
   $ hg rebase --continue
   abort: no rebase in progress
+  (continue: hg commit)
   [255]
+  $ hg revert -r . -q extra
 
 Conflicting rebase:
 
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -495,6 +495,10 @@ 
   $ hg resolve -m c2
   (no more unresolved files)
   continue: hg rebase --continue
+  $ hg graft --continue
+  abort: no graft state found, can't continue
+  (continue: hg rebase --continue)
+  [255]
   $ hg rebase -c --tool internal:fail
   rebasing 2:e4e3f3546619 "c2b" (tip)
   note: rebase of 2:e4e3f3546619 created no changes to commit