/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 breezy/git/remote.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-06-06 22:22:47 UTC
  • mfrom: (7143.22.4 progressbar-context)
  • Revision ID: breezy.the.bot@gmail.com-20190606222247-muw4nwibuoh9b30u
Use contexts for progress bars where possible.

Merged from https://code.launchpad.net/~jelmer/brz/progressbar-context/+merge/358460

Show diffs side-by-side

added added

removed removed

Lines of Context:
652
652
 
653
653
    def _idx_load_or_generate(self, path):
654
654
        if not os.path.exists(path):
655
 
            pb = ui.ui_factory.nested_progress_bar()
656
 
            try:
 
655
            with ui.ui_factory.nested_progress_bar() as pb:
657
656
                def report_progress(cur, total):
658
657
                    pb.update("generating index", cur, total)
659
 
                self.data.create_index(path,
660
 
                                       progress=report_progress)
661
 
            finally:
662
 
                pb.finished()
 
658
                self.data.create_index(path, progress=report_progress)
663
659
        return load_pack_index(path)
664
660
 
665
661
    def __del__(self):