WIP: rotate loop draft
authorManuel Jacob <me@manueljacob.de>
Thu, 12 Mar 2020 03:13:17 +0100
changeset 5260 68d8c0cc08c4
parent 5259 475af29bc602
child 5261 df8dc1963ceb
WIP: rotate loop
hgext3rd/evolve/utility.py
--- a/hgext3rd/evolve/utility.py	Thu Mar 12 06:18:44 2020 +0100
+++ b/hgext3rd/evolve/utility.py	Thu Mar 12 03:13:17 2020 +0100
@@ -112,14 +112,15 @@
         return p.rev()
     obs = repo[p]
     ui = repo.ui
-    newer = obsutil.successorssets(repo, obs.node())
     # search of a parent which is not killed
-    while not newer:
+    while True:
+        newer = obsutil.successorssets(repo, obs.node())
+        if newer:
+            break
         ui.debug(b"stabilize target %s is plain dead,"
                  b" trying to stabilize on its parent\n" %
                  obs)
         obs = obs.p1()
-        newer = obsutil.successorssets(repo, obs.node())
     if len(newer) > 1 or len(newer[0]) > 1:
         raise MultipleSuccessorsError(newer)