| 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 and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
| 9 | 9 |
| 10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
| (...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 DieWithError('Must specify reviewers to send email.') | 2491 DieWithError('Must specify reviewers to send email.') |
| 2492 refspec_opts.append('notify=ALL') | 2492 refspec_opts.append('notify=ALL') |
| 2493 else: | 2493 else: |
| 2494 refspec_opts.append('notify=NONE') | 2494 refspec_opts.append('notify=NONE') |
| 2495 | 2495 |
| 2496 cc = self.GetCCList().split(',') | 2496 cc = self.GetCCList().split(',') |
| 2497 if options.cc: | 2497 if options.cc: |
| 2498 cc.extend(options.cc) | 2498 cc.extend(options.cc) |
| 2499 cc = filter(None, cc) | 2499 cc = filter(None, cc) |
| 2500 if cc: | 2500 if cc: |
| 2501 # refspec_opts.extend('cc=' + email.strip() for email in cc) | 2501 refspec_opts.extend('cc=' + email.strip() for email in cc) |
| 2502 # TODO(tandrii): enable this back. http://crbug.com/604377 | |
| 2503 print('WARNING: Gerrit doesn\'t yet support cc-ing arbitrary emails.\n' | |
| 2504 ' Ignoring cc-ed emails. See http://crbug.com/604377.') | |
| 2505 | 2502 |
| 2506 if change_desc.get_reviewers(): | 2503 if change_desc.get_reviewers(): |
| 2507 refspec_opts.extend('r=' + email.strip() | 2504 refspec_opts.extend('r=' + email.strip() |
| 2508 for email in change_desc.get_reviewers()) | 2505 for email in change_desc.get_reviewers()) |
| 2509 | 2506 |
| 2510 refspec_suffix = '' | 2507 refspec_suffix = '' |
| 2511 if refspec_opts: | 2508 if refspec_opts: |
| 2512 refspec_suffix = '%' + ','.join(refspec_opts) | 2509 refspec_suffix = '%' + ','.join(refspec_opts) |
| 2513 assert ' ' not in refspec_suffix, ( | 2510 assert ' ' not in refspec_suffix, ( |
| 2514 'spaces not allowed in refspec: "%s"' % refspec_suffix) | 2511 'spaces not allowed in refspec: "%s"' % refspec_suffix) |
| (...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4935 if __name__ == '__main__': | 4932 if __name__ == '__main__': |
| 4936 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4933 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 4937 # unit testing. | 4934 # unit testing. |
| 4938 fix_encoding.fix_encoding() | 4935 fix_encoding.fix_encoding() |
| 4939 setup_color.init() | 4936 setup_color.init() |
| 4940 try: | 4937 try: |
| 4941 sys.exit(main(sys.argv[1:])) | 4938 sys.exit(main(sys.argv[1:])) |
| 4942 except KeyboardInterrupt: | 4939 except KeyboardInterrupt: |
| 4943 sys.stderr.write('interrupted\n') | 4940 sys.stderr.write('interrupted\n') |
| 4944 sys.exit(1) | 4941 sys.exit(1) |
| OLD | NEW |