~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Matthew Fuller
  • Date: 2010-12-04 17:58:25 UTC
  • mto: (5575.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5576.
  • Revision ID: fullermd@over-yonder.net-20101204175825-o5l12bgf0im1dmqj
Wrap a progress bar around the iteration of entries to upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
    """
226
226
    succeeded = []
227
227
    exceptions = []
 
228
    child_pb = ui.ui_factory.nested_progress_bar()
 
229
    i = 0
 
230
    child_pb.update('Upgrading bzrdirs', i, len(items))
228
231
    for control_dir in items:
 
232
        i += 1
229
233
        # Do the conversion
230
234
        location = control_dir.root_transport.base
231
235
        bzr_object, bzr_label = control_dir._get_object_and_label()
 
236
        type_label = label or bzr_label
 
237
        child_pb.update("Upgrading %s" % (type_label), i, len(items))
232
238
        if verbose:
233
 
            type_label = label or bzr_label
234
239
            note("Upgrading %s %s ...", type_label, location)
235
240
        try:
236
241
            if not dry_run:
252
257
                    (location, ex))
253
258
                exceptions.append(ex)
254
259
 
 
260
    child_pb.finished()
 
261
 
255
262
    # Return the result
256
263
    return succeeded, exceptions
257
264