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

Support progress reporting when creating index.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from bzrlib import (
19
19
    branch,
20
20
    tag,
 
21
    ui,
21
22
    urlutils,
22
23
    )
23
24
from bzrlib.bzrdir import (
195
196
        if self._idx is None:
196
197
            if self._data is None:
197
198
                self._data = PackData(self._data_path)
198
 
            self._data.create_index_v2(self._idx_path, self.resolve_ext_ref)
 
199
            pb = ui.ui_factory.nested_progress_bar()
 
200
            try:
 
201
                def report_progress(cur, total):
 
202
                    pb.update("generating index", cur, total)
 
203
                self._data.create_index_v2(self._idx_path, self.resolve_ext_ref,
 
204
                    progress=report_progress)
 
205
            finally:
 
206
                pb.finished()
199
207
            self._idx = load_pack_index(self._idx_path)
200
208
        return self._idx
201
209