~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Added progress bars to tree-changing operations

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from bzrlib.log import show_one_log
36
36
from bzrlib.merge import Merge3Merger
37
37
from bzrlib.option import Option
 
38
from bzrlib.progress import DummyProgress
38
39
from bzrlib.revisionspec import RevisionSpec
39
40
import bzrlib.trace
40
41
from bzrlib.trace import mutter, note, log_error, warning, is_quiet
41
42
from bzrlib.transport.local import LocalTransport
 
43
import bzrlib.ui
42
44
from bzrlib.workingtree import WorkingTree
43
45
 
44
46
 
1749
1751
        try:
1750
1752
            conflict_count = merge(other, base, check_clean=(not force),
1751
1753
                                   merge_type=merge_type, reprocess=reprocess,
1752
 
                                   show_base=show_base)
 
1754
                                   show_base=show_base, 
 
1755
                                   pb=bzrlib.ui.ui_factory.progress_bar())
1753
1756
            if conflict_count != 0:
1754
1757
                return 1
1755
1758
            else:
1852
1855
        else:
1853
1856
            rev_id = revision[0].in_history(tree.branch).rev_id
1854
1857
        tree.revert(file_list, tree.branch.repository.revision_tree(rev_id),
1855
 
                    not no_backup)
 
1858
                    not no_backup, bzrlib.ui.ui_factory.progress_bar())
1856
1859
 
1857
1860
 
1858
1861
class cmd_assert_fail(Command):
2159
2162
def merge(other_revision, base_revision,
2160
2163
          check_clean=True, ignore_zero=False,
2161
2164
          this_dir=None, backup_files=False, merge_type=Merge3Merger,
2162
 
          file_list=None, show_base=False, reprocess=False):
 
2165
          file_list=None, show_base=False, reprocess=False, 
 
2166
          pb=DummyProgress()):
2163
2167
    """Merge changes into a tree.
2164
2168
 
2165
2169
    base_revision
2199
2203
                              " type. %s" % merge_type)
2200
2204
    if reprocess and show_base:
2201
2205
        raise BzrCommandError("Cannot reprocess and show base.")
2202
 
    merger = Merger(this_tree.branch, this_tree=this_tree)
 
2206
    merger = Merger(this_tree.branch, this_tree=this_tree, pb=pb)
2203
2207
    merger.check_basis(check_clean)
2204
2208
    merger.set_other(other_revision)
2205
2209
    merger.set_base(base_revision)