changeset 2781:78b0c6053139

precheck: also check for unstability creation
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 23 Jul 2017 19:37:29 +0200
parents 58e4b51ee902
children 2bd0b0996cfb
files hgext3rd/evolve/rewriteutil.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):