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 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1414 | 1414 |
1415 def RietveldUpload(options, args, cl): | 1415 def RietveldUpload(options, args, cl): |
1416 """upload the patch to rietveld.""" | 1416 """upload the patch to rietveld.""" |
1417 upload_args = ['--assume_yes'] # Don't ask about untracked files. | 1417 upload_args = ['--assume_yes'] # Don't ask about untracked files. |
1418 upload_args.extend(['--server', cl.GetRietveldServer()]) | 1418 upload_args.extend(['--server', cl.GetRietveldServer()]) |
1419 if options.emulate_svn_auto_props: | 1419 if options.emulate_svn_auto_props: |
1420 upload_args.append('--emulate_svn_auto_props') | 1420 upload_args.append('--emulate_svn_auto_props') |
1421 | 1421 |
1422 change_desc = None | 1422 change_desc = None |
1423 | 1423 |
1424 if options.email is not None: | |
1425 upload_args.extend(['--email', options.email]) | |
1426 | |
1424 if cl.GetIssue(): | 1427 if cl.GetIssue(): |
1425 if options.title: | 1428 if options.title: |
1426 upload_args.extend(['--title', options.title]) | 1429 upload_args.extend(['--title', options.title]) |
1427 if options.message: | 1430 if options.message: |
1428 upload_args.extend(['--message', options.message]) | 1431 upload_args.extend(['--message', options.message]) |
1429 upload_args.extend(['--issue', str(cl.GetIssue())]) | 1432 upload_args.extend(['--issue', str(cl.GetIssue())]) |
1430 print ("This branch is associated with issue %s. " | 1433 print ("This branch is associated with issue %s. " |
1431 "Adding patch to that issue." % cl.GetIssue()) | 1434 "Adding patch to that issue." % cl.GetIssue()) |
1432 else: | 1435 else: |
1433 if options.title: | 1436 if options.title: |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1553 parser.add_option("--emulate_svn_auto_props", action="store_true", | 1556 parser.add_option("--emulate_svn_auto_props", action="store_true", |
1554 dest="emulate_svn_auto_props", | 1557 dest="emulate_svn_auto_props", |
1555 help="Emulate Subversion's auto properties feature.") | 1558 help="Emulate Subversion's auto properties feature.") |
1556 parser.add_option('-c', '--use-commit-queue', action='store_true', | 1559 parser.add_option('-c', '--use-commit-queue', action='store_true', |
1557 help='tell the commit queue to commit this patchset') | 1560 help='tell the commit queue to commit this patchset') |
1558 parser.add_option('--private', action='store_true', | 1561 parser.add_option('--private', action='store_true', |
1559 help='set the review private (rietveld only)') | 1562 help='set the review private (rietveld only)') |
1560 parser.add_option('--target_branch', | 1563 parser.add_option('--target_branch', |
1561 help='When uploading to gerrit, remote branch to ' | 1564 help='When uploading to gerrit, remote branch to ' |
1562 'use for CL. Default: master') | 1565 'use for CL. Default: master') |
1566 parser.add_option('--email', default=None, | |
iannucci
2014/01/09 22:46:42
Hm... what about 'username'? Since git_cl already
pgervais
2014/01/09 22:50:55
Exactly :-)
It's not too late, I can change the n
| |
1567 help='email address to use to connect to Rietveld') | |
1568 | |
1563 add_git_similarity(parser) | 1569 add_git_similarity(parser) |
1564 (options, args) = parser.parse_args(args) | 1570 (options, args) = parser.parse_args(args) |
1565 | 1571 |
1566 if options.target_branch and not settings.GetIsGerrit(): | 1572 if options.target_branch and not settings.GetIsGerrit(): |
1567 parser.error('Use --target_branch for non gerrit repository.') | 1573 parser.error('Use --target_branch for non gerrit repository.') |
1568 | 1574 |
1569 if is_dirty_git_tree('upload'): | 1575 if is_dirty_git_tree('upload'): |
1570 return 1 | 1576 return 1 |
1571 | 1577 |
1572 options.reviewers = cleanup_list(options.reviewers) | 1578 options.reviewers = cleanup_list(options.reviewers) |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2373 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2379 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
2374 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2380 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
2375 | 2381 |
2376 | 2382 |
2377 if __name__ == '__main__': | 2383 if __name__ == '__main__': |
2378 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2384 # These affect sys.stdout so do it outside of main() to simplify mocks in |
2379 # unit testing. | 2385 # unit testing. |
2380 fix_encoding.fix_encoding() | 2386 fix_encoding.fix_encoding() |
2381 colorama.init() | 2387 colorama.init() |
2382 sys.exit(main(sys.argv[1:])) | 2388 sys.exit(main(sys.argv[1:])) |
OLD | NEW |