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

Alexander Drozdov al.drozdov at gmail.com
Wed Apr 16 23:28:04 CDT 2014


15.04.2014 20:00, Matt Mackall wrote:
> On Tue, 2014-04-15 at 09:56 +0400, Alexander Drozdov wrote:
>> 15.04.2014 04:51, Siddharth Agarwal wrote:
>>> On 04/14/2014 05:46 PM, Siddharth Agarwal wrote:
>>>> On 03/31/2014 08:24 PM, 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
>>>>>
>>>>>   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.
>>>> Why is this an actual issue?
>>> Ah, I misread the patch. This isn't coming from some sort of privacy perspective.
>>>
>>> Honestly, I'm not really a fan of adding command-line options willy-nilly, Git style. How about: check whether the source exists in the repository (and if it is public, perhaps?), and use it if it does, or drop it if it doesn't.
>> In project I'm working on, we have multiple public repositories: one is 'official', others is for temporary/experimental features. From my local repository I can push or pull to or from any of the repositories. So, the source is always present in my local repository and is often public.
>>
>> BTW, I don't understand why it was needed to make dc9fb7015d7f change at all. Without the change, it was possible to check 'graft history'
>> by just walking through 'source' chain. In my project, there are many long-lived 'supported' branches, and graft often lead to merge conflicts.
>> So the earliest source changeset is often differs from graft ones, and may be changed up to two or three times times while grafting. I would like to see the most recent source in the changeset.
>>
>> Maybe just add an option to hgrc? Actualy, I want this option to be always enabled for me.
> Here is the original discussion of this feature:
>
> http://mercurial.markmail.org/thread/alax3vpc55n4e5te
>
> Right now this behavior is tied up with the origin and destination
> revsets, so this discussion primarily needs to be about how those are
> affected. I'd prefer not to have an option here and instead focus on
> whether the current behavior is sensible and whether anything can be
> done to fix it.
origin revset now works fine for transplanted and grafted changesets.
destination revset works for transplanted changesets but doesn't work for grafted changesets:
the behavior is documented in tests/test-graft.t (see "grafts of grafts unfortunately can't").
But it is still possible to see all the copies of the changeset: 'origin(cset) or destination(origin(cset))'
To make destination revset to work with grafted changesets, I think dc9fb7015d7f code should be
backed out and some tests should be fixed.

BTW, destination(anyrev) is rather slow (~2 sec on my not so old machine, on mercurial repository).


More information about the Mercurial-devel mailing list