rebase: reduce scope of a variable
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 11 Jul 2018 15:03:39 -0700
changeset 38671 99ed6e2f6606
parent 38670 fbec9c0b32d3
child 38672 0f8599afb92f
rebase: reduce scope of a variable Differential Revision: https://phab.mercurial-scm.org/D3940
hgext/rebase.py
--- 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