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 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 # Some reply from non-owner. | 2154 # Some reply from non-owner. |
2155 return 'reply' | 2155 return 'reply' |
2156 | 2156 |
2157 return 'waiting' | 2157 return 'waiting' |
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(['CURRENT_REVISION']) |
2165 return data['revisions'][data['current_revision']]['commit_with_footers'] | 2165 current_rev = data['current_revision'] |
| 2166 url = data['revisions'][current_rev]['fetch']['http']['url'] |
| 2167 return gerrit_util.GetChangeDescriptionFromGitiles(url, current_rev) |
2166 | 2168 |
2167 def UpdateDescriptionRemote(self, description): | 2169 def UpdateDescriptionRemote(self, description): |
2168 # TODO(tandrii) | 2170 # TODO(tandrii) |
2169 raise NotImplementedError() | 2171 raise NotImplementedError() |
2170 | 2172 |
2171 def CloseIssue(self): | 2173 def CloseIssue(self): |
2172 gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') | 2174 gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') |
2173 | 2175 |
2174 def SubmitIssue(self, wait_for_merge=True): | 2176 def SubmitIssue(self, wait_for_merge=True): |
2175 gerrit_util.SubmitChange(self._GetGerritHost(), self.GetIssue(), | 2177 gerrit_util.SubmitChange(self._GetGerritHost(), self.GetIssue(), |
(...skipping 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4814 if __name__ == '__main__': | 4816 if __name__ == '__main__': |
4815 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4817 # These affect sys.stdout so do it outside of main() to simplify mocks in |
4816 # unit testing. | 4818 # unit testing. |
4817 fix_encoding.fix_encoding() | 4819 fix_encoding.fix_encoding() |
4818 setup_color.init() | 4820 setup_color.init() |
4819 try: | 4821 try: |
4820 sys.exit(main(sys.argv[1:])) | 4822 sys.exit(main(sys.argv[1:])) |
4821 except KeyboardInterrupt: | 4823 except KeyboardInterrupt: |
4822 sys.stderr.write('interrupted\n') | 4824 sys.stderr.write('interrupted\n') |
4823 sys.exit(1) | 4825 sys.exit(1) |
OLD | NEW |