rebase: make "successors" a set in _computeobsoletenotrebased()
authorDenis Laxalde <denis@laxalde.org>
Sat, 10 Feb 2018 19:33:19 +0100
changeset 36036 24f05489377b
parent 36035 de0666564bde
child 36037 dce43aaaf209
rebase: make "successors" a set in _computeobsoletenotrebased() There's no apparent reason for this variable to be a list and this avoids converting it to a set when needed.
hgext/rebase.py
--- a/hgext/rebase.py	Sat Feb 10 21:14:41 2018 +0900
+++ b/hgext/rebase.py	Sat Feb 10 19:33:19 2018 +0100
@@ -1805,10 +1805,10 @@
         srcnode = cl.node(srcrev)
         destnode = cl.node(destmap[srcrev])
         # XXX: more advanced APIs are required to handle split correctly
-        successors = list(obsutil.allsuccessors(repo.obsstore, [srcnode]))
+        successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode]))
         # obsutil.allsuccessors includes node itself
         successors.remove(srcnode)
-        if set(successors).issubset(extinctnodes):
+        if successors.issubset(extinctnodes):
             # all successors are extinct
             obsoleteextinctsuccessors.add(srcrev)
         if not successors: