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 # 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 import errno | 10 import errno |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 remote_url = keys.get('URL', None) | 977 remote_url = keys.get('URL', None) |
978 else: | 978 else: |
979 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch(): | 979 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch(): |
980 remote_url = (cl.GetRemoteUrl() + '@' | 980 remote_url = (cl.GetRemoteUrl() + '@' |
981 + cl.GetUpstreamBranch().split('/')[-1]) | 981 + cl.GetUpstreamBranch().split('/')[-1]) |
982 if remote_url: | 982 if remote_url: |
983 upload_args.extend(['--base_url', remote_url]) | 983 upload_args.extend(['--base_url', remote_url]) |
984 | 984 |
985 try: | 985 try: |
986 issue, patchset = upload.RealMain(['upload'] + upload_args + args) | 986 issue, patchset = upload.RealMain(['upload'] + upload_args + args) |
| 987 except KeyboardInterrupt: |
| 988 sys.exit(1) |
987 except: | 989 except: |
988 # If we got an exception after the user typed a description for their | 990 # If we got an exception after the user typed a description for their |
989 # change, back up the description before re-raising. | 991 # change, back up the description before re-raising. |
990 if change_desc: | 992 if change_desc: |
991 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE) | 993 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE) |
992 print '\nGot exception while uploading -- saving description to %s\n' \ | 994 print '\nGot exception while uploading -- saving description to %s\n' \ |
993 % backup_path | 995 % backup_path |
994 backup_file = open(backup_path, 'w') | 996 backup_file = open(backup_path, 'w') |
995 backup_file.write(change_desc.description) | 997 backup_file.write(change_desc.description) |
996 backup_file.close() | 998 backup_file.close() |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1424 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1423 | 1425 |
1424 # Not a known command. Default to help. | 1426 # Not a known command. Default to help. |
1425 GenUsage(parser, 'help') | 1427 GenUsage(parser, 'help') |
1426 return CMDhelp(parser, argv) | 1428 return CMDhelp(parser, argv) |
1427 | 1429 |
1428 | 1430 |
1429 if __name__ == '__main__': | 1431 if __name__ == '__main__': |
1430 fix_encoding.fix_encoding() | 1432 fix_encoding.fix_encoding() |
1431 sys.exit(main(sys.argv[1:])) | 1433 sys.exit(main(sys.argv[1:])) |
OLD | NEW |