[PATCH 2 of 2] commit: commit should ignore secret heads for "new heads" warning (issue5017)
Laurent Charignon
lcharignon at fb.com
Sat Dec 26 21:45:23 CST 2015
On 12/26/15, 5:32 AM, "Yuya Nishihara" <youjah at gmail.com on behalf of
yuya at tcha.org> wrote:
>On Wed, 23 Dec 2015 11:07:31 -0800, Laurent Charignon wrote:
>> # HG changeset patch
>> # User Laurent Charignon <lcharignon at fb.com>
>> # Date 1450897516 28800
>> # Wed Dec 23 11:05:16 2015 -0800
>> # Node ID 9954c27e3d395aad2896e88023fcfbce049eb617
>> # Parent 1721c112f0194a078103b3b673de236b5cd5cd52
>> commit: commit should ignore secret heads for "new heads" warning
>>(issue5017)
>>
>> The warning exists to keep people from having multi-headed push trouble
>>but
>> since secret commits are not pushed we don't need to display this
>>warning.
>>
>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>> --- a/mercurial/cmdutil.py
>> +++ b/mercurial/cmdutil.py
>> @@ -2807,7 +2807,8 @@
>> parents = ctx.parents()
>>
>> if (not opts.get('amend') and bheads and node not in bheads and not
>> - [x for x in parents if x.node() in bheads and x.branch() ==
>>branch]):
>> + [x for x in parents if x.node() in bheads and x.branch() ==
>>branch]
>> + and not ctx.secret()):
>
>I think this change is also good, but is different from the issue5017. It
>says
>"bheads" should ignore existing secret revisions.
Yes, you are right this isn't exactly the same thing, good catch!
I will add a patch to this series and fix the commit messages.
Thanks,
Laurent
>
> 0(draft)---1(secret)
> \
> -------------------2(draft)
> new commit 2 shouldn't say "created new head" because 1 is secret
> therefore non-secret bheads are {0}.
More information about the Mercurial-devel
mailing list