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 """\ | 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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 899 |
900 # Change the current working directory before calling upload.py so that it | 900 # Change the current working directory before calling upload.py so that it |
901 # shows the correct base. | 901 # shows the correct base. |
902 previous_cwd = os.getcwd() | 902 previous_cwd = os.getcwd() |
903 os.chdir(change_info.GetLocalRoot()) | 903 os.chdir(change_info.GetLocalRoot()) |
904 # If we have a lot of files with long paths, then we won't be able to fit | 904 # If we have a lot of files with long paths, then we won't be able to fit |
905 # the command to "svn diff". Instead, we generate the diff manually for | 905 # the command to "svn diff". Instead, we generate the diff manually for |
906 # each file and concatenate them before passing it to upload.py. | 906 # each file and concatenate them before passing it to upload.py. |
907 if change_info.patch is None: | 907 if change_info.patch is None: |
908 change_info.patch = GenerateDiff(change_info.GetFileNames()) | 908 change_info.patch = GenerateDiff(change_info.GetFileNames()) |
909 issue, patchset = upload.RealMain(upload_arg, change_info.patch) | 909 try: |
| 910 issue, patchset = upload.RealMain(upload_arg, change_info.patch) |
| 911 except KeyboardInterrupt: |
| 912 sys.exit(1) |
910 if issue and patchset: | 913 if issue and patchset: |
911 change_info.issue = int(issue) | 914 change_info.issue = int(issue) |
912 change_info.patchset = int(patchset) | 915 change_info.patchset = int(patchset) |
913 change_info.Save() | 916 change_info.Save() |
914 | 917 |
915 if desc_file: | 918 if desc_file: |
916 os.remove(desc_file) | 919 os.remove(desc_file) |
917 change_info.PrimeLint() | 920 change_info.PrimeLint() |
918 os.chdir(previous_cwd) | 921 os.chdir(previous_cwd) |
919 print "*** Upload does not submit a try; use gcl try to submit a try. ***" | 922 print "*** Upload does not submit a try; use gcl try to submit a try. ***" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 raise | 1452 raise |
1450 print >> sys.stderr, ( | 1453 print >> sys.stderr, ( |
1451 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1454 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1452 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1455 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1453 return 1 | 1456 return 1 |
1454 | 1457 |
1455 | 1458 |
1456 if __name__ == "__main__": | 1459 if __name__ == "__main__": |
1457 fix_encoding.fix_encoding() | 1460 fix_encoding.fix_encoding() |
1458 sys.exit(main(sys.argv[1:])) | 1461 sys.exit(main(sys.argv[1:])) |
OLD | NEW |