[PATCH] graft: allow to not preserve original source in subsequent grafts

Alexander Drozdov al.drozdov at gmail.com
Sun Apr 13 08:19:59 CDT 2014


On 13.04.2014 17:13:38, Augie Fackler <raf at durin42.com> wrote:
> On Tue, Apr 01, 2014 at 07:24:38AM +0400, Alexander Drozdov wrote:
>> # HG changeset patch
>> # User Alexander Drozdov <al.drozdov at gmail.com>
>> # Date 1393909791 -14400
>> #      Tue Mar 04 09:09:51 2014 +0400
>> # Node ID e7b0eaf7bbbd35d5cc0b1415014749d4b8e533d0
>> # Parent  8a6a86c9a5b58ccc020de1ff0429e72dfa5599fc
>> graft: allow to not preserve original source in subsequent grafts
> Feature seems mostly reasonable to me, but the flag name is completely
> baffling. Maybe it could be something like
>
> --no-record-source?
>
> Other people will probably have better naming proposals than I will.
Maybe --no-follow-source ? The patch don't disable source recording.

>
>>  From dc9fb7015d7f, graft preserves original source when grafting
>> changeset that was grafted from another branch.
>>
>> That may be undesirable in some situations. For example, the first
>> graft may be from user's private branch, so the source changeset may
>> not be present in a public repository.
>>
>> This changeset adds -S (--currentsource) option to always refer to
>> grafted changeset as a source revision.
>>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -3036,6 +3036,8 @@
>>        ('', 'log', None, _('append graft info to log message')),
>>        ('D', 'currentdate', False,
>>         _('record the current date as commit date')),
>> +     ('S', 'currentsource', False,
>> +      _('do not refer to original source for subsequent graft')),
>>        ('U', 'currentuser', False,
>>         _('record the current user as committer'), _('DATE'))]
>>       + commitopts2 + mergetoolopts  + dryrunopts,
>> @@ -3181,7 +3183,9 @@
>>               if opts.get('dry_run'):
>>                   continue
>>
>> -            source = ctx.extra().get('source')
>> +            source = None
>> +            if not opts.get('currentsource'):
>> +                source = ctx.extra().get('source')
>>               if not source:
>>                   source = ctx.hex()
>>               extra = {'source': source}
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel




More information about the Mercurial-devel mailing list