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

Unified Diff: tools/submit_try

Issue 141023003: Make tools/submit_try safer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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: tools/submit_try
diff --git a/tools/submit_try b/tools/submit_try
index e371afb23a05975ee5a74b92bfb2e1cf1e65f4e4..6647b89e1c1a8593de73314bbe958d156ffb87da 100755
--- a/tools/submit_try
+++ b/tools/submit_try
@@ -286,15 +286,17 @@ def SubmitTryRequest(args, is_svn=True):
cmd = [GIT, 'diff', git_cl.Changelist().GetUpstreamBranch(),
'--no-ext-diff']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- if proc.wait() != 0:
+ git_data = proc.communicate()
+ if git_data[0] is None:
raise Exception('Failed to capture git diff!')
temp_dir = tempfile.mkdtemp()
try:
diff_file = os.path.join(temp_dir, 'patch.diff')
with open(diff_file, 'wb') as f:
- f.write(proc.communicate()[0])
-
+ f.write(git_data[0])
+ f.close()
+
try_args = ['--use_svn',
'--svn_repo', GetTryRepo(),
'--root', GetCheckoutRoot(is_svn),
« 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