Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: git_cl.py

Issue 1916123002: Fetch Gerrit cl description from gitiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gerrit_util.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « gerrit_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698