--- 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