[PATCH 2 of 2 stable?] rebase: prioritize indicating an interrupted rebase over update (issue5838)
Yuya Nishihara
yuya at tcha.org
Sat Jun 2 23:24:50 EDT 2018
On Sat, 02 Jun 2018 17:31:11 -0400, Matt Harbison wrote:
> # 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'")])
It seems a bit awkward to rely on extensions for the message priority. Maybe
we can instead check the un-clearable states first? IIUC, only one un-clearable
state should exist as it should block any other operations.
More information about the Mercurial-devel
mailing list