diff hgext/rebase.py @ 38671:99ed6e2f6606

rebase: reduce scope of a variable Differential Revision: https://phab.mercurial-scm.org/D3940
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 11 Jul 2018 15:03:39 -0700
parents 572dff5c946e
children 0f8599afb92f
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Jul 12 08:22:28 2018 -0700
+++ b/hgext/rebase.py	Wed Jul 11 15:03:39 2018 -0700
@@ -1858,7 +1858,6 @@
     extinctnodes = set(cl.node(r) for r in repo.revs('extinct()'))
     for srcrev in rebaseobsrevs:
         srcnode = cl.node(srcrev)
-        destnode = cl.node(destmap[srcrev])
         # XXX: more advanced APIs are required to handle split correctly
         successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode]))
         # obsutil.allsuccessors includes node itself
@@ -1870,6 +1869,7 @@
             # no successor
             obsoletenotrebased[srcrev] = None
         else:
+            destnode = cl.node(destmap[srcrev])
             for succnode in successors:
                 if succnode not in nodemap:
                     continue