| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 """Client-side script to send a try job to the try server. It communicates to | 5 """Client-side script to send a try job to the try server. It communicates to |
| 6 the try server by either writting to a svn repository or by directly connecting | 6 the try server by either writting to a svn repository or by directly connecting |
| 7 to the server by HTTP. | 7 to the server by HTTP. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 | 10 |
| 11 import datetime | 11 import datetime |
| 12 import getpass | 12 import getpass |
| 13 import logging | 13 import logging |
| 14 import optparse | 14 import optparse |
| 15 import os | 15 import os |
| 16 import shutil | 16 import shutil |
| 17 import socket | 17 import socket |
| 18 import sys | 18 import sys |
| 19 import tempfile | 19 import tempfile |
| 20 import traceback | 20 import traceback |
| 21 import urllib | 21 import urllib |
| 22 | 22 |
| 23 import gcl | 23 import gcl |
| 24 import gclient | 24 import gclient |
| 25 import upload | 25 import upload |
| 26 | 26 |
| 27 __version__ = '1.1' | 27 __version__ = '1.1.1' |
| 28 | 28 |
| 29 | 29 |
| 30 # Constants | 30 # Constants |
| 31 HELP_STRING = "Sorry, Tryserver is not available." | 31 HELP_STRING = "Sorry, Tryserver is not available." |
| 32 USAGE = r"""%prog [options] | 32 USAGE = r"""%prog [options] |
| 33 | 33 |
| 34 Client-side script to send a try job to the try server. It communicates to | 34 Client-side script to send a try job to the try server. It communicates to |
| 35 the try server by either writting to a svn repository or by directly connecting | 35 the try server by either writting to a svn repository or by directly connecting |
| 36 to the server by HTTP. | 36 to the server by HTTP. |
| 37 | 37 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if options.tests: | 246 if options.tests: |
| 247 values['tests'] = ','.join(options.tests) | 247 values['tests'] = ','.join(options.tests) |
| 248 if options.root: | 248 if options.root: |
| 249 values['root'] = options.root | 249 values['root'] = options.root |
| 250 if options.patchlevel: | 250 if options.patchlevel: |
| 251 values['patchlevel'] = options.patchlevel | 251 values['patchlevel'] = options.patchlevel |
| 252 if options.issue: | 252 if options.issue: |
| 253 values['issue'] = options.issue | 253 values['issue'] = options.issue |
| 254 if options.patchset: | 254 if options.patchset: |
| 255 values['patchset'] = options.patchset | 255 values['patchset'] = options.patchset |
| 256 if options.target: |
| 257 values['target'] = options.target |
| 256 return values | 258 return values |
| 257 | 259 |
| 258 | 260 |
| 259 def _SendChangeHTTP(options): | 261 def _SendChangeHTTP(options): |
| 260 """Send a change to the try server using the HTTP protocol.""" | 262 """Send a change to the try server using the HTTP protocol.""" |
| 261 if not options.host: | 263 if not options.host: |
| 262 raise NoTryServerAccess('Please use the --host option to specify the try ' | 264 raise NoTryServerAccess('Please use the --host option to specify the try ' |
| 263 'server host to connect to.') | 265 'server host to connect to.') |
| 264 if not options.port: | 266 if not options.port: |
| 265 raise NoTryServerAccess('Please use the --port option to specify the try ' | 267 raise NoTryServerAccess('Please use the --port option to specify the try ' |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 help="Only use specifics build slaves, ex: '--bot win' to " | 418 help="Only use specifics build slaves, ex: '--bot win' to " |
| 417 "run the try job only on the 'win' slave; see the try " | 419 "run the try job only on the 'win' slave; see the try " |
| 418 "server watefall for the slave's name") | 420 "server watefall for the slave's name") |
| 419 group.add_option("-r", "--revision", | 421 group.add_option("-r", "--revision", |
| 420 help="Revision to use for the try job; default: the " | 422 help="Revision to use for the try job; default: the " |
| 421 "revision will be determined by the try server; see " | 423 "revision will be determined by the try server; see " |
| 422 "its waterfall for more info") | 424 "its waterfall for more info") |
| 423 group.add_option("-c", "--clobber", action="store_true", | 425 group.add_option("-c", "--clobber", action="store_true", |
| 424 help="Force a clobber before building; e.g. don't do an " | 426 help="Force a clobber before building; e.g. don't do an " |
| 425 "incremental build") | 427 "incremental build") |
| 428 # TODO(maruel): help="Select a specific configuration, usually 'debug' or " |
| 429 # "'release'" |
| 430 group.add_option("--target", help=optparse.SUPPRESS_HELP) |
| 431 |
| 426 # Override the list of tests to run, use multiple times to list many tests | 432 # Override the list of tests to run, use multiple times to list many tests |
| 427 # (or comma separated) | 433 # (or comma separated) |
| 428 group.add_option("-t", "--tests", action="append", | 434 group.add_option("-t", "--tests", action="append", |
| 429 help=optparse.SUPPRESS_HELP) | 435 help=optparse.SUPPRESS_HELP) |
| 430 parser.add_option_group(group) | 436 parser.add_option_group(group) |
| 431 | 437 |
| 432 group = optparse.OptionGroup(parser, "Patch to run") | 438 group = optparse.OptionGroup(parser, "Patch to run") |
| 433 group.add_option("-f", "--file", default=file_list, dest="files", | 439 group.add_option("-f", "--file", default=file_list, dest="files", |
| 434 metavar="FILE", action="append", | 440 metavar="FILE", action="append", |
| 435 help="Use many times to list the files to include in the " | 441 help="Use many times to list the files to include in the " |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 if patch_name == 'Unnamed': | 520 if patch_name == 'Unnamed': |
| 515 print "Note: use --name NAME to change the try's name." | 521 print "Note: use --name NAME to change the try's name." |
| 516 except (InvalidScript, NoTryServerAccess), e: | 522 except (InvalidScript, NoTryServerAccess), e: |
| 517 if swallow_exception: | 523 if swallow_exception: |
| 518 return | 524 return |
| 519 print e | 525 print e |
| 520 | 526 |
| 521 | 527 |
| 522 if __name__ == "__main__": | 528 if __name__ == "__main__": |
| 523 TryChange(None, None, False) | 529 TryChange(None, None, False) |
| OLD | NEW |