~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-06-11 01:35:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050611013524-2ee17e0fb957a444
- Show progress while branching

Show diffs side-by-side

added added

removed removed

Lines of Context:
719
719
        >>> br1.text_store.total_size() == br2.text_store.total_size()
720
720
        True
721
721
        """
 
722
        from bzrlib.progress import ProgressBar
 
723
 
 
724
        pb = ProgressBar()
 
725
 
 
726
        pb.update('comparing histories')
722
727
        revision_ids = self.missing_revisions(other)
723
 
        revisions = [other.get_revision(f) for f in revision_ids]
 
728
        revisions = []
724
729
        needed_texts = sets.Set()
725
 
        for rev in revisions:
 
730
        i = 0
 
731
        for rev_id in revision_ids:
 
732
            i += 1
 
733
            pb.update('fetching revision', i, len(revision_ids))
 
734
            rev = other.get_revision(rev_id)
 
735
            revisions.append(rev)
726
736
            inv = other.get_inventory(str(rev.inventory_id))
727
737
            for key, entry in inv.iter_entries():
728
738
                if entry.text_id is None:
729
739
                    continue
730
740
                if entry.text_id not in self.text_store:
731
741
                    needed_texts.add(entry.text_id)
 
742
 
 
743
        pb.clear()
 
744
                    
732
745
        count = self.text_store.copy_multi(other.text_store, needed_texts)
733
746
        print "Added %d texts." % count 
734
747
        inventory_ids = [ f.inventory_id for f in revisions ]