OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 """Client-side script to send a try job to the try server. It communicates to | 5 """Client-side script to send a try job to the try server. It communicates to |
6 the try server by either writting to a svn repository or by directly connecting | 6 the try server by either writting to a svn repository or by directly connecting |
7 to the server by HTTP. | 7 to the server by HTTP. |
8 """ | 8 """ |
9 | 9 |
10 import datetime | 10 import datetime |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 if not swallow_exception: | 595 if not swallow_exception: |
596 if options.verbose == 0: | 596 if options.verbose == 0: |
597 logging.basicConfig(level=logging.WARNING) | 597 logging.basicConfig(level=logging.WARNING) |
598 elif options.verbose == 1: | 598 elif options.verbose == 1: |
599 logging.basicConfig(level=logging.INFO) | 599 logging.basicConfig(level=logging.INFO) |
600 elif options.verbose > 1: | 600 elif options.verbose > 1: |
601 logging.basicConfig(level=logging.DEBUG) | 601 logging.basicConfig(level=logging.DEBUG) |
602 | 602 |
603 logging.debug(argv) | 603 logging.debug(argv) |
604 | 604 |
| 605 # Strip off any @ in the user, otherwise svn gets confused. |
| 606 options.user = options.user.split('@', 1)[0] |
| 607 |
605 if options.rietveld_url: | 608 if options.rietveld_url: |
606 # Try to extract the review number if possible and fix the protocol. | 609 # Try to extract the review number if possible and fix the protocol. |
607 if not '://' in options.rietveld_url: | 610 if not '://' in options.rietveld_url: |
608 options.rietveld_url = 'http://' + options.rietveld_url | 611 options.rietveld_url = 'http://' + options.rietveld_url |
609 match = re.match(r'^(.*)/(\d+)$', options.rietveld_url) | 612 match = re.match(r'^(.*)/(\d+)$', options.rietveld_url) |
610 if match: | 613 if match: |
611 if options.issue or options.patchset: | 614 if options.issue or options.patchset: |
612 parser.error('Cannot use both --issue and use a review number url') | 615 parser.error('Cannot use both --issue and use a review number url') |
613 options.issue = int(match.group(2)) | 616 options.issue = int(match.group(2)) |
614 options.rietveld_url = match.group(1) | 617 options.rietveld_url = match.group(1) |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 except (InvalidScript, NoTryServerAccess), e: | 724 except (InvalidScript, NoTryServerAccess), e: |
722 if swallow_exception: | 725 if swallow_exception: |
723 return 1 | 726 return 1 |
724 print e | 727 print e |
725 return 1 | 728 return 1 |
726 return 0 | 729 return 0 |
727 | 730 |
728 | 731 |
729 if __name__ == "__main__": | 732 if __name__ == "__main__": |
730 sys.exit(TryChange(None, [], False)) | 733 sys.exit(TryChange(None, [], False)) |
OLD | NEW |