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 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
9 | 9 |
10 from __future__ import print_function | 10 from __future__ import print_function |
(...skipping 4638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4649 'key2=value2 etc. The value will be treated as ' | 4649 'key2=value2 etc. The value will be treated as ' |
4650 'json if decodable, or as string otherwise. ' | 4650 'json if decodable, or as string otherwise. ' |
4651 'NOTE: using this may make your try job not usable for CQ, ' | 4651 'NOTE: using this may make your try job not usable for CQ, ' |
4652 'which will then schedule another try job with default properties') | 4652 'which will then schedule another try job with default properties') |
4653 # TODO(tandrii): if this even used? | 4653 # TODO(tandrii): if this even used? |
4654 group.add_option( | 4654 group.add_option( |
4655 '-n', '--name', help='Try job name; default to current branch name') | 4655 '-n', '--name', help='Try job name; default to current branch name') |
4656 # TODO(tandrii): get rid of this. | 4656 # TODO(tandrii): get rid of this. |
4657 group.add_option( | 4657 group.add_option( |
4658 '--use-rietveld', action='store_true', default=False, | 4658 '--use-rietveld', action='store_true', default=False, |
4659 help='Use Rietveld to trigger try jobs.') | 4659 help='DEPRECATED, NOT SUPPORTED.') |
4660 group.add_option( | 4660 group.add_option( |
4661 '--buildbucket-host', default='cr-buildbucket.appspot.com', | 4661 '--buildbucket-host', default='cr-buildbucket.appspot.com', |
4662 help='Host of buildbucket. The default host is %default.') | 4662 help='Host of buildbucket. The default host is %default.') |
4663 parser.add_option_group(group) | 4663 parser.add_option_group(group) |
4664 auth.add_auth_options(parser) | 4664 auth.add_auth_options(parser) |
4665 options, args = parser.parse_args(args) | 4665 options, args = parser.parse_args(args) |
4666 auth_config = auth.extract_auth_config_from_options(options) | 4666 auth_config = auth.extract_auth_config_from_options(options) |
4667 | 4667 |
4668 if options.use_rietveld and options.properties: | 4668 if options.use_rietveld: |
4669 parser.error('Properties can only be specified with buildbucket') | 4669 parser.error('--use-rietveld is not longer supported.') |
4670 | 4670 |
4671 # Make sure that all properties are prop=value pairs. | 4671 # Make sure that all properties are prop=value pairs. |
4672 bad_params = [x for x in options.properties if '=' not in x] | 4672 bad_params = [x for x in options.properties if '=' not in x] |
4673 if bad_params: | 4673 if bad_params: |
4674 parser.error('Got properties with missing "=": %s' % bad_params) | 4674 parser.error('Got properties with missing "=": %s' % bad_params) |
4675 | 4675 |
4676 if args: | 4676 if args: |
4677 parser.error('Unknown arguments: %s' % args) | 4677 parser.error('Unknown arguments: %s' % args) |
4678 | 4678 |
4679 cl = Changelist(auth_config=auth_config) | 4679 cl = Changelist(auth_config=auth_config) |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5317 if __name__ == '__main__': | 5317 if __name__ == '__main__': |
5318 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5318 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5319 # unit testing. | 5319 # unit testing. |
5320 fix_encoding.fix_encoding() | 5320 fix_encoding.fix_encoding() |
5321 setup_color.init() | 5321 setup_color.init() |
5322 try: | 5322 try: |
5323 sys.exit(main(sys.argv[1:])) | 5323 sys.exit(main(sys.argv[1:])) |
5324 except KeyboardInterrupt: | 5324 except KeyboardInterrupt: |
5325 sys.stderr.write('interrupted\n') | 5325 sys.stderr.write('interrupted\n') |
5326 sys.exit(1) | 5326 sys.exit(1) |
OLD | NEW |