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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 return None | 1228 return None |
1229 | 1229 |
1230 try: | 1230 try: |
1231 props = self.GetIssueProperties() | 1231 props = self.GetIssueProperties() |
1232 except urllib2.HTTPError: | 1232 except urllib2.HTTPError: |
1233 return 'error' | 1233 return 'error' |
1234 | 1234 |
1235 if props.get('closed'): | 1235 if props.get('closed'): |
1236 # Issue is closed. | 1236 # Issue is closed. |
1237 return 'closed' | 1237 return 'closed' |
1238 if props.get('commit'): | 1238 if props.get('commit') and not props.get('cq_dry_run', False): |
1239 # Issue is in the commit queue. | 1239 # Issue is in the commit queue. |
1240 return 'commit' | 1240 return 'commit' |
1241 | 1241 |
1242 try: | 1242 try: |
1243 reviewers = self.GetApprovingReviewers() | 1243 reviewers = self.GetApprovingReviewers() |
1244 except urllib2.HTTPError: | 1244 except urllib2.HTTPError: |
1245 return 'error' | 1245 return 'error' |
1246 | 1246 |
1247 if reviewers: | 1247 if reviewers: |
1248 # Was LGTM'ed. | 1248 # Was LGTM'ed. |
(...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3951 if __name__ == '__main__': | 3951 if __name__ == '__main__': |
3952 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3952 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3953 # unit testing. | 3953 # unit testing. |
3954 fix_encoding.fix_encoding() | 3954 fix_encoding.fix_encoding() |
3955 colorama.init() | 3955 colorama.init() |
3956 try: | 3956 try: |
3957 sys.exit(main(sys.argv[1:])) | 3957 sys.exit(main(sys.argv[1:])) |
3958 except KeyboardInterrupt: | 3958 except KeyboardInterrupt: |
3959 sys.stderr.write('interrupted\n') | 3959 sys.stderr.write('interrupted\n') |
3960 sys.exit(1) | 3960 sys.exit(1) |
OLD | NEW |