| 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 # 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 json | 10 import json |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 if ': ' in line) | 1193 if ': ' in line) |
| 1194 remote_url = keys.get('URL', None) | 1194 remote_url = keys.get('URL', None) |
| 1195 else: | 1195 else: |
| 1196 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch(): | 1196 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch(): |
| 1197 remote_url = (cl.GetRemoteUrl() + '@' | 1197 remote_url = (cl.GetRemoteUrl() + '@' |
| 1198 + cl.GetUpstreamBranch().split('/')[-1]) | 1198 + cl.GetUpstreamBranch().split('/')[-1]) |
| 1199 if remote_url: | 1199 if remote_url: |
| 1200 upload_args.extend(['--base_url', remote_url]) | 1200 upload_args.extend(['--base_url', remote_url]) |
| 1201 | 1201 |
| 1202 try: | 1202 try: |
| 1203 issue, patchset = upload.RealMain(['upload'] + upload_args + args) | 1203 upload_args = ['upload'] + upload_args + args |
| 1204 logging.info('upload.RealMain(%s)', upload_args) |
| 1205 issue, patchset = upload.RealMain(upload_args) |
| 1204 except KeyboardInterrupt: | 1206 except KeyboardInterrupt: |
| 1205 sys.exit(1) | 1207 sys.exit(1) |
| 1206 except: | 1208 except: |
| 1207 # If we got an exception after the user typed a description for their | 1209 # If we got an exception after the user typed a description for their |
| 1208 # change, back up the description before re-raising. | 1210 # change, back up the description before re-raising. |
| 1209 if change_desc: | 1211 if change_desc: |
| 1210 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE) | 1212 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE) |
| 1211 print '\nGot exception while uploading -- saving description to %s\n' \ | 1213 print '\nGot exception while uploading -- saving description to %s\n' \ |
| 1212 % backup_path | 1214 % backup_path |
| 1213 backup_file = open(backup_path, 'w') | 1215 backup_file = open(backup_path, 'w') |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1864 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1863 | 1865 |
| 1864 # Not a known command. Default to help. | 1866 # Not a known command. Default to help. |
| 1865 GenUsage(parser, 'help') | 1867 GenUsage(parser, 'help') |
| 1866 return CMDhelp(parser, argv) | 1868 return CMDhelp(parser, argv) |
| 1867 | 1869 |
| 1868 | 1870 |
| 1869 if __name__ == '__main__': | 1871 if __name__ == '__main__': |
| 1870 fix_encoding.fix_encoding() | 1872 fix_encoding.fix_encoding() |
| 1871 sys.exit(main(sys.argv[1:])) | 1873 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |