Patchwork D7350: index: use `index.get_rev` in `rebase._computeobsoletenotrebased`

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:28 p.m.
Message ID <differential-rev-PHID-DREV-qcwrl4bjmvre2i7n5fvl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42955/
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.

REPOSITORY
  rHG Mercurial

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

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
@@ -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)