[PATCH 1 of 4 evolve-ext] evolve: refactoring of the code displaying error when no trouble found

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue May 5 15:07:32 CDT 2015



On 05/05/2015 10:30 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1430780505 25200
> #      Mon May 04 16:01:45 2015 -0700
> # Node ID f113636997660b807c36cf1d0a06b76d53ada1a4
> # Parent  445d7f46f25dad1d5893b47b21140572159823fa
> evolve: refactoring of the code displaying error when no trouble found
>
> Before this patch, we had many return statements in the evolve function
> especially in the part in charge of displaying errors when no troubles
> were found. We move this code in a separate function.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1152,6 +1152,53 @@
>           mean = sum(len(x[1]) for x in allpclusters) // nbcluster
>           ui.write('        mean length:        %9i\n' % mean)
>
> +def handlenotrouble(ui, repo, startnode, dryrunopt):

UI would be happy with:

- a leading _
- some prefix making explicite this is for the evolve command
- some documentation about what it is supposed to do.

But this is still better than before so I'm pushing it to main. Thanks.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list