~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-12 00:19:04 UTC
  • mfrom: (1551.2.37 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060312001904-3bcd7cbf830cc37c
Make pull update the progress bar more nicely

Show diffs side-by-side

added added

removed removed

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