evolve: remove a check which is already done by rewriteutil.precheck()
authorSushil khanchi <sushilkhanchi97@gmail.com>
Mon, 04 Nov 2019 00:18:55 +0530
changeset 5083 e50f4fc6cc6d
parent 5079 1f92a6aa40d6
child 5111 1fe3f7ffb462
child 5242 a6434bdfb387
child 5250 265f30e3c50d
evolve: remove a check which is already done by rewriteutil.precheck() We have tests to check if fold is being performed on public cset. There is no changes in test files because testing that never touched the part this patch removes, and already caught in rewriteutil.precheck()
hgext3rd/evolve/rewriteutil.py
--- a/hgext3rd/evolve/rewriteutil.py	Mon Nov 04 01:30:50 2019 +0530
+++ b/hgext3rd/evolve/rewriteutil.py	Mon Nov 04 00:18:55 2019 +0530
@@ -22,7 +22,6 @@
     node,
     obsolete,
     obsutil,
-    phases,
     revset,
     util,
 )
@@ -139,9 +138,6 @@
     if len(roots) > 1:
         raise error.Abort(_(b"cannot fold non-linear revisions "
                             b"(multiple roots given)"))
-    root = repo[roots.first()]
-    if root.phase() <= phases.public:
-        raise error.Abort(_(b"cannot fold public revisions"))
     heads = repo.revs(b'heads(%ld)', revs)
     if len(heads) > 1:
         raise error.Abort(_(b"cannot fold non-linear revisions "
@@ -158,6 +154,7 @@
             hint = _(b'set experimental.evolution.allowdivergence=yes'
                      b' to allow folding them')
             raise error.Abort(msg, hint=hint)
+    root = repo[roots.first()]
     # root's p1 is already used as the target ctx p1
     baseparents -= {root.p1().rev()}
     p2 = repo[baseparents.first()]