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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 | 2158 |
2159 def GetMostRecentPatchset(self): | 2159 def GetMostRecentPatchset(self): |
2160 data = self._GetChangeDetail(['CURRENT_REVISION']) | 2160 data = self._GetChangeDetail(['CURRENT_REVISION']) |
2161 return data['revisions'][data['current_revision']]['_number'] | 2161 return data['revisions'][data['current_revision']]['_number'] |
2162 | 2162 |
2163 def FetchDescription(self): | 2163 def FetchDescription(self): |
2164 data = self._GetChangeDetail(['COMMIT_FOOTERS', 'CURRENT_REVISION']) | 2164 data = self._GetChangeDetail(['COMMIT_FOOTERS', 'CURRENT_REVISION']) |
2165 return data['revisions'][data['current_revision']]['commit_with_footers'] | 2165 return data['revisions'][data['current_revision']]['commit_with_footers'] |
2166 | 2166 |
2167 def UpdateDescriptionRemote(self, description): | 2167 def UpdateDescriptionRemote(self, description): |
2168 # TODO(tandrii) | 2168 gerrit_util.SetCommitMessage(self._GetGerritHost(), self.GetIssue(), |
2169 raise NotImplementedError() | 2169 description) |
2170 | 2170 |
2171 def CloseIssue(self): | 2171 def CloseIssue(self): |
2172 gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') | 2172 gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') |
2173 | 2173 |
2174 def SubmitIssue(self, wait_for_merge=True): | 2174 def SubmitIssue(self, wait_for_merge=True): |
2175 gerrit_util.SubmitChange(self._GetGerritHost(), self.GetIssue(), | 2175 gerrit_util.SubmitChange(self._GetGerritHost(), self.GetIssue(), |
2176 wait_for_merge=wait_for_merge) | 2176 wait_for_merge=wait_for_merge) |
2177 | 2177 |
2178 def _GetChangeDetail(self, options=None, issue=None): | 2178 def _GetChangeDetail(self, options=None, issue=None): |
2179 options = options or [] | 2179 options = options or [] |
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4814 if __name__ == '__main__': | 4814 if __name__ == '__main__': |
4815 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4815 # These affect sys.stdout so do it outside of main() to simplify mocks in |
4816 # unit testing. | 4816 # unit testing. |
4817 fix_encoding.fix_encoding() | 4817 fix_encoding.fix_encoding() |
4818 setup_color.init() | 4818 setup_color.init() |
4819 try: | 4819 try: |
4820 sys.exit(main(sys.argv[1:])) | 4820 sys.exit(main(sys.argv[1:])) |
4821 except KeyboardInterrupt: | 4821 except KeyboardInterrupt: |
4822 sys.stderr.write('interrupted\n') | 4822 sys.stderr.write('interrupted\n') |
4823 sys.exit(1) | 4823 sys.exit(1) |
OLD | NEW |