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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 # This will displayed on the codereview site. | 676 # This will displayed on the codereview site. |
677 # The first line will also be used as the subject of the review. | 677 # The first line will also be used as the subject of the review. |
678 """ | 678 """ |
679 content += self.description | 679 content += self.description |
680 if ('\nR=' not in self.description and | 680 if ('\nR=' not in self.description and |
681 '\nTBR=' not in self.description and | 681 '\nTBR=' not in self.description and |
682 self.reviewers): | 682 self.reviewers): |
683 content += '\nR=' + self.reviewers | 683 content += '\nR=' + self.reviewers |
684 if '\nBUG=' not in self.description: | 684 if '\nBUG=' not in self.description: |
685 content += '\nBUG=' | 685 content += '\nBUG=' |
686 if '\nTEST=' not in self.description: | |
687 content += '\nTEST=' | |
688 content = content.rstrip('\n') + '\n' | 686 content = content.rstrip('\n') + '\n' |
689 content = gclient_utils.RunEditor(content, True) | 687 content = gclient_utils.RunEditor(content, True) |
690 if not content: | 688 if not content: |
691 DieWithError('Running editor failed') | 689 DieWithError('Running editor failed') |
692 content = re.compile(r'^#.*$', re.MULTILINE).sub('', content).strip() | 690 content = re.compile(r'^#.*$', re.MULTILINE).sub('', content).strip() |
693 if not content.strip(): | 691 if not content.strip(): |
694 DieWithError('No CL description, aborting') | 692 DieWithError('No CL description, aborting') |
695 self.description = content | 693 self.description = content |
696 | 694 |
697 def ParseDescription(self): | 695 def ParseDescription(self): |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1602 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1605 | 1603 |
1606 # Not a known command. Default to help. | 1604 # Not a known command. Default to help. |
1607 GenUsage(parser, 'help') | 1605 GenUsage(parser, 'help') |
1608 return CMDhelp(parser, argv) | 1606 return CMDhelp(parser, argv) |
1609 | 1607 |
1610 | 1608 |
1611 if __name__ == '__main__': | 1609 if __name__ == '__main__': |
1612 fix_encoding.fix_encoding() | 1610 fix_encoding.fix_encoding() |
1613 sys.exit(main(sys.argv[1:])) | 1611 sys.exit(main(sys.argv[1:])) |
OLD | NEW |