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

Side by Side Diff: git_cl.py

Issue 1980323002: Fix git cl status for MERGED CLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 * 'closed' - abandoned 2131 * 'closed' - abandoned
2132 """ 2132 """
2133 if not self.GetIssue(): 2133 if not self.GetIssue():
2134 return None 2134 return None
2135 2135
2136 try: 2136 try:
2137 data = self._GetChangeDetail(['DETAILED_LABELS', 'CURRENT_REVISION']) 2137 data = self._GetChangeDetail(['DETAILED_LABELS', 'CURRENT_REVISION'])
2138 except httplib.HTTPException: 2138 except httplib.HTTPException:
2139 return 'error' 2139 return 'error'
2140 2140
2141 if data['status'] == 'ABANDONED': 2141 if data['status'] in ('ABANDONED', 'MERGED'):
2142 return 'closed' 2142 return 'closed'
2143 2143
2144 cq_label = data['labels'].get('Commit-Queue', {}) 2144 cq_label = data['labels'].get('Commit-Queue', {})
2145 if cq_label: 2145 if cq_label:
2146 # Vote value is a stringified integer, which we expect from 0 to 2. 2146 # Vote value is a stringified integer, which we expect from 0 to 2.
2147 vote_value = cq_label.get('value', '0') 2147 vote_value = cq_label.get('value', '0')
2148 vote_text = cq_label.get('values', {}).get(vote_value, '') 2148 vote_text = cq_label.get('values', {}).get(vote_value, '')
2149 if vote_text.lower() == 'commit': 2149 if vote_text.lower() == 'commit':
2150 return 'commit' 2150 return 'commit'
2151 2151
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after
4901 if __name__ == '__main__': 4901 if __name__ == '__main__':
4902 # These affect sys.stdout so do it outside of main() to simplify mocks in 4902 # These affect sys.stdout so do it outside of main() to simplify mocks in
4903 # unit testing. 4903 # unit testing.
4904 fix_encoding.fix_encoding() 4904 fix_encoding.fix_encoding()
4905 setup_color.init() 4905 setup_color.init()
4906 try: 4906 try:
4907 sys.exit(main(sys.argv[1:])) 4907 sys.exit(main(sys.argv[1:]))
4908 except KeyboardInterrupt: 4908 except KeyboardInterrupt:
4909 sys.stderr.write('interrupted\n') 4909 sys.stderr.write('interrupted\n')
4910 sys.exit(1) 4910 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698