[PATCH 6 of 6 V5] summary: add evolution "troubles" information to summary output

Yuya Nishihara yuya at tcha.org
Sat Jan 7 03:53:46 EST 2017


On Fri, 06 Jan 2017 16:32:29 +0100, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1483709722 -3600
> #      Fri Jan 06 14:35:22 2017 +0100
> # Node ID 3a382f7173808665968de416db145ade8c56672c
> # Parent  1d9bdfeb0afded737513f51e75cefa11e9231fdf
> # EXP-Topic evolve-ui
> summary: add evolution "troubles" information to summary output

> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -5991,6 +5991,15 @@ def summary(ui, repo, **opts):
>                  ui.write(_(' (empty repository)'))
>              else:
>                  ui.write(_(' (no revision checked out)'))
> +        if p.troubled():
> +            ui.write(' (')
> +            troubles = p.troubles()
> +            for idx, trouble in enumerate(troubles, 1):
> +                ui.write(trouble,
> +                         label='trouble.%s' % trouble)
> +                if idx < len(troubles):
> +                    ui.write(', ')
> +            ui.write(')')

Just fyi, you can use ui.label() to get labeled strings and join them.


More information about the Mercurial-devel mailing list