precheck: also check for unstability creation
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 23 Jul 2017 19:37:29 +0200
changeset 2781 78b0c6053139
parent 2780 58e4b51ee902
child 2782 2bd0b0996cfb
precheck: also check for unstability creation
hgext3rd/evolve/rewriteutil.py
--- a/hgext3rd/evolve/rewriteutil.py	Mon Jul 24 03:04:20 2017 +0200
+++ b/hgext3rd/evolve/rewriteutil.py	Sun Jul 23 19:37:29 2017 +0200
@@ -66,6 +66,11 @@
         msg = _("cannot %s public changesets: %s") % (action, summary)
         hint = _("see 'hg help phases' for details")
         raise error.Abort(msg, hint=hint)
+    newunstable = disallowednewunstable(repo, revs)
+    if newunstable:
+        msg = _("cannot fold chain not ending with a head or with branching")
+        hint = _("new unstable changesets are not allowed")
+        raise error.Abort(msg, hint=hint)
 
 def bookmarksupdater(repo, oldid, tr):
     """Return a callable update(newid) updating the current bookmark
@@ -103,10 +108,6 @@
         raise error.Abort(_("cannot fold non-linear revisions "
                             "(multiple heads given)"))
     head = repo[heads.first()]
-    if disallowednewunstable(repo, revs):
-        msg = _("cannot fold chain not ending with a head or with branching")
-        hint = _("new unstable changesets are not allowed")
-        raise error.Abort(msg, hint=hint)
     return root, head
 
 def deletebookmark(repo, repomarks, bookmarks):