OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # git-cl -- a git-command for integrating reviews on Rietveld | 2 # git-cl -- a git-command for integrating reviews on Rietveld |
3 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 3 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
4 | 4 |
5 import errno | 5 import errno |
6 import logging | 6 import logging |
7 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 env = os.environ.copy() | 744 env = os.environ.copy() |
745 if 'GIT_EXTERNAL_DIFF' in env: | 745 if 'GIT_EXTERNAL_DIFF' in env: |
746 del env['GIT_EXTERNAL_DIFF'] | 746 del env['GIT_EXTERNAL_DIFF'] |
747 subprocess.call(['git', 'diff', '--no-ext-diff', '--stat', '-M'] + args, | 747 subprocess.call(['git', 'diff', '--no-ext-diff', '--stat', '-M'] + args, |
748 env=env) | 748 env=env) |
749 | 749 |
750 upload_args = ['--assume_yes'] # Don't ask about untracked files. | 750 upload_args = ['--assume_yes'] # Don't ask about untracked files. |
751 upload_args.extend(['--server', cl.GetRietveldServer()]) | 751 upload_args.extend(['--server', cl.GetRietveldServer()]) |
752 if options.reviewers: | 752 if options.reviewers: |
753 upload_args.extend(['--reviewers', options.reviewers]) | 753 upload_args.extend(['--reviewers', options.reviewers]) |
754 upload_args.extend(['--cc', settings.GetCCList()]) | |
755 if options.emulate_svn_auto_props: | 754 if options.emulate_svn_auto_props: |
756 upload_args.append('--emulate_svn_auto_props') | 755 upload_args.append('--emulate_svn_auto_props') |
757 if options.send_mail: | 756 if options.send_mail: |
758 if not options.reviewers: | 757 if not options.reviewers: |
759 DieWithError("Must specify reviewers to send email.") | 758 DieWithError("Must specify reviewers to send email.") |
760 upload_args.append('--send_mail') | 759 upload_args.append('--send_mail') |
761 if options.from_logs and not options.message: | 760 if options.from_logs and not options.message: |
762 print 'Must set message for subject line if using desc_from_logs' | 761 print 'Must set message for subject line if using desc_from_logs' |
763 return 1 | 762 return 1 |
764 | 763 |
(...skipping 22 matching lines...) Expand all Loading... |
787 log_desc += '\nTEST=' | 786 log_desc += '\nTEST=' |
788 change_desc = UserEditedLog(initial_text + log_desc) | 787 change_desc = UserEditedLog(initial_text + log_desc) |
789 subject = '' | 788 subject = '' |
790 if change_desc: | 789 if change_desc: |
791 subject = change_desc.splitlines()[0] | 790 subject = change_desc.splitlines()[0] |
792 if not change_desc: | 791 if not change_desc: |
793 print "Description is empty; aborting." | 792 print "Description is empty; aborting." |
794 return 1 | 793 return 1 |
795 upload_args.extend(['--message', subject]) | 794 upload_args.extend(['--message', subject]) |
796 upload_args.extend(['--description', change_desc]) | 795 upload_args.extend(['--description', change_desc]) |
| 796 upload_args.extend(['--cc', settings.GetCCList()]) |
797 | 797 |
798 # Include the upstream repo's URL in the change -- this is useful for | 798 # Include the upstream repo's URL in the change -- this is useful for |
799 # projects that have their source spread across multiple repos. | 799 # projects that have their source spread across multiple repos. |
800 remote_url = None | 800 remote_url = None |
801 if settings.GetIsGitSvn(): | 801 if settings.GetIsGitSvn(): |
802 data = RunGit(['svn', 'info']) | 802 data = RunGit(['svn', 'info']) |
803 if data: | 803 if data: |
804 keys = dict(line.split(': ', 1) for line in data.splitlines() | 804 keys = dict(line.split(': ', 1) for line in data.splitlines() |
805 if ': ' in line) | 805 if ': ' in line) |
806 remote_url = keys.get('URL', None) | 806 remote_url = keys.get('URL', None) |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1269 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1270 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1270 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1271 | 1271 |
1272 # Not a known command. Default to help. | 1272 # Not a known command. Default to help. |
1273 GenUsage(parser, 'help') | 1273 GenUsage(parser, 'help') |
1274 return CMDhelp(parser, argv) | 1274 return CMDhelp(parser, argv) |
1275 | 1275 |
1276 | 1276 |
1277 if __name__ == '__main__': | 1277 if __name__ == '__main__': |
1278 sys.exit(main(sys.argv[1:])) | 1278 sys.exit(main(sys.argv[1:])) |
OLD | NEW |