changeset 43567:0fea03924990

index: use `index.get_rev` in `rebase._computeobsoletenotrebased` Differential Revision: https://phab.mercurial-scm.org/D7350
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 09 Nov 2019 13:23:54 +0100
parents 054846d213ba
children 418ca164d44c
files hgext/rebase.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Sat Nov 09 13:23:53 2019 +0100
+++ b/hgext/rebase.py	Sat Nov 09 13:23:54 2019 +0100
@@ -2218,7 +2218,7 @@
 
     assert repo.filtername is None
     cl = repo.changelog
-    nodemap = cl.nodemap
+    get_rev = cl.index.get_rev
     extinctrevs = set(repo.revs(b'extinct()'))
     for srcrev in rebaseobsrevs:
         srcnode = cl.node(srcrev)
@@ -2226,7 +2226,8 @@
         successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode]))
         # obsutil.allsuccessors includes node itself
         successors.remove(srcnode)
-        succrevs = {nodemap[s] for s in successors if s in nodemap}
+        succrevs = {get_rev(s) for s in successors}
+        succrevs.discard(None)
         if succrevs.issubset(extinctrevs):
             # all successors are extinct
             obsoleteextinctsuccessors.add(srcrev)