/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/plugins/launchpad/cmds.py

  • Committer: Vincent Ladeuil
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-01 05:46:59 UTC
  • mfrom: (6861.4.1 pb-context)
  • Revision ID: v.ladeuil+lp@free.fr-20180301054659-7fzum8cexsk421r3
Make progress bars context managers.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
271
271
        from . import lp_api
272
272
        import webbrowser
273
273
        b = _mod_branch.Branch.open_containing('.')[0]
274
 
        pb = ui.ui_factory.nested_progress_bar()
275
 
        b.lock_read()
276
 
        try:
 
274
        with ui.ui_factory.nested_progress_bar() as pb, b.lock_read():
277
275
            if revision is None:
278
276
                revision_id = b.last_revision()
279
277
            else:
284
282
            trace.note(gettext('%d proposals(s) found.') % len(merged))
285
283
            for mp in merged:
286
284
                webbrowser.open(lp_api.canonical_url(mp))
287
 
        finally:
288
 
            b.unlock()
289
 
            pb.finished()
290
285
 
291
286
    def _find_proposals(self, revision_id, pb):
292
287
        from . import (lp_api, lp_registration)