| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 | 5 |
| 6 """Client-side script to send a try job to the try server. It communicates to | 6 """Client-side script to send a try job to the try server. It communicates to |
| 7 the try server by either writting to a svn repository or by directly connecting | 7 the try server by either writting to a svn repository or by directly connecting |
| 8 to the server by HTTP. | 8 to the server by HTTP. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 group.add_option("--dry_run", action='store_true', | 532 group.add_option("--dry_run", action='store_true', |
| 533 help="Don't send the try job. This implies --verbose, so " | 533 help="Don't send the try job. This implies --verbose, so " |
| 534 "it will print the diff.") | 534 "it will print the diff.") |
| 535 parser.add_option_group(group) | 535 parser.add_option_group(group) |
| 536 | 536 |
| 537 group = optparse.OptionGroup(parser, "Try job options") | 537 group = optparse.OptionGroup(parser, "Try job options") |
| 538 group.add_option("-b", "--bot", action="append", | 538 group.add_option("-b", "--bot", action="append", |
| 539 help="Only use specifics build slaves, ex: " | 539 help="Only use specifics build slaves, ex: " |
| 540 "'--bot win,layout_mac'; see the try " | 540 "'--bot win,layout_mac'; see the try " |
| 541 "server waterfall for the slave's name") | 541 "server waterfall for the slave's name") |
| 542 group.add_option("-B", "--print_bots", action="store_true", |
| 543 help="Print bots we would use (e.g. from PRESUBMIT.py)" |
| 544 " and exit. Do not send patch. Like --dry_run" |
| 545 " but less verbose.") |
| 542 group.add_option("-r", "--revision", | 546 group.add_option("-r", "--revision", |
| 543 help="Revision to use for the try job; default: the " | 547 help="Revision to use for the try job; default: the " |
| 544 "revision will be determined by the try server; see " | 548 "revision will be determined by the try server; see " |
| 545 "its waterfall for more info") | 549 "its waterfall for more info") |
| 546 group.add_option("-c", "--clobber", action="store_true", | 550 group.add_option("-c", "--clobber", action="store_true", |
| 547 help="Force a clobber before building; e.g. don't do an " | 551 help="Force a clobber before building; e.g. don't do an " |
| 548 "incremental build") | 552 "incremental build") |
| 549 # TODO(maruel): help="Select a specific configuration, usually 'debug' or " | 553 # TODO(maruel): help="Select a specific configuration, usually 'debug' or " |
| 550 # "'release'" | 554 # "'release'" |
| 551 group.add_option("--target", help=optparse.SUPPRESS_HELP) | 555 group.add_option("--target", help=optparse.SUPPRESS_HELP) |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 checkouts[0].checkout_root, | 785 checkouts[0].checkout_root, |
| 782 root_presubmit, | 786 root_presubmit, |
| 783 options.project, | 787 options.project, |
| 784 False, | 788 False, |
| 785 sys.stdout) | 789 sys.stdout) |
| 786 except ImportError: | 790 except ImportError: |
| 787 pass | 791 pass |
| 788 # If no bot is specified, either the default pool will be selected or the | 792 # If no bot is specified, either the default pool will be selected or the |
| 789 # try server will refuse the job. Either case we don't need to interfere. | 793 # try server will refuse the job. Either case we don't need to interfere. |
| 790 | 794 |
| 795 if options.print_bots: |
| 796 print 'Bots which would be used:' |
| 797 for bot in options.bot: |
| 798 print ' %s' % bot |
| 799 return 0 |
| 800 |
| 791 # Send the patch. | 801 # Send the patch. |
| 792 if options.send_patch: | 802 if options.send_patch: |
| 793 # If forced. | 803 # If forced. |
| 794 options.send_patch(options) | 804 options.send_patch(options) |
| 795 PrintSuccess(options) | 805 PrintSuccess(options) |
| 796 return 0 | 806 return 0 |
| 797 try: | 807 try: |
| 798 if can_http: | 808 if can_http: |
| 799 _SendChangeHTTP(options) | 809 _SendChangeHTTP(options) |
| 800 PrintSuccess(options) | 810 PrintSuccess(options) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 812 return 1 | 822 return 1 |
| 813 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 823 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 814 print >> sys.stderr, e | 824 print >> sys.stderr, e |
| 815 return 1 | 825 return 1 |
| 816 return 0 | 826 return 0 |
| 817 | 827 |
| 818 | 828 |
| 819 if __name__ == "__main__": | 829 if __name__ == "__main__": |
| 820 fix_encoding.fix_encoding() | 830 fix_encoding.fix_encoding() |
| 821 sys.exit(TryChange(None, None, False)) | 831 sys.exit(TryChange(None, None, False)) |
| OLD | NEW |