Mercurial > public > mercurial-scm > evolve
diff hgext/evolve.py @ 1364:f00d91365ab9
evolve: make uncommit respect allowunsable
Before this patch, the uncommit command was performing the same way regardless
of the value of experimental.evolution.
With this patch if the configuration does not allow unstability, uncommit won't
create instability.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Wed, 20 May 2015 12:46:13 -0700 |
parents | 043e5ca9322f |
children | 4ed67cce8c23 |
line wrap: on
line diff
--- a/hgext/evolve.py Sat Jun 13 11:14:07 2015 -0700 +++ b/hgext/evolve.py Wed May 20 12:46:13 2015 -0700 @@ -2209,6 +2209,11 @@ if ctx.p1() == rev or ctx.p2() == rev: raise util.Abort(_("cannot uncommit to parent changeset")) + onahead = old.rev() in repo.changelog.headrevs() + disallowunstable = not obsolete.isenabled(repo, obsolete.allowunstableopt) + if disallowunstable and not onahead: + raise util.Abort(_("cannot uncommit in the middle of a stack")) + # Recommit the filtered changeset tr = repo.transaction('uncommit') newid = None