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 __future__ import print_function | 10 from __future__ import print_function |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 upload_args.extend(auth.auth_config_to_command_options(self._auth_config)) | 1891 upload_args.extend(auth.auth_config_to_command_options(self._auth_config)) |
1892 if options.emulate_svn_auto_props: | 1892 if options.emulate_svn_auto_props: |
1893 upload_args.append('--emulate_svn_auto_props') | 1893 upload_args.append('--emulate_svn_auto_props') |
1894 | 1894 |
1895 change_desc = None | 1895 change_desc = None |
1896 | 1896 |
1897 if options.email is not None: | 1897 if options.email is not None: |
1898 upload_args.extend(['--email', options.email]) | 1898 upload_args.extend(['--email', options.email]) |
1899 | 1899 |
1900 if self.GetIssue(): | 1900 if self.GetIssue(): |
1901 if options.title: | 1901 if options.title is not None: |
1902 upload_args.extend(['--title', options.title]) | 1902 upload_args.extend(['--title', options.title]) |
1903 if options.message: | 1903 if options.message: |
1904 upload_args.extend(['--message', options.message]) | 1904 upload_args.extend(['--message', options.message]) |
1905 upload_args.extend(['--issue', str(self.GetIssue())]) | 1905 upload_args.extend(['--issue', str(self.GetIssue())]) |
1906 print('This branch is associated with issue %s. ' | 1906 print('This branch is associated with issue %s. ' |
1907 'Adding patch to that issue.' % self.GetIssue()) | 1907 'Adding patch to that issue.' % self.GetIssue()) |
1908 else: | 1908 else: |
1909 if options.title: | 1909 if options.title is not None: |
1910 upload_args.extend(['--title', options.title]) | 1910 upload_args.extend(['--title', options.title]) |
1911 message = (options.title or options.message or | 1911 message = (options.title or options.message or |
1912 CreateDescriptionFromLog(args)) | 1912 CreateDescriptionFromLog(args)) |
1913 change_desc = ChangeDescription(message) | 1913 change_desc = ChangeDescription(message) |
1914 if options.reviewers or options.tbr_owners: | 1914 if options.reviewers or options.tbr_owners: |
1915 change_desc.update_reviewers(options.reviewers, | 1915 change_desc.update_reviewers(options.reviewers, |
1916 options.tbr_owners, | 1916 options.tbr_owners, |
1917 change) | 1917 change) |
1918 if not options.force: | 1918 if not options.force: |
1919 change_desc.prompt() | 1919 change_desc.prompt() |
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5079 if __name__ == '__main__': | 5079 if __name__ == '__main__': |
5080 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5080 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5081 # unit testing. | 5081 # unit testing. |
5082 fix_encoding.fix_encoding() | 5082 fix_encoding.fix_encoding() |
5083 setup_color.init() | 5083 setup_color.init() |
5084 try: | 5084 try: |
5085 sys.exit(main(sys.argv[1:])) | 5085 sys.exit(main(sys.argv[1:])) |
5086 except KeyboardInterrupt: | 5086 except KeyboardInterrupt: |
5087 sys.stderr.write('interrupted\n') | 5087 sys.stderr.write('interrupted\n') |
5088 sys.exit(1) | 5088 sys.exit(1) |
OLD | NEW |