[PATCH 2 of 3] graft: preserve original source in subsequent grafts

Stefano Tortarolo stefano.tortarolo at gmail.com
Mon Nov 14 15:06:20 CST 2011


2011/11/14 Mads Kiilerich <mads at kiilerich.com>

> On 11/14/2011 08:20 PM, Stefano Tortarolo wrote:
>
>>
>> 2011/11/12 Mads Kiilerich <mads at kiilerich.com <mailto:mads at kiilerich.com
>> >>
>>
>>
>>    Stefano Tortarolo wrote, On 11/12/2011 02:05 PM:
>>
>>        # HG changeset patch
>>        # User Stefano Tortarolo<stefano.tortarolo at __**gmail.com<http://gmail.com>
>>        <mailto:stefano.tortarolo@**gmail.com<stefano.tortarolo at gmail.com>
>> >>
>>        # Date 1321100140 -3600
>>        # Node ID b7644d5507d26bc84c8d171d4a6a13**__883021b2d3
>>        # Parent  211d35717f64f723be889a6016c529**__d244f702ef
>>
>>        graft: preserve original source in subsequent grafts
>>
>>        diff --git a/mercurial/commands.py b/mercurial/commands.py
>>        --- a/mercurial/commands.py
>>        +++ b/mercurial/commands.py
>>        @@ -2613,7 +2613,10 @@
>>                      cont = False
>>
>>                  # commit
>>        -        extra = {'source': ctx.hex()}
>>        +        source = ctx.extra().get('source')
>>        +        if not source:
>>        +            source = ctx.hex()
>>        +        extra = {'source': source}
>>                  user = ctx.user()
>>                  if opts.get('user'):
>>                      user = opts['user']
>>
>>
>>    (For reference, Matt said
>>
>>        A closely related question is what 'source' to set for a graft of a
>>        graft. We should probably copy the original source.
>>
>>    )
>>
>>    It is hard to tell which of the previous identities that is most
>>    important, so wouldn't it be better to preserve all of them?
>>
>>    Changing 'source' to a list would be slightly incompatible with 2.0,
>>    but that might be acceptable considering the impact.
>>
>>
>> Yes, I'll resend a new series in a few minutes, but I'd change 'source'
>> in 'sources'.
>>
>
> Thanks for listening, but I think I was wrong. It is not so hard.
>
> The way you implemented it here the first node id will be a kind of
> changeset identifier that is preserved no matter how many times it is
> grafted, and there is thus no reason to care about any intermediate grafts.
>
>
Yes, that was the idea.
However, if we record every intermediate graft we're able to track every
single operation and it might be easier to compare csets.

That said, I'd like to know what Matt thinks of the two series.

Honestly I haven't any particular preference:
- storing just the first reference is simpler and cleaner but we might lose
some useful info
- storing everything might be a little too much conservative, but maybe
someone will come up with some interesting usage

Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111114/c35975af/attachment.html>


More information about the Mercurial-devel mailing list