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

Unified Diff: tools/submit_try

Issue 12726006: Use "svn cat" in tools/submit_try (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
===================================================================
--- tools/submit_try (revision 8147)
+++ tools/submit_try (working copy)
@@ -13,22 +13,31 @@
"""
-from contextlib import closing
-
import httplib
import json
import os
import subprocess
import sys
-import urllib2
+if os.name == 'nt':
+ SVN = 'svn.bat'
+else:
+ SVN = 'svn'
+
+
def GetGlobalVariables():
""" Retrieve a global variable from the global_variables.json file. """
global_variables_file = ('http://skia.googlecode.com/svn/buildbot/'
'site_config/global_variables.json')
- with closing(urllib2.urlopen(global_variables_file)) as f:
- return json.load(f)
+ proc = subprocess.Popen([SVN, 'cat', global_variables_file],
epoger 2013/03/14 14:51:41 It seems silly to have this subprocess-launching b
borenet 2013/03/14 17:18:05 Done.
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ exitcode = proc.wait()
+ if not exitcode == 0:
+ raise Exception('Could not retrieve global variables file from %s. '
+ 'Check your connection.' % global_variables_file)
+ global_variables = proc.communicate()[0]
+ return json.loads(global_variables)
epoger 2013/03/14 14:51:41 should be json.load() instead of json.loads() ? s
epoger 2013/03/14 14:54:49 Oh, I see this part is actually fine. Sorry about
borenet 2013/03/14 17:18:05 Removed the whole function, since it shouldn't get
GLOBAL_VARIABLES = GetGlobalVariables()
@@ -79,8 +88,7 @@
a git checkout.
"""
if is_svn:
- svn_cmd = 'svn.bat' if os.name == 'nt' else 'svn'
- cmd = [svn_cmd, 'info']
+ cmd = [SVN, 'info']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
if proc.wait() != 0:
« 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