index: use `index.get_rev` in `rebase.successorrevs`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 09 Nov 2019 13:23:53 +0100
changeset 43566 054846d213ba
parent 43565 f212cc5ffceb
child 43567 0fea03924990
index: use `index.get_rev` in `rebase.successorrevs` The code is slightly updated in the process for simplicity. Differential Revision: https://phab.mercurial-scm.org/D7349
hgext/rebase.py
--- a/hgext/rebase.py	Sat Nov 09 13:23:52 2019 +0100
+++ b/hgext/rebase.py	Sat Nov 09 13:23:53 2019 +0100
@@ -1643,10 +1643,11 @@
 def successorrevs(unfi, rev):
     """yield revision numbers for successors of rev"""
     assert unfi.filtername is None
-    nodemap = unfi.changelog.nodemap
+    get_rev = unfi.changelog.index.get_rev
     for s in obsutil.allsuccessors(unfi.obsstore, [unfi[rev].node()]):
-        if s in nodemap:
-            yield nodemap[s]
+        r = get_rev(s)
+        if r is not None:
+            yield r
 
 
 def defineparents(repo, rev, destmap, state, skipped, obsskipped):