/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/reconcile.py

  • Committer: Vincent Ladeuil
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-02 00:19:39 UTC
  • mfrom: (6861.4.5 pb-context)
  • Revision ID: v.ladeuil+lp@free.fr-20180302001939-9kv1b4jr2658oaz7
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:
76
76
          branch history was correct, True if the branch history needed to be
77
77
          re-normalized.
78
78
        """
79
 
        with ui.ui_factory.nested_progress_bar() as self.pb:
80
 
            self._reconcile()
 
79
        operation = cleanup.OperationWithCleanups(self._reconcile)
 
80
        self.add_cleanup = operation.add_cleanup
 
81
        operation.run_simple()
81
82
 
82
83
    def _reconcile(self):
83
84
        """Helper function for performing reconciliation."""
 
85
        self.pb = ui.ui_factory.nested_progress_bar()
 
86
        self.add_cleanup(self.pb.finished)
84
87
        self._reconcile_branch()
85
88
        self._reconcile_repository()
86
89