310 # Apps that derive a class from ui.ui() can use |
310 # Apps that derive a class from ui.ui() can use |
311 # setconfig('progress', 'disable', 'True') to disable this extension |
311 # setconfig('progress', 'disable', 'True') to disable this extension |
312 if ui.configbool('progress', 'disable'): |
312 if ui.configbool('progress', 'disable'): |
313 return |
313 return |
314 if shouldprint(ui) and not ui.debugflag and not ui.quiet: |
314 if shouldprint(ui) and not ui.debugflag and not ui.quiet: |
315 ui.__class__ = progressui |
315 dval = object() |
316 # we instantiate one globally shared progress bar to avoid |
316 if getattr(ui, '_progbar', dval) is dval: |
317 # competing progress bars when multiple UI objects get created |
317 ui.__class__ = progressui |
318 if not progressui._progbar: |
318 # we instantiate one globally-shared progress bar to avoid |
319 if _singleton is None: |
319 # competing progress bars when multiple UI objects get created |
320 _singleton = progbar(ui) |
320 if not progressui._progbar: |
321 progressui._progbar = _singleton |
321 if _singleton is None: |
|
322 _singleton = progbar(ui) |
|
323 progressui._progbar = _singleton |
322 |
324 |
323 def reposetup(ui, repo): |
325 def reposetup(ui, repo): |
324 uisetup(repo.ui) |
326 uisetup(repo.ui) |