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

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2019, 5:20 a.m.
Message ID <e4859150f5a2f3730c803a1ab2b65e87@localhost.localdomain>
Download mbox | patch
Permalink /patch/43036/
State Not Applicable
Headers show

Comments

phabricator - Nov. 9, 2019, 5:20 a.m.
marmoute updated this revision to Diff 17851.

REPOSITORY
  rHG Mercurial

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

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)