/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/repository.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:
516
516
            except KeyError:
517
517
                # Update refs from Git commit objects
518
518
                # FIXME: Hitting this a lot will be very inefficient...
519
 
                pb = ui.ui_factory.nested_progress_bar()
520
 
                try:
 
519
                with ui.ui_factory.nested_progress_bar() as pb:
521
520
                    for i, (git_sha, revid, roundtrip_revid) in enumerate(
522
521
                            self._iter_revision_ids()):
523
522
                        if not roundtrip_revid:
527
526
                        self._git.refs[refname] = git_sha
528
527
                        if roundtrip_revid == bzr_revid:
529
528
                            return git_sha, mapping
530
 
                finally:
531
 
                    pb.finished()
532
529
                raise errors.NoSuchRevision(self, bzr_revid)
533
530
        else:
534
531
            return (git_sha, mapping)