Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 1397:35f2f54b557c
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.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 19 Jun 2015 11:03:51 -0700 |
parents | ba95cec18fe9 |
children | 7ddcbf5469bc |
line wrap: on
line diff
--- a/hgext/evolve.py Fri Jun 19 10:47:02 2015 -0700 +++ b/hgext/evolve.py Fri Jun 19 11:03:51 2015 -0700 @@ -1950,6 +1950,10 @@ if not precs: raise util.Abort('nothing to prune') + if not obsolete.isenabled(repo, obsolete.allowunstableopt): + if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0: + raise util.Abort(_("cannot prune in the middle of a stack")) + # defines successors changesets sucs = scmutil.revrange(repo, succs) sucs.sort()