| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 def WebKitRevision(options, opt, value, parser): | 515 def WebKitRevision(options, opt, value, parser): |
| 516 if not hasattr(options, 'sub_rep'): |
| 517 options.sub_rep = [] |
| 516 if parser.rargs and not parser.rargs[0].startswith('-'): | 518 if parser.rargs and not parser.rargs[0].startswith('-'): |
| 517 options.sub_rep.append('third_party/WebKit@%s' % parser.rargs.pop(0)) | 519 options.sub_rep.append('third_party/WebKit@%s' % parser.rargs.pop(0)) |
| 518 else: | 520 else: |
| 519 options.sub_rep.append('third_party/WebKit') | 521 options.sub_rep.append('third_party/WebKit') |
| 520 | 522 |
| 521 group.add_option("-W", "--webkit", action="callback", | 523 group.add_option("-W", "--webkit", action="callback", |
| 522 callback=WebKitRevision, | 524 callback=WebKitRevision, |
| 523 metavar="BRANCH", | 525 metavar="BRANCH", |
| 524 help="Shorthand for -s third_party/WebKit@BRANCH. " | 526 help="Shorthand for -s third_party/WebKit@BRANCH. " |
| 525 "BRANCH is optional and is the branch the current " | 527 "BRANCH is optional and is the branch the current " |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 except (InvalidScript, NoTryServerAccess), e: | 694 except (InvalidScript, NoTryServerAccess), e: |
| 693 if swallow_exception: | 695 if swallow_exception: |
| 694 return 1 | 696 return 1 |
| 695 print e | 697 print e |
| 696 return 1 | 698 return 1 |
| 697 return 0 | 699 return 0 |
| 698 | 700 |
| 699 | 701 |
| 700 if __name__ == "__main__": | 702 if __name__ == "__main__": |
| 701 sys.exit(TryChange(None, [], False)) | 703 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |