Patchwork D3941: rebase: avoid converting from nodes to revnums twice

login
register
mail settings
Submitter phabricator
Date July 13, 2018, 12:23 p.m.
Message ID <ac882adf56d5296d6b2dc6be6bfc6af0@localhost.localdomain>
Download mbox | patch
Permalink /patch/32830/
State Not Applicable
Headers show

Comments

phabricator - July 13, 2018, 12:23 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0f8599afb92f: rebase: avoid converting from nodes to revnums twice (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3941?vs=9578&id=9584

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: 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
@@ -1869,19 +1869,17 @@ 
             # no successor
             obsoletenotrebased[srcrev] = None
         else:
-            destnode = cl.node(destmap[srcrev])
-            for succnode in successors:
-                if succnode not in nodemap:
-                    continue
-                if cl.isancestor(succnode, destnode):
-                    obsoletenotrebased[srcrev] = nodemap[succnode]
+            dstrev = destmap[srcrev]
+            succrevs = [nodemap[s] for s in successors if s in nodemap]
+            for succrev in succrevs:
+                if cl.isancestorrev(succrev, dstrev):
+                    obsoletenotrebased[srcrev] = succrev
                     break
             else:
                 # If 'srcrev' has a successor in rebase set but none in
                 # destination (which would be catched above), we shall skip it
                 # and its descendants to avoid divergence.
-                if any(nodemap[s] in destmap for s in successors
-                       if s in nodemap):
+                if any(s in destmap for s in succrevs):
                     obsoletewithoutsuccessorindestination.add(srcrev)
 
     return (