~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Fixup pb usage to use nested_progress_bar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
            raise Exception("can't fetch from a branch to itself %s, %s" % 
208
208
                            (self.base, to_branch.base))
209
209
        if pb is None:
210
 
            pb = bzrlib.ui.ui_factory.progress_bar()
 
210
            nested_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
211
            pb = nested_pb
 
212
        else:
 
213
            nested_pb = None
211
214
 
212
215
        from_branch.lock_read()
213
216
        try:
221
224
                    last_revision = NULL_REVISION
222
225
            return self.repository.fetch(from_branch.repository,
223
226
                                         revision_id=last_revision,
224
 
                                         pb=pb)
 
227
                                         pb=nested_pb)
225
228
        finally:
 
229
            if nested_pb is not None:
 
230
                nested_pb.finished()
226
231
            from_branch.unlock()
227
232
 
228
233
    def get_bound_location(self):