brz 0.8.2 - Disable progress bar and enable it only on -v option

John Arbash Meinel john at arbash-meinel.com
Thu Jun 15 15:31:16 BST 2006


Jari Aalto+mail.emacs wrote:
> * Wed 2006-06-14 John Arbash Meinel <john AT arbash-meinel.com>
> * Message-Id: 4490C9DB.60004 AT arbash-meinel.com
>> Jari Aalto+mail.emacs wrote:

...

> 
> The `-q' is used commonly to supress informational output. The
> progress bar is something other than "messages"; on category of it's
> own.
> 
> In normal use the progress bar does not offer any useful information,
> because it just flickers and causes slowdown on modem connections (try
> 48k modem), so it should have separate option to turn it on.
> 
> I can see where progress bar could be useful:
> 
> - importing big projects 
> - with bug files
> - using slow hard disk or remote (slow) network connections
> 
> But for regular local disk use, it is not necessary.
> 
> Jari

I'm not against an option that lets us control the progress bar state. A
few of the problems are actually more because we aren't using the
progress bar correctly everywhere.
The biggest bar that flickers is the 'reading knit index'. It can be
slow over a remote connection, so we have it in for now. But it needs a
parent bar, so that it doesn't flicker into life all the time.

I'm not sure what the best way of suppressing the progress bar is. For
'emacs' I thought we were checking if the output was a tty, though I can
say my cron jobs started printing fancy progress bars, rather than the
dots format that they used to. So there are definitely some bugs left in
the system.

One of the bugs is that we had created a factory which would check the
output file, and we no longer do that. The bugfix I propose would be to do:

=== modified file 'bzrlib/progress.py'
--- bzrlib/progress.py  2006-05-09 10:33:08 +0000
+++ bzrlib/progress.py  2006-06-15 14:25:37 +0000
@@ -93,7 +93,7 @@
         self._show_count = show_count
         self._to_messages_file = to_messages_file
         self._stack = []
-        self._klass = klass or TTYProgressBar
+        self._klass = klass or ProgressBar

     def top(self):
         if len(self._stack) != 0:

This only fixes my cron job uses TTY bars bug.

Currently the code has the ability to set the progress bar type by the
base constructor of the TextUIFactory.
This is actually created before any arguments are parsed, but we could
probably extend the api a little so we could change the progress bar
type with an argument flag.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060615/3a49d2e9/attachment.pgp 


More information about the bazaar mailing list