[PATCH evolve-ext-V6] code hygiene

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Feb 3 16:18:01 EST 2016



On 02/03/2016 04:21 AM, Shusen LIU wrote:
> # HG changeset patch
> # User Shusen LIU <liushusen at fb.com>
> # Date 1454473154 28800
> #      Tue Feb 02 20:19:14 2016 -0800
> # Node ID 9e49992bd33cc58fd6c8a383652e85d9e604785b
> # Parent  de43a3e6b358f685e60fb0a64f0243b3eddb0a13
> code hygiene

Please follow the Mercurial commit message convention here. (also, this 
is not a V6, that's the first time you send this patch.

>
> using two return statements rather than assignment and then return.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -3748,7 +3748,7 @@
>          repo.dirstate.setbranch(orig.branch())
>
>       try:
> -       r = merge.graft(repo, orig, pctx, ['local', 'graft'], True)
> +       return merge.graft(repo, orig, pctx, ['local', 'graft'], True)
>       except TypeError:
>          # not using recent enough mercurial
>          if len(orig.parents()) == 2:
> @@ -3757,5 +3757,4 @@
>                  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
> +       return merge.graft(repo, orig, pctx, ['local', 'graft'])
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list