| 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 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 else: | 1107 else: |
| 1108 print("Setting base-url to %s" % args[0]) | 1108 print("Setting base-url to %s" % args[0]) |
| 1109 return RunGit(['config', 'branch.%s.base-url' % branch, args[0]], | 1109 return RunGit(['config', 'branch.%s.base-url' % branch, args[0]], |
| 1110 error_ok=False).strip() | 1110 error_ok=False).strip() |
| 1111 | 1111 |
| 1112 | 1112 |
| 1113 def CMDstatus(parser, args): | 1113 def CMDstatus(parser, args): |
| 1114 """Show status of changelists. | 1114 """Show status of changelists. |
| 1115 | 1115 |
| 1116 Colors are used to tell the state of the CL unless --fast is used: | 1116 Colors are used to tell the state of the CL unless --fast is used: |
| 1117 - Green LGTM'ed | 1117 - Red not sent for review or broken |
| 1118 - Blue waiting for review | 1118 - Blue waiting for review |
| 1119 - Yellow waiting for you to reply to review | 1119 - Yellow waiting for you to reply to review |
| 1120 - Red not sent for review or broken | 1120 - Green LGTM'ed |
| 1121 - Cyan was committed, branch can be deleted | 1121 - Magenta in the commit queue |
| 1122 - Cyan was committed, branch can be deleted |
| 1122 | 1123 |
| 1123 Also see 'git cl comments'. | 1124 Also see 'git cl comments'. |
| 1124 """ | 1125 """ |
| 1125 parser.add_option('--field', | 1126 parser.add_option('--field', |
| 1126 help='print only specific field (desc|id|patch|url)') | 1127 help='print only specific field (desc|id|patch|url)') |
| 1127 parser.add_option('-f', '--fast', action='store_true', | 1128 parser.add_option('-f', '--fast', action='store_true', |
| 1128 help='Do not retrieve review status') | 1129 help='Do not retrieve review status') |
| 1129 (options, args) = parser.parse_args(args) | 1130 (options, args) = parser.parse_args(args) |
| 1130 if args: | 1131 if args: |
| 1131 parser.error('Unsupported args: %s' % args) | 1132 parser.error('Unsupported args: %s' % args) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 # The issue probably doesn't exist anymore. | 1179 # The issue probably doesn't exist anymore. |
| 1179 i += ' (broken)' | 1180 i += ' (broken)' |
| 1180 | 1181 |
| 1181 msgs = props.get('messages') or [] | 1182 msgs = props.get('messages') or [] |
| 1182 | 1183 |
| 1183 if not i: | 1184 if not i: |
| 1184 color = Fore.WHITE | 1185 color = Fore.WHITE |
| 1185 elif props.get('closed'): | 1186 elif props.get('closed'): |
| 1186 # Issue is closed. | 1187 # Issue is closed. |
| 1187 color = Fore.CYAN | 1188 color = Fore.CYAN |
| 1189 elif props.get('commit'): |
| 1190 # Issue is in the commit queue. |
| 1191 color = Fore.MAGENTA |
| 1188 elif r: | 1192 elif r: |
| 1189 # Was LGTM'ed. | 1193 # Was LGTM'ed. |
| 1190 color = Fore.GREEN | 1194 color = Fore.GREEN |
| 1191 elif not msgs: | 1195 elif not msgs: |
| 1192 # No message was sent. | 1196 # No message was sent. |
| 1193 color = Fore.RED | 1197 color = Fore.RED |
| 1194 elif msgs[-1]['sender'] != props.get('owner_email'): | 1198 elif msgs[-1]['sender'] != props.get('owner_email'): |
| 1195 color = Fore.YELLOW | 1199 color = Fore.YELLOW |
| 1196 else: | 1200 else: |
| 1197 color = Fore.BLUE | 1201 color = Fore.BLUE |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2351 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2348 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2352 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2349 | 2353 |
| 2350 | 2354 |
| 2351 if __name__ == '__main__': | 2355 if __name__ == '__main__': |
| 2352 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2356 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2353 # unit testing. | 2357 # unit testing. |
| 2354 fix_encoding.fix_encoding() | 2358 fix_encoding.fix_encoding() |
| 2355 colorama.init() | 2359 colorama.init() |
| 2356 sys.exit(main(sys.argv[1:])) | 2360 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |