[PATCH 1 of 2] rebase: preserve the 'intermediate-source' attribute of grafts

Yuya Nishihara yuya at tcha.org
Wed Nov 11 08:16:42 CST 2015


On Sun, 08 Nov 2015 18:48:44 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1447023408 18000
> #      Sun Nov 08 17:56:48 2015 -0500
> # Node ID 0647a6905581d40d3b9bd27a8438aa54842d49dd
> # Parent  f9984f76fd90e439221425d751e29bae17bec995
> rebase: preserve the 'intermediate-source' attribute of grafts
> 
> Preserving the 'source' attribute of grafts started with a69a77a80900, which
> predates the introduction of 'intermediate-source' in 51930a7180bd by a year and
> a half.  It looks like not preserving this was an oversight.
> 
> On a related note, notice how the source value of 32af76 is no longer visible in
> the graph above this test.  Is it reasonable to import the sha1 translation from
> evolve.py:relocate() into scmutil or similar, and use that to fixup these
> attributes as well as the commit message?  (I realize that evolve is still
> experimental, but I don't see a way to do this from the evolve extension.)
> 
> diff --git a/hgext/rebase.py b/hgext/rebase.py
> --- a/hgext/rebase.py
> +++ b/hgext/rebase.py
> @@ -48,6 +48,9 @@
>      s = ctx.extra().get('source', None)
>      if s is not None:
>          extra['source'] = s
> +    s = ctx.extra().get('intermediate-source', None)
> +    if s is not None:
> +        extra['intermediate-source'] = s

This seems good, but I'm not certain because 51930a7180bd says that the
intermediate-source was introduced to change the hash of the grafted revision.
For this purpose, rebase_source is enough.


More information about the Mercurial-devel mailing list