[PATCH 2 of 2] commit: commit should ignore secret heads for "new heads" warning (issue5017)

Gilles Moris gilles.moris at free.fr
Thu Dec 24 10:56:54 CST 2015



Le 23/12/2015 20:07, Laurent Charignon a écrit :
> # 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()):
May be secret should be tested first to allow an early test exit.

Regards.
Gilles.


More information about the Mercurial-devel mailing list