[PATCH 5 of 5] histedit: convert drop action into a class

Augie Fackler raf at durin42.com
Wed Apr 15 22:32:57 UTC 2015


On Tue, Apr 14, 2015 at 11:35:22AM -0700, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1428132601 25200
> #      Sat Apr 04 00:30:01 2015 -0700
> # Node ID 329572a4f5f2ec55d592a6db3ea1ac2606bfdc91
> # Parent  cc333abf57472637a5d33f0df2869cbe0bad0bde
> histedit: convert drop action into a class

These are queued, but I thought you had more patches that finished
this and removed the old codepaths? Can you send that before I push?


>
> This converts the drop action into a histeditclass instance, as part of an
> ongoing effort to refactor histedit for maintainability and robustness.
>
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -501,11 +501,10 @@ def finishfold(ui, repo, ctx, oldctx, ne
>          replacements.append((ich, (n,)))
>      return repo[n], replacements
>
> -def drop(ui, state, ha, opts):
> -    repo, ctxnode = state.repo, state.parentctxnode
> -    ctx = repo[ctxnode]
> -    return ctx, [(repo[ha].node(), ())]
> -
> +class drop(histeditaction):
> +    def run(self):
> +        parentctx = self.repo[self.state.parentctxnode]
> +        return parentctx, [(self.node, tuple())]
>
>  def message(ui, state, ha, opts):
>      repo, ctxnode = state.repo, state.parentctxnode
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list