/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/_annotator_py.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:
261
261
                        each key is a possible source for the given line.
262
262
            lines the text of "key" as a list of lines
263
263
        """
264
 
        pb = ui.ui_factory.nested_progress_bar()
265
 
        try:
 
264
        with ui.ui_factory.nested_progress_bar() as pb:
266
265
            for text_key, text, num_lines in self._get_needed_texts(key, pb=pb):
267
266
                self._annotate_one(text_key, text, num_lines)
268
 
        finally:
269
 
            pb.finished()
270
267
        try:
271
268
            annotations = self._annotations_cache[key]
272
269
        except KeyError: