[PATCH 0 of 2] Let progress act as a silencer

Matt Mackall mpm at selenic.com
Wed Oct 20 11:30:24 CDT 2010


On Wed, 2010-10-20 at 14:04 +0200, Martin Geisler wrote:
> timeless <timeless at gmail.com> writes:
> 
> > mpm didn't like the hackery I was using for convert.
> >
> > It turns out that what we really want is just to treat the progress
> > extension as a request for "quiet". If the user actually wants noisy,
> > then this doesn't apply.
> 
> I don't understand why you want to silence the output? I thought the
> progess extension and the API was designed to handle output interleaved
> with the progress bar. So when starting the terminal looks like:
> 
>   loop [                                                            ] 0/3
> 
> then some output is made and it looks like
> 
>   first line of output
>   loop [=================>                                          ] 1/3
> 
> more output is made:
> 
>   first line of output
>   second line of output
>   loop [========================================>                   ] 2/3
> 
> and so on.

The issue is that there are a few places Mercurial uses ui.status() to
indicate progress in potentially long-running commands. In convert, we
output a line per changeset, for instance. Another is the "searching for
changesets" stanza that all the networking commands output.

But I still don't like this approach, as lots of ui.status() messages
are NOT a proxy for progress and having them mysteriously disappear when
the progress extension was enabled would be bad. We should instead have
a new ui method, something like:

ui.progressmsg("convert", _("now at stage foo\n"))

And have the progress extension decide how to deal with it. The textual
version might decide to just skip it, while a GUI might put it somewhere
useful.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list