Chromium Code Reviews| Index: gclient_scm.py |
| diff --git a/gclient_scm.py b/gclient_scm.py |
| index c4484a216f10abf78be99f8fa38e6a9b66eabc53..539a338eb3cdd64877cda840c50cbe1bb19714f6 100644 |
| --- a/gclient_scm.py |
| +++ b/gclient_scm.py |
| @@ -10,6 +10,7 @@ import posixpath |
| import re |
| import subprocess |
| import time |
| +import sys |
|
chase
2010/08/18 16:59:57
nit: move above 'import time'
|
| import scm |
| import gclient_utils |
| @@ -873,6 +874,11 @@ class SVNWrapper(SCMWrapper): |
| # Don't reuse the args. |
| return self.update(options, [], file_list) |
| + # Do a flush of sys.stdout every 10 secs or so otherwise it may never be |
| + # flushed fast enough for buildbot. |
| + last_flushed_at = time.time() |
| + sys.stdout.flush() |
| + |
| for file_status in scm.SVN.CaptureStatus(path): |
| file_path = os.path.join(path, file_status[1]) |
| if file_status[0][0] == 'X': |
| @@ -884,6 +890,13 @@ class SVNWrapper(SCMWrapper): |
| logging.info('%s%s' % (file[0], file[1])) |
| else: |
| print(file_path) |
| + # Flush at least 10 seconds between line writes. We wait at least 10 |
| + # seconds to avoid overloading the reader that called us with output, |
| + # which can slow busy readers down. |
| + if (time.time() - last_flushed_at) > 10: |
| + last_flushed_at = time.time() |
| + sys.stdout.flush() |
| + |
| if file_status[0].isspace(): |
| logging.error('No idea what is the status of %s.\n' |
| 'You just found a bug in gclient, please ping ' |