| 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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 self._description = ( | 831 self._description = ( |
| 832 self._description[:matches[0].start()] + new_r_line + | 832 self._description[:matches[0].start()] + new_r_line + |
| 833 self._description[matches[0].end()+1:]) | 833 self._description[matches[0].end()+1:]) |
| 834 else: | 834 else: |
| 835 self.append_footer(new_r_line) | 835 self.append_footer(new_r_line) |
| 836 | 836 |
| 837 def prompt(self): | 837 def prompt(self): |
| 838 """Asks the user to update the description.""" | 838 """Asks the user to update the description.""" |
| 839 self._description = ( | 839 self._description = ( |
| 840 '# Enter a description of the change.\n' | 840 '# Enter a description of the change.\n' |
| 841 '# This will displayed on the codereview site.\n' | 841 '# This will be displayed on the codereview site.\n' |
| 842 '# The first line will also be used as the subject of the review.\n' | 842 '# The first line will also be used as the subject of the review.\n' |
| 843 ) + self._description | 843 ) + self._description |
| 844 | 844 |
| 845 if '\nBUG=' not in self._description: | 845 if '\nBUG=' not in self._description: |
| 846 self.append_footer('BUG=') | 846 self.append_footer('BUG=') |
| 847 content = gclient_utils.RunEditor(self._description, True) | 847 content = gclient_utils.RunEditor(self._description, True) |
| 848 if not content: | 848 if not content: |
| 849 DieWithError('Running editor failed') | 849 DieWithError('Running editor failed') |
| 850 | 850 |
| 851 # Strip off comments. | 851 # Strip off comments. |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1968 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1969 | 1969 |
| 1970 # Not a known command. Default to help. | 1970 # Not a known command. Default to help. |
| 1971 GenUsage(parser, 'help') | 1971 GenUsage(parser, 'help') |
| 1972 return CMDhelp(parser, argv) | 1972 return CMDhelp(parser, argv) |
| 1973 | 1973 |
| 1974 | 1974 |
| 1975 if __name__ == '__main__': | 1975 if __name__ == '__main__': |
| 1976 fix_encoding.fix_encoding() | 1976 fix_encoding.fix_encoding() |
| 1977 sys.exit(main(sys.argv[1:])) | 1977 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |