| 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 import datetime | 10 import datetime |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 parser.add_option_group(group) | 2260 parser.add_option_group(group) |
| 2261 options, args = parser.parse_args(args) | 2261 options, args = parser.parse_args(args) |
| 2262 | 2262 |
| 2263 if args: | 2263 if args: |
| 2264 parser.error('Unknown arguments: %s' % args) | 2264 parser.error('Unknown arguments: %s' % args) |
| 2265 | 2265 |
| 2266 cl = Changelist() | 2266 cl = Changelist() |
| 2267 if not cl.GetIssue(): | 2267 if not cl.GetIssue(): |
| 2268 parser.error('Need to upload first') | 2268 parser.error('Need to upload first') |
| 2269 | 2269 |
| 2270 props = cl.GetIssueProperties() |
| 2271 if props.get('private'): |
| 2272 parser.error('Cannot use trybots with private issue') |
| 2273 |
| 2270 if not options.name: | 2274 if not options.name: |
| 2271 options.name = cl.GetBranch() | 2275 options.name = cl.GetBranch() |
| 2272 | 2276 |
| 2273 if options.bot and not options.master: | 2277 if options.bot and not options.master: |
| 2274 parser.error('For manually specified bots please also specify the ' | 2278 parser.error('For manually specified bots please also specify the ' |
| 2275 'tryserver master, e.g. "-m tryserver.chromium".') | 2279 'tryserver master, e.g. "-m tryserver.chromium".') |
| 2276 | 2280 |
| 2277 def GetMasterMap(): | 2281 def GetMasterMap(): |
| 2278 # Process --bot and --testfilter. | 2282 # Process --bot and --testfilter. |
| 2279 if not options.bot: | 2283 if not options.bot: |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2405 webbrowser.open(issue_url) | 2409 webbrowser.open(issue_url) |
| 2406 return 0 | 2410 return 0 |
| 2407 | 2411 |
| 2408 | 2412 |
| 2409 def CMDset_commit(parser, args): | 2413 def CMDset_commit(parser, args): |
| 2410 """Sets the commit bit to trigger the Commit Queue.""" | 2414 """Sets the commit bit to trigger the Commit Queue.""" |
| 2411 _, args = parser.parse_args(args) | 2415 _, args = parser.parse_args(args) |
| 2412 if args: | 2416 if args: |
| 2413 parser.error('Unrecognized args: %s' % ' '.join(args)) | 2417 parser.error('Unrecognized args: %s' % ' '.join(args)) |
| 2414 cl = Changelist() | 2418 cl = Changelist() |
| 2419 props = cl.GetIssueProperties() |
| 2420 if props.get('private'): |
| 2421 parser.error('Cannot set commit on private issue') |
| 2415 cl.SetFlag('commit', '1') | 2422 cl.SetFlag('commit', '1') |
| 2416 return 0 | 2423 return 0 |
| 2417 | 2424 |
| 2418 | 2425 |
| 2419 def CMDset_close(parser, args): | 2426 def CMDset_close(parser, args): |
| 2420 """Closes the issue.""" | 2427 """Closes the issue.""" |
| 2421 _, args = parser.parse_args(args) | 2428 _, args = parser.parse_args(args) |
| 2422 if args: | 2429 if args: |
| 2423 parser.error('Unrecognized args: %s' % ' '.join(args)) | 2430 parser.error('Unrecognized args: %s' % ' '.join(args)) |
| 2424 cl = Changelist() | 2431 cl = Changelist() |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2625 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2632 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2626 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2633 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2627 | 2634 |
| 2628 | 2635 |
| 2629 if __name__ == '__main__': | 2636 if __name__ == '__main__': |
| 2630 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2637 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2631 # unit testing. | 2638 # unit testing. |
| 2632 fix_encoding.fix_encoding() | 2639 fix_encoding.fix_encoding() |
| 2633 colorama.init() | 2640 colorama.init() |
| 2634 sys.exit(main(sys.argv[1:])) | 2641 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |