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 import datetime | 10 import datetime |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 help="Root to use for the patch; base subdirectory for " | 468 help="Root to use for the patch; base subdirectory for " |
469 "patch created in a subdirectory") | 469 "patch created in a subdirectory") |
470 group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", | 470 group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", |
471 help="Used as -pN parameter to patch") | 471 help="Used as -pN parameter to patch") |
472 group.add_option("-s", "--sub_rep", action="append", default=[], | 472 group.add_option("-s", "--sub_rep", action="append", default=[], |
473 help="Subcheckout to use in addition. This is mainly " | 473 help="Subcheckout to use in addition. This is mainly " |
474 "useful for gclient-style checkouts. Use @rev or " | 474 "useful for gclient-style checkouts. Use @rev or " |
475 "@branch or @branch1..branch2 to specify the " | 475 "@branch or @branch1..branch2 to specify the " |
476 "revision/branch to diff against.") | 476 "revision/branch to diff against.") |
477 # Mostly chromium-specific | 477 # Mostly chromium-specific |
478 group.add_option("--webkit", action="append_const", | 478 try: |
479 const="third_party/WebKit", | 479 group.add_option("--webkit", action="append_const", |
480 dest="sub_rep", | 480 const="third_party/WebKit", |
481 help="Shorthand for -s third_party/WebKit") | 481 dest="sub_rep", |
| 482 help="Shorthand for -s third_party/WebKit") |
| 483 except optparse.OptionError: |
| 484 # append_const is not supported on 2.4. Too bad. |
| 485 pass |
482 group.add_option("--no_gclient", action="store_true", | 486 group.add_option("--no_gclient", action="store_true", |
483 help="Disable automatic search for gclient checkout.") | 487 help="Disable automatic search for gclient checkout.") |
484 parser.add_option_group(group) | 488 parser.add_option_group(group) |
485 | 489 |
486 group = optparse.OptionGroup(parser, "Access the try server by HTTP") | 490 group = optparse.OptionGroup(parser, "Access the try server by HTTP") |
487 group.add_option("--use_http", | 491 group.add_option("--use_http", |
488 action="store_const", | 492 action="store_const", |
489 const=_SendChangeHTTP, | 493 const=_SendChangeHTTP, |
490 dest="send_patch", | 494 dest="send_patch", |
491 help="Use HTTP to talk to the try server [default]") | 495 help="Use HTTP to talk to the try server [default]") |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 except (InvalidScript, NoTryServerAccess), e: | 622 except (InvalidScript, NoTryServerAccess), e: |
619 if swallow_exception: | 623 if swallow_exception: |
620 return 1 | 624 return 1 |
621 print e | 625 print e |
622 return 1 | 626 return 1 |
623 return 0 | 627 return 0 |
624 | 628 |
625 | 629 |
626 if __name__ == "__main__": | 630 if __name__ == "__main__": |
627 sys.exit(TryChange(None, [], False)) | 631 sys.exit(TryChange(None, [], False)) |
OLD | NEW |