[PATCH 2 of 3 evolve-ext-V3] evolve: make prune respect allowunsable
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Jun 16 00:23:46 UTC 2015
On 06/15/2015 10:30 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432759785 25200
> # Wed May 27 13:49:45 2015 -0700
> # Node ID 344c3067174c08634e8564a1067028625c16b536
> # Parent c73aa260e157a1e5d534d3447d16664992a0e7a5
> evolve: make prune respect allowunsable
>
> Before this patch, the prune command was performing the same way regardless
> of the value of experimental.evolution.
> With this patch if the configuration does not allow unstability, prune won't
> create instability.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1923,6 +1923,14 @@
> if not precs:
> raise util.Abort('nothing to prune')
>
> + if not obsolete.isenabled(repo, obsolete.allowunstableopt):
> + repoheads = repo.changelog.headrevs()
> + pruneheads = repo.revs("heads(%ld)", precs)
> + # If a prune head is not a repo head then we will create
> + # unstability by operating on the midddle of the stack
> + if not all([h in repoheads for h in pruneheads]):
Actually, looking at it deeply, this check will fails in some case:
With:
1 - 2 - 3
\ 4
using: hg prune '2+3' will pass this test and still create unstability.
We want to check if anything like: '%ld:: - %ld' exists (if I'm correct)
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list