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

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 3:59 p.m.
Message ID <328476e02b77f1f9f0f51daf79dbec14@localhost.localdomain>
Download mbox | patch
Permalink /patch/43090/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 3:59 p.m.
Closed by commit rHG52fb6b800e5d: index: use `index.get_rev` in `rebase._computeobsoletenotrebased` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7350?vs=17851&id=17904

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7350/new/

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: marmoute, martinvonz, #hg-reviewers, indygreg
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)