~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Make pull update the progress bar more nicely

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
                            rename,
85
85
                            supports_executable,
86
86
                            )
87
 
from bzrlib.progress import DummyProgress
 
87
from bzrlib.progress import DummyProgress, ProgressPhase
88
88
from bzrlib.revision import NULL_REVISION
89
89
from bzrlib.rio import RioReader, RioWriter, Stanza
90
90
from bzrlib.symbol_versioning import *
876
876
 
877
877
    @needs_write_lock
878
878
    def pull(self, source, overwrite=False, stop_revision=None):
 
879
        top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
879
880
        source.lock_read()
880
881
        try:
 
882
            pp = ProgressPhase("Pull phase", 2, top_pb)
 
883
            pp.next_phase()
881
884
            old_revision_history = self.branch.revision_history()
882
885
            basis_tree = self.basis_tree()
883
886
            count = self.branch.pull(source, overwrite, stop_revision)
884
887
            new_revision_history = self.branch.revision_history()
885
888
            if new_revision_history != old_revision_history:
 
889
                pp.next_phase()
886
890
                if len(old_revision_history):
887
891
                    other_revision = old_revision_history[-1]
888
892
                else:
901
905
            return count
902
906
        finally:
903
907
            source.unlock()
 
908
            top_pb.finished()
904
909
 
905
910
    def extras(self):
906
911
        """Yield all unknown files in this WorkingTree.