[REVIEW] Progress bars for tree transforms
John A Meinel
john at arbash-meinel.com
Tue Feb 21 18:07:10 GMT 2006
Aaron Bentley wrote:
> Hi all,
>
> This patch adds progress bars to tree transform operations, when
> specified at the commandline.
>
> Commands covered are pull, merge, revert.
>
> Can I get a review, please?
>
> Aaron
------------------------------------------------------------------------
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py
+++ bzrlib/builtins.py
@@ -35,10 +35,12 @@
from bzrlib.log import show_one_log
from bzrlib.merge import Merge3Merger
from bzrlib.option import Option
+from bzrlib.progress import DummyProgress
from bzrlib.revisionspec import RevisionSpec
import bzrlib.trace
from bzrlib.trace import mutter, note, log_error, warning, is_quiet
from bzrlib.transport.local import LocalTransport
+from bzrlib.ui import ui_factory
from bzrlib.workingtree import WorkingTree
@@ -1749,7 +1751,8 @@
try:
conflict_count = merge(other, base, check_clean=(not force),
merge_type=merge_type,
reprocess=reprocess,
- show_base=show_base)
+ show_base=show_base,
+ pb=ui_factory.progress_bar())
Doesn't this create a default progress bar at first import time, rather
than creating a new one each time the function is called?
I think if you are doing this, then:
pb = None
if not pb:
pb = ui_factory.progress_bar()
But remember, we shouldn't do 'from bzrlib.ui import ui_factory' since
that creates a local variable, and the way you install a new factory is
by overriding that variable.
I also prefer passing in the progress bar, so that the calling code can
decide if a progress bar should be displayed, rather than the code
always creating its own progress bar.
So -1 until the import statement is fixed. And +0 on creating your own
progress bar.
Is this in your 'bzr.ttransform' branch? I would like to pull it so I
can see the actual progress bar work. Which is something I am looking
forward to.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/b78b5aba/attachment.pgp
More information about the bazaar
mailing list