[PATCH 2 of 4] debugwalk: show matcher output only if -v/--verbose

Martin von Zweigbergk martinvonz at google.com
Tue Jun 12 20:44:17 UTC 2018


On Mon, Jun 11, 2018 at 6:07 AM Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1528599236 -32400
> #      Sun Jun 10 11:53:56 2018 +0900
> # Node ID ff248c56af342b1e07e1d51bb4760da202111ba3
> # Parent  40a20b62d7cc17999c8e879d62b4d95f1c3bb4cd
> debugwalk: show matcher output only if -v/--verbose
>
> And drop "egrep -v". This matches the behavior of "hg debugrevspec".
>
> diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py
> +++ b/mercurial/debugcommands.py
> @@ -2542,7 +2542,8 @@ def debugwalk(ui, repo, *pats, **opts):
>      """show how files match on given patterns"""
>      opts = pycompat.byteskwargs(opts)
>      m = scmutil.match(repo[None], pats, opts)
> -    ui.write(('matcher: %r\n' % m))
> +    if ui.verbose:
> +        ui.write(('matcher: %r\n' % m))
>

nit: These two lines are equivalent to "ui.note(('matcher: %r\n' % m))",
except that that also adds a "ui.note" label. Use that method instead?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180612/bf8d2161/attachment-0002.html>


More information about the Mercurial-devel mailing list