[PATCH evolve-ext] split: reuse the pre-split commit message for the split ones

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Mar 22 15:00:10 EDT 2016



On 03/20/2016 03:18 PM, Jordi GutiƩrrez Hermoso wrote:
> # HG changeset patch
> # User Jordi GutiƩrrez Hermoso <jordigh at octave.org>
> # Date 1458511862 14400
> #      Sun Mar 20 18:11:02 2016 -0400
> # Node ID f3c32a01d13f8bf64d29a758c6deb6dc8ee90466
> # Parent  9bcb24c3ba8d2b5a7082ae61ac2193e867234822
> split: reuse the pre-split commit message for the split ones
>
> The original commit message is probably relevant in some way for the
> split commit messages. It is helpful for the user to have access to
> the pre-split commit message, so we provide the original commit
> message. This is more helpful than completely dropping the original
> commit message during a split.

I'm a bit confused here because I -already- see such behavior without 
your patch.

https://www.mercurial-scm.org/repo/evolve/file/9bcb24c3ba8d2b5a7082ae61ac2193e867234822/hgext/evolve.py#l2788

However that aspect seems to be untested, it would be great to add a test.

>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -2766,6 +2766,16 @@ def cmdsplit(ui, repo, *revs, **opts):
>           r = ctx.rev()
>           disallowunstable = not obsolete.isenabled(repo,
>                                                     obsolete.allowunstableopt)
> +
> +        # We'll re-use the same commit message for all split commits,
> +        # as it's a reasonable starting point for writing the commit
> +        # messages for each chunk.
> +        opts['message'] = (
> +            "HG: This is the original pre-split commit message. "
> +            "Edit it as appropriate.\n\n%s"
> +        ) % ctx.description()
> +        opts['edit'] = True
> +
>           if disallowunstable:
>               # XXX We should check head revs
>               if repo.revs("(%d::) - %d", rev, rev):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list