rebase: use revnums (not nodes) for set of extinct revisions
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 11 Jul 2018 15:12:01 -0700
changeset 38673 20a30bb8f276
parent 38672 0f8599afb92f
child 38674 a50482254b0a
rebase: use revnums (not nodes) for set of extinct revisions There is no need to convert extinct revisions to nodeids. Differential Revision: https://phab.mercurial-scm.org/D3942
hgext/rebase.py
--- a/hgext/rebase.py	Wed Jul 11 15:01:47 2018 -0700
+++ b/hgext/rebase.py	Wed Jul 11 15:12:01 2018 -0700
@@ -1855,14 +1855,15 @@
     assert repo.filtername is None
     cl = repo.changelog
     nodemap = cl.nodemap
-    extinctnodes = set(cl.node(r) for r in repo.revs('extinct()'))
+    extinctrevs = set(repo.revs('extinct()'))
     for srcrev in rebaseobsrevs:
         srcnode = cl.node(srcrev)
         # XXX: more advanced APIs are required to handle split correctly
         successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode]))
         # obsutil.allsuccessors includes node itself
         successors.remove(srcnode)
-        if successors.issubset(extinctnodes):
+        succrevs = {nodemap[s] for s in successors if s in nodemap}
+        if succrevs.issubset(extinctrevs):
             # all successors are extinct
             obsoleteextinctsuccessors.add(srcrev)
         if not successors:
@@ -1870,7 +1871,6 @@
             obsoletenotrebased[srcrev] = None
         else:
             dstrev = destmap[srcrev]
-            succrevs = [nodemap[s] for s in successors if s in nodemap]
             for succrev in succrevs:
                 if cl.isancestorrev(succrev, dstrev):
                     obsoletenotrebased[srcrev] = succrev