robustcheckout: ensure progress bars are printed (bug 1305903); r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Tue, 27 Sep 2016 19:12:26 -0700
changeset 9644 8c48e4c0c8d80fe829375e3a8ed7f7dbdf186b7e
parent 9643 31a41bfe56603fabecaca6afbfa64e9e0ea8c940
push id1257
push usergszorc@mozilla.com
push dateWed, 28 Sep 2016 02:12:36 +0000
reviewersdustin
bugs1305903
robustcheckout: ensure progress bars are printed (bug 1305903); r?dustin Some machines in automation don't have progress bars enabled. This was causing job no activity timeouts on some really slow machines. Also, not having progress bars makes it difficult to understand how certain operations progressed (from the "shape" of the progress bars you can see things like if operations started slow, finished slow, etc). Let's force enable them during `hg robustcheckout`. MozReview-Commit-ID: 99FBIflB1H
hgext/robustcheckout/__init__.py
--- a/hgext/robustcheckout/__init__.py
+++ b/hgext/robustcheckout/__init__.py
@@ -138,16 +138,26 @@ def robustcheckout(ui, url, dest, upstre
     if not sharebase:
         raise error.Abort('share base directory not defined; refusing to operate',
                           hint='define share.pool config option or pass --sharebase')
 
     # worker.backgroundclose only makes things faster if running anti-virus,
     # which our automation doesn't. Disable it.
     ui.setconfig('worker', 'backgroundclose', False)
 
+    # By default the progress bar starts after 3s and updates every 0.1s. We
+    # change this so it shows and updates every 1.0s.
+    # We also tell progress to assume a TTY is present so updates are printed
+    # even if there is no known TTY.
+    # We make the config change here instead of in a config file because
+    # otherwise we're at the whim of whatever configs are used in automation.
+    ui.setconfig('progress', 'delay', 1.0)
+    ui.setconfig('progress', 'refresh', 1.0)
+    ui.setconfig('progress', 'assume-tty', True)
+
     sharebase = os.path.realpath(sharebase)
 
     return _docheckout(ui, url, dest, upstream, revision, branch, purge,
                        sharebase)
 
 def _docheckout(ui, url, dest, upstream, revision, branch, purge, sharebase):
     def callself():
         return _docheckout(ui, url, dest, upstream, revision, branch, purge,