progress: provide an explicit disable method for developers stable
authorSteve Borho <steve@borho.org>
Tue, 23 Feb 2010 23:10:01 -0600
branchstable
changeset 10540 dd9d057465c1
parent 10539 fc5908d01ed7
child 10541 fac67f0bfbb2
progress: provide an explicit disable method for developers The other three checks for disabling the progress bar have serious side effects for any class that derives from ui.ui()
hgext/progress.py
--- a/hgext/progress.py	Wed Feb 24 17:11:37 2010 +0100
+++ b/hgext/progress.py	Tue Feb 23 23:10:01 2010 -0600
@@ -170,6 +170,10 @@
 sharedprog = None
 
 def uisetup(ui):
+    # Apps that derive a class from ui.ui() can use
+    # setconfig('progress', 'disable', 'True') to disable this extension
+    if ui.configbool('progress', 'disable'):
+        return
     if ui.interactive() and not ui.debugflag and not ui.quiet:
         # we instantiate one globally shared progress bar to avoid
         # competing progress bars when multiple UI objects get created