Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: gclient_scm.py

Issue 3171015: Add flushing to gclient revert. (Closed)
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 '
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698