hgext/evolve.py
changeset 1364 f00d91365ab9
parent 1361 043e5ca9322f
child 1369 4ed67cce8c23
--- 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