| 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 import json | 10 import json |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 self._description[matches[0].end():]).strip() | 857 self._description[matches[0].end():]).strip() |
| 858 else: | 858 else: |
| 859 self.append_footer(new_r_line) | 859 self.append_footer(new_r_line) |
| 860 | 860 |
| 861 def prompt(self): | 861 def prompt(self): |
| 862 """Asks the user to update the description.""" | 862 """Asks the user to update the description.""" |
| 863 self._description = ( | 863 self._description = ( |
| 864 '# Enter a description of the change.\n' | 864 '# Enter a description of the change.\n' |
| 865 '# This will be displayed on the codereview site.\n' | 865 '# This will be displayed on the codereview site.\n' |
| 866 '# The first line will also be used as the subject of the review.\n' | 866 '# The first line will also be used as the subject of the review.\n' |
| 867 '#----------------------This line is 76 characters long' | 867 '#--------------------This line is 72 characters long' |
| 868 '----------------------\n' | 868 '--------------------\n' |
| 869 ) + self._description | 869 ) + self._description |
| 870 | 870 |
| 871 if '\nBUG=' not in self._description: | 871 if '\nBUG=' not in self._description: |
| 872 self.append_footer('BUG=') | 872 self.append_footer('BUG=') |
| 873 content = gclient_utils.RunEditor(self._description, True, | 873 content = gclient_utils.RunEditor(self._description, True, |
| 874 git_editor=settings.GetGitEditor()) | 874 git_editor=settings.GetGitEditor()) |
| 875 if not content: | 875 if not content: |
| 876 DieWithError('Running editor failed') | 876 DieWithError('Running editor failed') |
| 877 | 877 |
| 878 # Strip off comments. | 878 # Strip off comments. |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 GenUsage(parser, 'help') | 2093 GenUsage(parser, 'help') |
| 2094 return CMDhelp(parser, argv) | 2094 return CMDhelp(parser, argv) |
| 2095 | 2095 |
| 2096 | 2096 |
| 2097 if __name__ == '__main__': | 2097 if __name__ == '__main__': |
| 2098 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2098 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2099 # unit testing. | 2099 # unit testing. |
| 2100 fix_encoding.fix_encoding() | 2100 fix_encoding.fix_encoding() |
| 2101 colorama.init() | 2101 colorama.init() |
| 2102 sys.exit(main(sys.argv[1:])) | 2102 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |