Patchwork D7349: index: use `index.get_rev` in `rebase.successorrevs`

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:28 p.m.
Message ID <differential-rev-PHID-DREV-oe62sqwwjrad4tx6s4mr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42954/
State Superseded
Headers show

Comments

phabricator - Nov. 8, 2019, 4:28 p.m.
marmoute created this revision.
Herald added a reviewer: martinvonz.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The code is slightly updated in the process for simplicity.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7349

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: marmoute, martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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):