[PATCH 5 of 8 v8] rebase: move local variable 'extrafn' to the RR class
Yuya Nishihara
yuya at tcha.org
Sun Jul 3 09:29:21 UTC 2016
On Fri, 1 Jul 2016 12:30:13 +0000, Kostiantyn Balytskyi wrote:
> # 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)
I think rbrst.makeextrafn() would be better than making rbrst more stateful.
extrafn is used only twice.
More information about the Mercurial-devel
mailing list