Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: git_cl.py

Issue 21020008: Explicitly convert issue and patchset to int. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 difflib 10 import difflib
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch(): 1405 if cl.GetRemoteUrl() and '/' in cl.GetUpstreamBranch():
1406 remote_url = (cl.GetRemoteUrl() + '@' 1406 remote_url = (cl.GetRemoteUrl() + '@'
1407 + cl.GetUpstreamBranch().split('/')[-1]) 1407 + cl.GetUpstreamBranch().split('/')[-1])
1408 if remote_url: 1408 if remote_url:
1409 upload_args.extend(['--base_url', remote_url]) 1409 upload_args.extend(['--base_url', remote_url])
1410 1410
1411 try: 1411 try:
1412 upload_args = ['upload'] + upload_args + args 1412 upload_args = ['upload'] + upload_args + args
1413 logging.info('upload.RealMain(%s)', upload_args) 1413 logging.info('upload.RealMain(%s)', upload_args)
1414 issue, patchset = upload.RealMain(upload_args) 1414 issue, patchset = upload.RealMain(upload_args)
1415 issue = int(issue)
1416 patchset = int(patchset)
1415 except KeyboardInterrupt: 1417 except KeyboardInterrupt:
1416 sys.exit(1) 1418 sys.exit(1)
1417 except: 1419 except:
1418 # If we got an exception after the user typed a description for their 1420 # If we got an exception after the user typed a description for their
1419 # change, back up the description before re-raising. 1421 # change, back up the description before re-raising.
1420 if change_desc: 1422 if change_desc:
1421 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE) 1423 backup_path = os.path.expanduser(DESCRIPTION_BACKUP_FILE)
1422 print '\nGot exception while uploading -- saving description to %s\n' \ 1424 print '\nGot exception while uploading -- saving description to %s\n' \
1423 % backup_path 1425 % backup_path
1424 backup_file = open(backup_path, 'w') 1426 backup_file = open(backup_path, 'w')
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 GenUsage(parser, 'help') 2271 GenUsage(parser, 'help')
2270 return CMDhelp(parser, argv) 2272 return CMDhelp(parser, argv)
2271 2273
2272 2274
2273 if __name__ == '__main__': 2275 if __name__ == '__main__':
2274 # These affect sys.stdout so do it outside of main() to simplify mocks in 2276 # These affect sys.stdout so do it outside of main() to simplify mocks in
2275 # unit testing. 2277 # unit testing.
2276 fix_encoding.fix_encoding() 2278 fix_encoding.fix_encoding()
2277 colorama.init() 2279 colorama.init()
2278 sys.exit(main(sys.argv[1:])) 2280 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698