[PATCH 5 of 8 v8] rebase: move local variable 'extrafn' to the RR class

Kostiantyn Balytskyi ikostia at fb.com
Fri Jul 1 08:30:13 EDT 2016


# HG changeset patch
# User Kostia Balytskyi <ikostia at fb.com>
# Date 1467374993 -7200
#      Fri Jul 01 14:09:53 2016 +0200
# Node ID a6e711ccd5e72d1642f4d6408a2ac4be59a11f08
# Parent  cbde74c620450392d7e95f9f9664d79a9f6b8e9a
rebase: move local variable 'extrafn' to the RR class

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -148,6 +148,7 @@ class rebaseruntime(object):
         self.extrafns = [_savegraft]
         if e:
             self.extrafns = [e]
+        self.extrafn = None
 
         self.keepf = opts.get('keep', False)
         self.keepbranchesf = opts.get('keepbranches', False)
@@ -498,7 +499,7 @@ def rebase(ui, repo, **opts):
         if rbsrt.activebookmark:
             bookmarks.deactivate(repo)
 
-        extrafn = _makeextrafn(rbsrt.extrafns)
+        rbsrt.extrafn = _makeextrafn(rbsrt.extrafns)
 
         rbsrt.sortedstate = sorted(rbsrt.state)
         total = len(rbsrt.sortedstate)
@@ -542,7 +543,8 @@ def rebase(ui, repo, **opts):
                     merging = p2 != nullrev
                     editform = cmdutil.mergeeditform(merging, 'rebase')
                     editor = cmdutil.getcommiteditor(editform=editform, **opts)
-                    newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn,
+                    newnode = concludenode(repo, rev, p1, p2,
+                                           extrafn=rbsrt.extrafn,
                                            editor=editor,
                                            keepbranches=rbsrt.keepbranchesf,
                                            date=rbsrt.date)
@@ -603,7 +605,7 @@ def rebase(ui, repo, **opts):
             revtoreuse = rbsrt.sortedstate[-1]
             newnode = concludenode(repo, revtoreuse, p1, rbsrt.external,
                                    commitmsg=commitmsg,
-                                   extrafn=extrafn, editor=editor,
+                                   extrafn=rbsrt.extrafn, editor=editor,
                                    keepbranches=rbsrt.keepbranchesf,
                                    date=rbsrt.date)
             if newnode is None:


More information about the Mercurial-devel mailing list