[PATCH evolve-ext-V5] evolve: extract logic to new method _evolvemerge

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jan 30 15:58:26 UTC 2016



On 01/27/2016 01:12 AM, Bryan O'Sullivan wrote:
>
> On Tue, Jan 26, 2016 at 3:42 PM, Shusen LIU <liushusen at fb.com
> <mailto:liushusen at fb.com>> wrote:
>
>     +    try:
>     +       r = merge.graft(repo, orig, pctx, ['local', 'graft'], True)
>     +    except TypeError:
>     +       # not using recent enough mercurial
>     +       if len(orig.parents()) == 2:
>     +           raise error.Abort(
>     +               _("no support for evolving merge changesets yet"),
>     +               hint=_("Redo the merge and use `hg prune <old> --succ "
>     +                      "<new>` to obsolete the old one"))
>     +
>     +       r = merge.graft(repo, orig, pctx, ['local', 'graft'])
>     +    return r
>
>
> Just as a small matter of code hygiene, I would prefer to see two return
> statements instead of assignments followed by a return. That makes more
> sense now that you've extracted this out into its own function.

Shusen, can you followup with a cleanup for that?

>
> Also, I am not sure what "support a continued keywork" in your
> description means.

I've updated that to:

This simplifies the code of the method relocate and allows us to re-use it
later in the scope of the rework of 'hg evolve --continue'


Because I think this is what it means.


Pushed to main otherwise.

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list