changeset 43566:054846d213ba

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 09 Nov 2019 13:23:53 +0100
parents f212cc5ffceb
children 0fea03924990
files hgext/rebase.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):