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

Unified Diff: slave/skia_slave_scripts/utils/gclient_utils.py

Issue 23548042: Use shell_utils' log_in_real_time=False for some git commands (Closed) Base URL: http://skia.googlecode.com/svn/buildbot/
Patch Set: Created 7 years, 3 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 | « slave/skia_slave_scripts/run_bench.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: slave/skia_slave_scripts/utils/gclient_utils.py
===================================================================
--- slave/skia_slave_scripts/utils/gclient_utils.py (revision 11306)
+++ slave/skia_slave_scripts/utils/gclient_utils.py (working copy)
@@ -10,8 +10,6 @@
import os
import shell_utils
-import subprocess
-import time
GIT = 'git.bat' if os.name == 'nt' else 'git'
@@ -95,26 +93,11 @@
# Get the checked-out commit hash for the first gclient solution.
os.chdir(config[0]['name'])
try:
- for i in xrange(30):
- # "git rev-parse HEAD" returns the commit hash for HEAD.
- cmd = [GIT, 'rev-parse', 'HEAD']
- print cmd
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- if proc.wait() == 0:
- commit_hash = proc.communicate()[0].rstrip('\n')
- print commit_hash
- if commit_hash:
- # Break out of the retry loop if we have a non-empty commit hash.
- break
- else:
- print 'Command exited with non-zero code.'
- # Sleep for 1 second and hope the next iteration finds the commit hash.
- print 'Could not find a non-empty commit_hash, retrying.. #%s' % (i + 1)
- time.sleep(1)
+ # "git rev-parse HEAD" returns the commit hash for HEAD.
+ return shell_utils.Bash([GIT, 'rev-parse', 'HEAD'],
+ log_in_real_time=False).rstrip('\n')
finally:
os.chdir(current_directory)
- return commit_hash
def Revert():
« no previous file with comments | « slave/skia_slave_scripts/run_bench.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698