/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Aaron Bentley
  • Date: 2007-12-30 18:20:15 UTC
  • mto: This revision was merged to the branch mainline in revision 3167.
  • Revision ID: aaron.bentley@utoronto.ca-20071230182015-wnqwi7okgkuu6asy
InterDifferingSerializer shows a progress bar

Show diffs side-by-side

added added

removed removed

Lines of Context:
1848
1848
    install_revisions(repository, [(rev, revision_tree, None)])
1849
1849
 
1850
1850
 
1851
 
def install_revisions(repository, iterable):
 
1851
def install_revisions(repository, iterable, num_revisions=None, pb=None):
1852
1852
    """Install all revision data into a repository.
1853
1853
 
1854
1854
    Accepts an iterable of revision, tree, signature tuples.  The signature
1856
1856
    """
1857
1857
    repository.start_write_group()
1858
1858
    try:
1859
 
        for revision, revision_tree, signature in iterable:
 
1859
        for n, (revision, revision_tree, signature) in enumerate(iterable):
1860
1860
            _install_revision(repository, revision, revision_tree, signature)
 
1861
            if pb is not None:
 
1862
                pb.update('Transferring revisions', n + 1, num_revisions)
1861
1863
    except:
1862
1864
        repository.abort_write_group()
1863
1865
        raise
2771
2773
                except errors.NoSuchRevision:
2772
2774
                    signature = None
2773
2775
                yield revision, tree, signature
2774
 
        install_revisions(self.target, revisions_iterator())
 
2776
        if pb is None:
 
2777
            my_pb = ui.ui_factory.nested_progress_bar()
 
2778
            pb = my_pb
 
2779
        else:
 
2780
            my_pb = None
 
2781
        try:
 
2782
            install_revisions(self.target, revisions_iterator(),
 
2783
                              len(revision_ids), pb)
 
2784
        finally:
 
2785
            if my_pb is not None:
 
2786
                my_pb.finished()
2775
2787
        return len(revision_ids), 0
2776
2788
 
2777
2789