| 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.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
| 9 | 9 |
| 10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
| (...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2296 options, args = parser.parse_args(args) | 2296 options, args = parser.parse_args(args) |
| 2297 | 2297 |
| 2298 if args: | 2298 if args: |
| 2299 parser.error('Unknown arguments: %s' % args) | 2299 parser.error('Unknown arguments: %s' % args) |
| 2300 | 2300 |
| 2301 cl = Changelist() | 2301 cl = Changelist() |
| 2302 if not cl.GetIssue(): | 2302 if not cl.GetIssue(): |
| 2303 parser.error('Need to upload first') | 2303 parser.error('Need to upload first') |
| 2304 | 2304 |
| 2305 props = cl.GetIssueProperties() | 2305 props = cl.GetIssueProperties() |
| 2306 if props.get('closed'): |
| 2307 parser.error('Cannot send tryjobs for a closed CL') |
| 2308 |
| 2306 if props.get('private'): | 2309 if props.get('private'): |
| 2307 parser.error('Cannot use trybots with private issue') | 2310 parser.error('Cannot use trybots with private issue') |
| 2308 | 2311 |
| 2309 if not options.name: | 2312 if not options.name: |
| 2310 options.name = cl.GetBranch() | 2313 options.name = cl.GetBranch() |
| 2311 | 2314 |
| 2312 if options.bot and not options.master: | 2315 if options.bot and not options.master: |
| 2313 options.master, err_msg = GetBuilderMaster(options.bot) | 2316 options.master, err_msg = GetBuilderMaster(options.bot) |
| 2314 if err_msg: | 2317 if err_msg: |
| 2315 parser.error('Tryserver master cannot be found because: %s\n' | 2318 parser.error('Tryserver master cannot be found because: %s\n' |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2670 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2673 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2671 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2674 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2672 | 2675 |
| 2673 | 2676 |
| 2674 if __name__ == '__main__': | 2677 if __name__ == '__main__': |
| 2675 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2678 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2676 # unit testing. | 2679 # unit testing. |
| 2677 fix_encoding.fix_encoding() | 2680 fix_encoding.fix_encoding() |
| 2678 colorama.init() | 2681 colorama.init() |
| 2679 sys.exit(main(sys.argv[1:])) | 2682 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |