rebase: move local variable 'extrafn' to the RR class
authorKostia Balytskyi <ikostia@fb.com>
Fri, 01 Jul 2016 14:09:53 +0200
changeset 29476 48188ceb3c43
parent 29475 fb7fc877ed17
child 29477 becc4c6eca42
rebase: move local variable 'extrafn' to the RR class
hgext/rebase.py
--- a/hgext/rebase.py	Fri Jul 01 14:09:53 2016 +0200
+++ b/hgext/rebase.py	Fri Jul 01 14:09:53 2016 +0200
@@ -148,6 +148,7 @@
         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 @@
         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 @@
                     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 @@
             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: