[PATCH] rebase: don't rebase obsolete commit whose successor is already rebased

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Sep 18 18:36:30 CDT 2015



On 09/17/2015 06:40 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1442277108 25200
> #      Mon Sep 14 17:31:48 2015 -0700
> # Node ID 9edbea23f78b19fb5cbb5b8e00f9c3aa8ecde617
> # Parent  836291420d535cae069acb3b671b980ac97bcce4
> rebase: don't rebase obsolete commit whose successor is already rebased
>
> This patch avoids unnecessary conflicts to resolve during rebase for the users
> of changeset evolution.
>
> This patch modifies rebase to skip obsolete commits if they are being rebased on
> their successors.
> It introduces a new rebase state 'revobsolete' for these revisions that are
> being skipped and a new message to inform the user of what is happening.
> This feature is gated behind the config flag experimental.rebaseskipobsolete

What is the current behavior in case of split and prune? Could we have 
an inline comment about that ?

> When an obsolete commit is skipped, the output is:
> not rebasing 14:9ad579b4a5de "I", already in destination as 17:fc37a630c901 "K"

That message apparently contains changeset description in it. This work 
well in the test where everything is one letter, but will behave badly 
in the wild when first line are usually 60 chars long. We should drop 
it. May I suggest:

note: skipping 14:9ad579b4a5de, successor 17:fc37a630c901 in destination

Otherwise the code looks like, I've some name bikesheding further down 
(that are smal nits that can be ignored)

> diff --git a/hgext/rebase.py b/hgext/rebase.py
> --- a/hgext/rebase.py
> +++ b/hgext/rebase.py
> @@ -26,6 +26,7 @@ import os, errno
>   revtodo = -1
>   nullmerge = -2
>   revignored = -3
> +revobsolete = -4

'revobsolete' is not entirely satisfactory, the fact a node is 
"obsolete" is not enough to get it skipped. something like revsuperseded 
or revprecursor would probably carry a better meaning.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list