hgext/evolve.py
changeset 1398 7ddcbf5469bc
parent 1397 35f2f54b557c
child 1402 08ae023882f1
--- a/hgext/evolve.py	Fri Jun 19 11:03:51 2015 -0700
+++ b/hgext/evolve.py	Fri Jun 19 11:04:18 2015 -0700
@@ -2445,6 +2445,11 @@
         raise util.Abort(_("cannot fold non-linear revisions "
                            "(multiple heads given)"))
     head = repo[heads.first()]
+    disallowunstable = not obsolete.isenabled(repo, obsolete.allowunstableopt)
+    if disallowunstable:
+        if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0:
+            raise util.Abort(_("cannot fold chain not ending with a head "\
+                               "or with branching"))
     wlock = lock = None
     try:
         wlock = repo.wlock()