Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 if not swallow_exception: | 649 if not swallow_exception: |
| 650 if options.verbose == 0: | 650 if options.verbose == 0: |
| 651 logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT) | 651 logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT) |
| 652 elif options.verbose == 1: | 652 elif options.verbose == 1: |
| 653 logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) | 653 logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) |
| 654 elif options.verbose > 1: | 654 elif options.verbose > 1: |
| 655 logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT) | 655 logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT) |
| 656 | 656 |
| 657 logging.debug(argv) | 657 logging.debug(argv) |
| 658 | 658 |
| 659 if (options.patchlevel is not None and | |
| 660 (options.patchlevel < 0 or options.patchlevel > 10)): | |
| 661 parser.error( | |
| 662 'Have you tried --port instead? You probably confused -p and -P.') | |
|
Dirk Pranke
2011/10/13 00:46:33
Nit: I'd probably use something like 100 instead o
M-A Ruel
2011/10/13 00:47:32
No, it's patchlevel, like patch -p1, not the numbe
| |
| 663 | |
| 659 # Strip off any @ in the user, otherwise svn gets confused. | 664 # Strip off any @ in the user, otherwise svn gets confused. |
| 660 options.user = options.user.split('@', 1)[0] | 665 options.user = options.user.split('@', 1)[0] |
| 661 | 666 |
| 662 if options.rietveld_url: | 667 if options.rietveld_url: |
| 663 # Try to extract the review number if possible and fix the protocol. | 668 # Try to extract the review number if possible and fix the protocol. |
| 664 if not '://' in options.rietveld_url: | 669 if not '://' in options.rietveld_url: |
| 665 options.rietveld_url = 'http://' + options.rietveld_url | 670 options.rietveld_url = 'http://' + options.rietveld_url |
| 666 match = re.match(r'^(.*)/(\d+)/?$', options.rietveld_url) | 671 match = re.match(r'^(.*)/(\d+)/?$', options.rietveld_url) |
| 667 if match: | 672 if match: |
| 668 if options.issue or options.patchset: | 673 if options.issue or options.patchset: |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 809 return 1 | 814 return 1 |
| 810 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 815 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 811 print >> sys.stderr, e | 816 print >> sys.stderr, e |
| 812 return 1 | 817 return 1 |
| 813 return 0 | 818 return 0 |
| 814 | 819 |
| 815 | 820 |
| 816 if __name__ == "__main__": | 821 if __name__ == "__main__": |
| 817 fix_encoding.fix_encoding() | 822 fix_encoding.fix_encoding() |
| 818 sys.exit(TryChange(None, None, False)) | 823 sys.exit(TryChange(None, None, False)) |
| OLD | NEW |