diff options
author | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-24 21:38:51 +0000 |
---|---|---|
committer | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-24 21:38:51 +0000 |
commit | 6c55b513bfbb9d04d0339715637c356cd4858663 (patch) | |
tree | 6f2a180f7ac5d14090cb31c827a7e331672763eb /tools | |
parent | 4bbdeac58cc928dc66296bde3bd06e78070d96b7 (diff) |
Modify submit_try to work on windows
Review URL: https://codereview.appspot.com/7199053
git-svn-id: http://skia.googlecode.com/svn/trunk@7379 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/submit_try | 23 | ||||
-rw-r--r-- | tools/submit_try.bat | 1 |
2 files changed, 16 insertions, 8 deletions
diff --git a/tools/submit_try b/tools/submit_try index d62c9fb5c6..2d18fc653f 100755 --- a/tools/submit_try +++ b/tools/submit_try @@ -52,7 +52,7 @@ def FindDepotTools(): proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if proc.wait() != 0: raise Exception('Couldn\'t find depot_tools in PATH!') - gcl = proc.communicate()[0] + gcl = proc.communicate()[0].split('\n')[0].rstrip() depot_tools_dir = os.path.dirname(gcl) return depot_tools_dir @@ -64,7 +64,8 @@ def GetCheckoutRoot(is_svn=True): a git checkout. """ if is_svn: - cmd = ['svn', 'info'] + svn_cmd = 'svn.bat' if os.name == 'nt' else 'svn' + cmd = [svn_cmd, 'info'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if proc.wait() != 0: @@ -165,18 +166,24 @@ def SubmitTryRequest(args, is_svn=True): - revision: optional, int; the revision number from which to run the try. is_svn: boolean; are we in an SVN repo? """ - # First, find depot_tools. This is needed for the imports below. - sys.path.append(FindDepotTools()) - botlist = ','.join(['%s%s' % (bot, TRYBOT_SUFFIX) for bot in args.bot]) if is_svn: - import gcl - try_args = [args.changelist, '--root', GetCheckoutRoot(is_svn), + gcl_cmd = 'gcl.bat' if os.name == 'nt' else 'gcl' + try_args = [gcl_cmd, 'try', args.changelist, + '--root', GetCheckoutRoot(is_svn), '--bot', botlist] if args.revision: try_args.extend(['-r', args.revision]) - gcl.CMDtry(try_args) + print ' '.join(try_args) + proc = subprocess.Popen(try_args, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + if proc.wait() != 0: + raise Exception('Failed to submit try request: %s' % ( + proc.communicate()[0])) + print proc.communicate()[0] else: + # First, find depot_tools. This is needed to import trychange. + sys.path.append(FindDepotTools()) import trychange try_args = ['--use_svn', '--svn_repo', GetTryRepo(), diff --git a/tools/submit_try.bat b/tools/submit_try.bat new file mode 100644 index 0000000000..d1d5392868 --- /dev/null +++ b/tools/submit_try.bat @@ -0,0 +1 @@ +python tools\submit_try %*
\ No newline at end of file |