utility: deal with having multiple draft default
authorRodrigo Damazio Bovendorp <rdamazio@google.com>
Thu, 07 May 2020 19:47:59 -0700
changeset 5352 10368b3427b1
parent 5351 34c8aa32bc56
utility: deal with having multiple When a revision has multiple prune obsolescence markers, it's thought to be a split, and the way we try to deal with splits currently crashes.
hgext3rd/evolve/utility.py
--- a/hgext3rd/evolve/utility.py	Sun May 03 15:39:56 2020 +0800
+++ b/hgext3rd/evolve/utility.py	Thu May 07 19:47:59 2020 -0700
@@ -137,7 +137,10 @@
     topological branches and user didn't choose any evolve destination,
     in which case return (False, '.')
     """
-    targets = obsutil.successorssets(repo, ctx.node())[0]
+    succs = obsutil.successorssets(repo, ctx.node())
+    if not succs:
+        return (False, '.')
+    targets = succs[0]
     assert targets
     targetrevs = [repo[r].rev() for r in targets]
     heads = repo.revs(b'heads(%ld::%ld)', targetrevs, targetrevs)