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
This commit is contained in:
parent
4bbdeac58c
commit
6c55b513bf
@ -52,7 +52,7 @@ def FindDepotTools():
|
|||||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
if proc.wait() != 0:
|
if proc.wait() != 0:
|
||||||
raise Exception('Couldn\'t find depot_tools in PATH!')
|
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)
|
depot_tools_dir = os.path.dirname(gcl)
|
||||||
return depot_tools_dir
|
return depot_tools_dir
|
||||||
|
|
||||||
@ -64,7 +64,8 @@ def GetCheckoutRoot(is_svn=True):
|
|||||||
a git checkout.
|
a git checkout.
|
||||||
"""
|
"""
|
||||||
if is_svn:
|
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,
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
if proc.wait() != 0:
|
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.
|
- revision: optional, int; the revision number from which to run the try.
|
||||||
is_svn: boolean; are we in an SVN repo?
|
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])
|
botlist = ','.join(['%s%s' % (bot, TRYBOT_SUFFIX) for bot in args.bot])
|
||||||
if is_svn:
|
if is_svn:
|
||||||
import gcl
|
gcl_cmd = 'gcl.bat' if os.name == 'nt' else 'gcl'
|
||||||
try_args = [args.changelist, '--root', GetCheckoutRoot(is_svn),
|
try_args = [gcl_cmd, 'try', args.changelist,
|
||||||
|
'--root', GetCheckoutRoot(is_svn),
|
||||||
'--bot', botlist]
|
'--bot', botlist]
|
||||||
if args.revision:
|
if args.revision:
|
||||||
try_args.extend(['-r', 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:
|
else:
|
||||||
|
# First, find depot_tools. This is needed to import trychange.
|
||||||
|
sys.path.append(FindDepotTools())
|
||||||
import trychange
|
import trychange
|
||||||
try_args = ['--use_svn',
|
try_args = ['--use_svn',
|
||||||
'--svn_repo', GetTryRepo(),
|
'--svn_repo', GetTryRepo(),
|
||||||
|
1
tools/submit_try.bat
Normal file
1
tools/submit_try.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
python tools\submit_try %*
|
Loading…
Reference in New Issue
Block a user