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

Martin von Zweigbergk martinvonz at google.com
Wed Jun 13 14:30:04 EDT 2018


On Wed, Jun 13, 2018 at 5:03 AM Yuya Nishihara <yuya at tcha.org> wrote:

> On Tue, 12 Jun 2018 13:44:17 -0700, Martin von Zweigbergk wrote:
> > > --- 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?
>
> Yeah, it could, but I'm not a fan of using note/status for data. At some
> point, I want to add a way to separate status/note/debug messages from data
> stream so that structured output (e.g. JSON/CBOR) won't be messed up.
>

Fair enough, I mostly wanted point out that the method existed in case you
had forgotten.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180613/42811a72/attachment.html>


More information about the Mercurial-devel mailing list