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 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 'Instead send your job to the parent.\n' | 2125 'Instead send your job to the parent.\n' |
2126 'Bot list: %s' % builders_and_tests) | 2126 'Bot list: %s' % builders_and_tests) |
2127 return 1 | 2127 return 1 |
2128 | 2128 |
2129 patchset = cl.GetMostRecentPatchset() | 2129 patchset = cl.GetMostRecentPatchset() |
2130 if patchset and patchset != cl.GetPatchset(): | 2130 if patchset and patchset != cl.GetPatchset(): |
2131 print( | 2131 print( |
2132 '\nWARNING Mismatch between local config and server. Did a previous ' | 2132 '\nWARNING Mismatch between local config and server. Did a previous ' |
2133 'upload fail?\ngit-cl try always uses latest patchset from rietveld. ' | 2133 'upload fail?\ngit-cl try always uses latest patchset from rietveld. ' |
2134 'Continuing using\npatchset %s.\n' % patchset) | 2134 'Continuing using\npatchset %s.\n' % patchset) |
2135 | 2135 try: |
2136 cl.RpcServer().trigger_try_jobs( | 2136 cl.RpcServer().trigger_try_jobs( |
2137 cl.GetIssue(), patchset, options.name, options.clobber, options.revision, | 2137 cl.GetIssue(), patchset, options.name, options.clobber, |
2138 builders_and_tests) | 2138 options.revision, builders_and_tests) |
| 2139 except urllib2.HTTPError, e: |
| 2140 if e.code == 404: |
| 2141 print('404 from rietveld; ' |
| 2142 'did you mean to use "git try" instead of "git cl try"?') |
| 2143 return 1 |
2139 print('Tried jobs on:') | 2144 print('Tried jobs on:') |
2140 length = max(len(builder) for builder in builders_and_tests) | 2145 length = max(len(builder) for builder in builders_and_tests) |
2141 for builder in sorted(builders_and_tests): | 2146 for builder in sorted(builders_and_tests): |
2142 print ' %*s: %s' % (length, builder, ','.join(builders_and_tests[builder])) | 2147 print ' %*s: %s' % (length, builder, ','.join(builders_and_tests[builder])) |
2143 return 0 | 2148 return 0 |
2144 | 2149 |
2145 | 2150 |
2146 @subcommand.usage('[new upstream branch]') | 2151 @subcommand.usage('[new upstream branch]') |
2147 def CMDupstream(parser, args): | 2152 def CMDupstream(parser, args): |
2148 """Prints or sets the name of the upstream branch, if any.""" | 2153 """Prints or sets the name of the upstream branch, if any.""" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2373 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
2369 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2374 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
2370 | 2375 |
2371 | 2376 |
2372 if __name__ == '__main__': | 2377 if __name__ == '__main__': |
2373 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2378 # These affect sys.stdout so do it outside of main() to simplify mocks in |
2374 # unit testing. | 2379 # unit testing. |
2375 fix_encoding.fix_encoding() | 2380 fix_encoding.fix_encoding() |
2376 colorama.init() | 2381 colorama.init() |
2377 sys.exit(main(sys.argv[1:])) | 2382 sys.exit(main(sys.argv[1:])) |
OLD | NEW |