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 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 metavar="SVN_URL", | 478 metavar="SVN_URL", |
479 default=default_settings['svn_repo'], | 479 default=default_settings['svn_repo'], |
480 help="SVN url to use to write the changes in; --use_svn is " | 480 help="SVN url to use to write the changes in; --use_svn is " |
481 "implied when using --svn_repo") | 481 "implied when using --svn_repo") |
482 parser.add_option_group(group) | 482 parser.add_option_group(group) |
483 | 483 |
484 options, args = parser.parse_args(argv) | 484 options, args = parser.parse_args(argv) |
485 | 485 |
486 # Switch the default accordingly if there was no default send_patch. | 486 # Switch the default accordingly if there was no default send_patch. |
487 if not options.send_patch: | 487 if not options.send_patch: |
488 if options.http_port and options.http_host: | 488 if options.port and options.host: |
489 options.send_patch = _SendChangeHTTP | 489 options.send_patch = _SendChangeHTTP |
490 elif options.svn_repo: | 490 elif options.svn_repo: |
491 options.send_patch = _SendChangeSVN | 491 options.send_patch = _SendChangeSVN |
492 | 492 |
493 if len(args) == 1 and args[0] == 'help': | 493 if len(args) == 1 and args[0] == 'help': |
494 parser.print_help() | 494 parser.print_help() |
495 if (not options.files and (not options.issue and options.patchset) and | 495 if (not options.files and (not options.issue and options.patchset) and |
496 not options.diff and not options.url): | 496 not options.diff and not options.url): |
497 # TODO(maruel): It should just try the modified files showing up in a | 497 # TODO(maruel): It should just try the modified files showing up in a |
498 # svn status. | 498 # svn status. |
(...skipping 21 matching lines...) Expand all Loading... |
520 if patch_name == 'Unnamed': | 520 if patch_name == 'Unnamed': |
521 print "Note: use --name NAME to change the try's name." | 521 print "Note: use --name NAME to change the try's name." |
522 except (InvalidScript, NoTryServerAccess), e: | 522 except (InvalidScript, NoTryServerAccess), e: |
523 if swallow_exception: | 523 if swallow_exception: |
524 return | 524 return |
525 print e | 525 print e |
526 | 526 |
527 | 527 |
528 if __name__ == "__main__": | 528 if __name__ == "__main__": |
529 TryChange(None, None, False) | 529 TryChange(None, None, False) |
OLD | NEW |