Chromium Code Reviews| 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 """\ | 6 """\ |
| 7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
| 8 of files. | 8 of files. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 818 output = OptionallyDoPresubmitChecks(change_info, False, args) | 818 output = OptionallyDoPresubmitChecks(change_info, False, args) |
| 819 if not output.should_continue(): | 819 if not output.should_continue(): |
| 820 return 1 | 820 return 1 |
| 821 no_watchlists = (FilterFlag(args, "--no_watchlists") or | 821 no_watchlists = (FilterFlag(args, "--no_watchlists") or |
| 822 FilterFlag(args, "--no-watchlists")) | 822 FilterFlag(args, "--no-watchlists")) |
| 823 | 823 |
| 824 # Map --send-mail to --send_mail | 824 # Map --send-mail to --send_mail |
| 825 if FilterFlag(args, "--send-mail"): | 825 if FilterFlag(args, "--send-mail"): |
| 826 args.append("--send_mail") | 826 args.append("--send_mail") |
| 827 | 827 |
| 828 # Replace -m or --message with -t. | 828 # Replace -m with -t. Replace --message with --title, but make sure to |
| 829 args = map(lambda a: '-t' if (a == '-m' or a == '--message') else a, args) | 829 # preserve anything after the --message. |
| 830 | 830 def replace_message(a): |
| 831 if a == '-m': | |
|
M-A Ruel
2012/05/14 14:17:39
Note that
gcl upload foo -mbleh
works.
Roger Tawa OOO till Jul 10th
2012/05/14 16:09:50
Didn't know that, fixed.
| |
| 832 return '-t' | |
| 833 elif a.startswith('--message'): | |
| 834 return '--title' + a[9:] | |
| 835 return a | |
| 836 args = map(replace_message, args) | |
|
M-A Ruel
2012/05/14 14:17:39
What about printing out a warning message when one
Roger Tawa OOO till Jul 10th
2012/05/14 16:09:50
Yes, good idea. Done.
| |
| 831 | 837 |
| 832 upload_arg = ["upload.py", "-y"] | 838 upload_arg = ["upload.py", "-y"] |
| 833 upload_arg.append("--server=%s" % change_info.rietveld) | 839 upload_arg.append("--server=%s" % change_info.rietveld) |
| 834 | 840 |
| 835 reviewers = change_info.reviewers or output.reviewers | 841 reviewers = change_info.reviewers or output.reviewers |
| 836 if (reviewers and | 842 if (reviewers and |
| 837 not any(arg.startswith('-r') or arg.startswith('--reviewer') for | 843 not any(arg.startswith('-r') or arg.startswith('--reviewer') for |
| 838 arg in args)): | 844 arg in args)): |
| 839 upload_arg.append('--reviewers=%s' % ','.join(reviewers)) | 845 upload_arg.append('--reviewers=%s' % ','.join(reviewers)) |
| 840 | 846 |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1441 raise | 1447 raise |
| 1442 print >> sys.stderr, ( | 1448 print >> sys.stderr, ( |
| 1443 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1449 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 1444 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1450 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
| 1445 return 1 | 1451 return 1 |
| 1446 | 1452 |
| 1447 | 1453 |
| 1448 if __name__ == "__main__": | 1454 if __name__ == "__main__": |
| 1449 fix_encoding.fix_encoding() | 1455 fix_encoding.fix_encoding() |
| 1450 sys.exit(main(sys.argv[1:])) | 1456 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |