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 24 matching lines...) Expand all Loading... | |
35 except ImportError: | 35 except ImportError: |
36 pass | 36 pass |
37 | 37 |
38 from third_party import colorama | 38 from third_party import colorama |
39 from third_party import httplib2 | 39 from third_party import httplib2 |
40 from third_party import upload | 40 from third_party import upload |
41 import auth | 41 import auth |
42 from luci_hacks import trigger_luci_job as luci_trigger | 42 from luci_hacks import trigger_luci_job as luci_trigger |
43 import breakpad # pylint: disable=W0611 | 43 import breakpad # pylint: disable=W0611 |
44 import clang_format | 44 import clang_format |
45 import commit_queue | |
Sergiy Byelozyorov
2016/01/13 14:53:18
not sure it's a good idea. this file is designed t
tandrii(chromium)
2016/01/13 15:16:36
well, same thing with clang_format, which is also
| |
45 import dart_format | 46 import dart_format |
46 import fix_encoding | 47 import fix_encoding |
47 import gclient_utils | 48 import gclient_utils |
48 import git_common | 49 import git_common |
49 from git_footers import get_footer_svn_id | 50 from git_footers import get_footer_svn_id |
50 import owners | 51 import owners |
51 import owners_finder | 52 import owners_finder |
52 import presubmit_support | 53 import presubmit_support |
53 import rietveld | 54 import rietveld |
54 import scm | 55 import scm |
(...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3198 | 3199 |
3199 # Fall back to deprecated method: get try slaves from PRESUBMIT.py files. | 3200 # Fall back to deprecated method: get try slaves from PRESUBMIT.py files. |
3200 options.bot = presubmit_support.DoGetTrySlaves( | 3201 options.bot = presubmit_support.DoGetTrySlaves( |
3201 change, | 3202 change, |
3202 change.LocalPaths(), | 3203 change.LocalPaths(), |
3203 settings.GetRoot(), | 3204 settings.GetRoot(), |
3204 None, | 3205 None, |
3205 None, | 3206 None, |
3206 options.verbose, | 3207 options.verbose, |
3207 sys.stdout) | 3208 sys.stdout) |
3209 | |
3210 if not options.bot: | |
3211 # Get try masters from cq.cfg if any. | |
3212 # TODO(tandrii): some (but very few) projects store cq.cfg in different | |
3213 # location. | |
3214 cq_cfg = os.path.join(change.RepositoryRoot(), | |
3215 'infra', 'config', 'cq.cfg') | |
smut
2016/01/25 21:16:38
You can't hard code this path. Downstream iOS's cq
tandrii(chromium)
2016/01/26 11:41:33
what do you mean I can't? I sure can and just did
| |
3216 if os.path.exists(cq_cfg): | |
3217 masters = {} | |
3218 cq_masters = commit_queue.get_master_builder_map(cq_cfg) | |
3219 for master, builders in cq_masters.iteritems(): | |
3220 for builder in builders: | |
3221 # Skip presubmit builders, because these will fail without LGTM. | |
3222 if 'presubmit' not in builder.lower(): | |
3223 masters.setdefault(master, {})[builder] = ['defaulttests'] | |
3224 if masters: | |
3225 return masters | |
3226 | |
3208 if not options.bot: | 3227 if not options.bot: |
3209 parser.error('No default try builder to try, use --bot') | 3228 parser.error('No default try builder to try, use --bot') |
3210 | 3229 |
3211 builders_and_tests = {} | 3230 builders_and_tests = {} |
3212 # TODO(machenbach): The old style command-line options don't support | 3231 # TODO(machenbach): The old style command-line options don't support |
3213 # multiple try masters yet. | 3232 # multiple try masters yet. |
3214 old_style = filter(lambda x: isinstance(x, basestring), options.bot) | 3233 old_style = filter(lambda x: isinstance(x, basestring), options.bot) |
3215 new_style = filter(lambda x: isinstance(x, tuple), options.bot) | 3234 new_style = filter(lambda x: isinstance(x, tuple), options.bot) |
3216 | 3235 |
3217 for bot in old_style: | 3236 for bot in old_style: |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3672 if __name__ == '__main__': | 3691 if __name__ == '__main__': |
3673 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3692 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3674 # unit testing. | 3693 # unit testing. |
3675 fix_encoding.fix_encoding() | 3694 fix_encoding.fix_encoding() |
3676 colorama.init() | 3695 colorama.init() |
3677 try: | 3696 try: |
3678 sys.exit(main(sys.argv[1:])) | 3697 sys.exit(main(sys.argv[1:])) |
3679 except KeyboardInterrupt: | 3698 except KeyboardInterrupt: |
3680 sys.stderr.write('interrupted\n') | 3699 sys.stderr.write('interrupted\n') |
3681 sys.exit(1) | 3700 sys.exit(1) |
OLD | NEW |