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

Unified Diff: gclient_utils.py

Issue 180243006: Make gclient_scm.py use cache_dir (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Remove cache_locks, also more membership tests. Created 6 years, 10 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 | « gclient_scm.py ('k') | git_cache.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 47ea50286bf9e2e66347395dd3595966075e0233..1801a6b5723e80cb12dd9f609d727e5c13faf647 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -5,6 +5,7 @@
"""Generic utils."""
import codecs
+import cStringIO
import logging
import os
import pipes
@@ -428,6 +429,7 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
"""
assert print_stdout or filter_fn
stdout = stdout or sys.stdout
+ output = cStringIO.StringIO()
filter_fn = filter_fn or (lambda x: None)
sleep_interval = RETRY_INITIAL_SLEEP
@@ -453,9 +455,10 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
filter_fn(None)
in_line = ''
while in_byte:
+ output.write(in_byte)
+ if print_stdout:
+ stdout.write(in_byte)
if in_byte != '\r':
- if print_stdout:
- stdout.write(in_byte)
if in_byte != '\n':
in_line += in_byte
else:
@@ -480,7 +483,7 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
raise
if rv == 0:
- return 0
+ return output.getvalue()
if not retry:
break
print ("WARNING: subprocess '%s' in %s failed; will retry after a short "
« no previous file with comments | « gclient_scm.py ('k') | git_cache.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698