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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 "patch created in a subdirectory") | 505 "patch created in a subdirectory") |
506 group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", | 506 group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", |
507 help="Used as -pN parameter to patch") | 507 help="Used as -pN parameter to patch") |
508 group.add_option("-s", "--sub_rep", action="append", default=[], | 508 group.add_option("-s", "--sub_rep", action="append", default=[], |
509 help="Subcheckout to use in addition. This is mainly " | 509 help="Subcheckout to use in addition. This is mainly " |
510 "useful for gclient-style checkouts. Use @rev or " | 510 "useful for gclient-style checkouts. Use @rev or " |
511 "@branch or @branch1..branch2 to specify the " | 511 "@branch or @branch1..branch2 to specify the " |
512 "revision/branch to diff against.") | 512 "revision/branch to diff against.") |
513 # Mostly chromium-specific | 513 # Mostly chromium-specific |
514 try: | 514 try: |
515 group.add_option("--webkit", action="append_const", | 515 def WebKitRevision(options, opt, value, parser): |
516 const="third_party/WebKit", | 516 if parser.rargs and not parser.rargs[0].startswith('-'): |
517 dest="PATH", | 517 options.sub_rep.append('third_party/WebKit@%s' % parser.rargs.pop(0)) |
518 help="Shorthand for -s third_party/WebKit") | 518 else: |
| 519 options.sub_rep.append('third_party/WebKit') |
| 520 |
| 521 group.add_option("-W", "--webkit", action="callback", |
| 522 callback=WebKitRevision, |
| 523 metavar="BRANCH", |
| 524 help="Shorthand for -s third_party/WebKit@BRANCH. " |
| 525 "BRANCH is optional and is the branch the current " |
| 526 "checkout will be diff'ed against.") |
519 except optparse.OptionError: | 527 except optparse.OptionError: |
520 # append_const is not supported on 2.4. Too bad. | 528 # append_const is not supported on 2.4. Too bad. |
521 pass | 529 pass |
522 group.add_option("--no_gclient", action="store_true", | 530 group.add_option("--no_gclient", action="store_true", |
523 help="Disable automatic search for gclient checkout.") | 531 help="Disable automatic search for gclient checkout.") |
524 group.add_option("-E", "--exclude", action="append", | 532 group.add_option("-E", "--exclude", action="append", |
525 default=['ChangeLog'], metavar='REGEXP', | 533 default=['ChangeLog'], metavar='REGEXP', |
526 help="Regexp patterns to exclude files. Default: %default") | 534 help="Regexp patterns to exclude files. Default: %default") |
527 parser.add_option_group(group) | 535 parser.add_option_group(group) |
528 | 536 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 except (InvalidScript, NoTryServerAccess), e: | 692 except (InvalidScript, NoTryServerAccess), e: |
685 if swallow_exception: | 693 if swallow_exception: |
686 return 1 | 694 return 1 |
687 print e | 695 print e |
688 return 1 | 696 return 1 |
689 return 0 | 697 return 0 |
690 | 698 |
691 | 699 |
692 if __name__ == "__main__": | 700 if __name__ == "__main__": |
693 sys.exit(TryChange(None, [], False)) | 701 sys.exit(TryChange(None, [], False)) |
OLD | NEW |