[PATCH 2 of 2 stable?] rebase: prioritize indicating an interrupted rebase over update (issue5838)
Matt Harbison
mharbison72 at gmail.com
Sat Jun 2 17:31:11 EDT 2018
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1527961484 14400
# Sat Jun 02 13:44:44 2018 -0400
# Node ID a6a6ed205155b94a2812f8e0b5118eff70b45ae8
# Parent b0cf640005f21de6ce2933bb28ae2ac012fece45
rebase: prioritize indicating an interrupted rebase over update (issue5838)
Based on this fix, it looks like transplant will have the same issue. I don't
know of any other non-core stateful operations that also have an update state.
Should there be a core function to register these, so it always prepends to the
list?
The reason for the inconsistent messaging is that the `hg rebase` path calls
cmdutil.checkunfinished(), and the update path calls cmdutil.clearunfinished().
The latter processes non-clearable states (i.e. rebase) first. Since there is
no 'update' entry to cmdutil.afterresolvedstates, that should be fine in any
order.
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1851,7 +1851,7 @@ def uisetup(ui):
entry[1].append(('t', 'tool', '',
_("specify merge tool for rebase")))
cmdutil.summaryhooks.add('rebase', summaryhook)
- cmdutil.unfinishedstates.append(
+ cmdutil.unfinishedstates.insert(0,
['rebasestate', False, False, _('rebase in progress'),
_("use 'hg rebase --continue' or 'hg rebase --abort'")])
cmdutil.afterresolvedstates.append(
diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t
--- a/tests/test-rebase-abort.t
+++ b/tests/test-rebase-abort.t
@@ -387,10 +387,9 @@ New operations are blocked with the corr
.hg/undo.dirstate
.hg/updatestate
-XXX: This should complain about needing to abort/continue rebase
$ hg rebase -s 3 -d tip
- abort: last update was interrupted
- (use 'hg update' to get a consistent checkout)
+ abort: rebase in progress
+ (use 'hg rebase --continue' or 'hg rebase --abort')
[255]
$ hg up .
abort: rebase in progress
@@ -401,10 +400,9 @@ XXX: This should complain about needing
(use 'hg rebase --continue' or 'hg rebase --abort')
[255]
-XXX: This should complain about needing to abort/continue rebase
$ hg graft 3
- abort: last update was interrupted
- (use 'hg update' to get a consistent checkout)
+ abort: rebase in progress
+ (use 'hg rebase --continue' or 'hg rebase --abort')
[255]
$ hg rebase --abort
More information about the Mercurial-devel
mailing list