OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 """Define the supported projects.""" | 4 """Define the supported projects.""" |
5 | 5 |
6 import os | 6 import os |
7 import re | 7 import re |
8 import sys | 8 import sys |
| 9 import urllib2 |
9 | 10 |
10 import find_depot_tools # pylint: disable=W0611 | 11 import find_depot_tools # pylint: disable=W0611 |
11 import checkout | 12 import checkout |
12 | 13 |
13 import committer_list | 14 import committer_list |
14 import creds | 15 import creds |
15 import errors | 16 import errors |
16 import pending_manager | 17 import pending_manager |
17 from post_processors import chromium_copyright | 18 from post_processors import chromium_copyright |
18 from verification import presubmit_check | 19 from verification import presubmit_check |
(...skipping 27 matching lines...) Expand all Loading... |
46 def _get_escaped_committers(root_dir): | 47 def _get_escaped_committers(root_dir): |
47 filepath = os.path.join(root_dir, '.committers_pwd') | 48 filepath = os.path.join(root_dir, '.committers_pwd') |
48 try: | 49 try: |
49 password = open(filepath).readlines()[0].strip() | 50 password = open(filepath).readlines()[0].strip() |
50 except IOError: | 51 except IOError: |
51 raise errors.ConfigurationError( | 52 raise errors.ConfigurationError( |
52 'Put the committers list password in %s' % filepath) | 53 'Put the committers list password in %s' % filepath) |
53 return [re.escape(i) for i in committer_list.get_committers(password)] | 54 return [re.escape(i) for i in committer_list.get_committers(password)] |
54 | 55 |
55 | 56 |
| 57 def _chromium_lkgr(): |
| 58 try: |
| 59 return int( |
| 60 urllib2.urlopen('http://chromium-status.appspot.com/lkgr').read()) |
| 61 except (ValueError, IOError): |
| 62 return None |
| 63 |
56 def _gen_chromium(user, root_dir, rietveld_obj, no_try): | 64 def _gen_chromium(user, root_dir, rietveld_obj, no_try): |
57 """Generates a PendingManager commit queue for chrome/trunk/src.""" | 65 """Generates a PendingManager commit queue for chrome/trunk/src.""" |
58 svn_creds = creds.Credentials(os.path.join(root_dir, '.svn_pwd')) | 66 svn_creds = creds.Credentials(os.path.join(root_dir, '.svn_pwd')) |
59 local_checkout = checkout.SvnCheckout( | 67 local_checkout = checkout.SvnCheckout( |
60 root_dir, | 68 root_dir, |
61 'chromium', | 69 'chromium', |
62 user, | 70 user, |
63 svn_creds.get(user), | 71 svn_creds.get(user), |
64 'svn://svn.chromium.org/chrome/trunk/src') | 72 'svn://svn.chromium.org/chrome/trunk/src') |
65 | 73 |
(...skipping 20 matching lines...) Expand all Loading... |
86 'media_unittests', | 94 'media_unittests', |
87 'net_unittests', | 95 'net_unittests', |
88 'printing_tests', | 96 'printing_tests', |
89 'unit_tests', | 97 'unit_tests', |
90 ) | 98 ) |
91 verifiers.append(try_server.TryRunner( | 99 verifiers.append(try_server.TryRunner( |
92 'http://build.chromium.org/p/tryserver.chromium/', | 100 'http://build.chromium.org/p/tryserver.chromium/', |
93 user, | 101 user, |
94 builders, | 102 builders, |
95 tests, | 103 tests, |
96 ['--root', 'src'])) | 104 ['--root', 'src'], |
| 105 _chromium_lkgr)) |
97 | 106 |
98 verifiers.append(tree_status.TreeStatusVerifier( | 107 verifiers.append(tree_status.TreeStatusVerifier( |
99 'http://chromium-status.appspot.com/status')) | 108 'http://chromium-status.appspot.com/status')) |
100 | 109 |
101 post_processors = [chromium_copyright.process] | 110 post_processors = [chromium_copyright.process] |
102 return pending_manager.PendingManager( | 111 return pending_manager.PendingManager( |
103 rietveld_obj, | 112 rietveld_obj, |
104 local_checkout, | 113 local_checkout, |
105 verifiers_no_patch, | 114 verifiers_no_patch, |
106 verifiers, | 115 verifiers, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 def supported_projects(): | 256 def supported_projects(): |
248 """List the projects that can be managed by the commit queue.""" | 257 """List the projects that can be managed by the commit queue.""" |
249 return sorted( | 258 return sorted( |
250 x[5:] for x in dir(sys.modules[__name__]) if x.startswith('_gen_')) | 259 x[5:] for x in dir(sys.modules[__name__]) if x.startswith('_gen_')) |
251 | 260 |
252 | 261 |
253 def load_project(project, user, root_dir, rietveld_obj, no_try): | 262 def load_project(project, user, root_dir, rietveld_obj, no_try): |
254 """Loads the specified project.""" | 263 """Loads the specified project.""" |
255 return getattr(sys.modules[__name__], '_gen_' + project)( | 264 return getattr(sys.modules[__name__], '_gen_' + project)( |
256 user, root_dir, rietveld_obj, no_try) | 265 user, root_dir, rietveld_obj, no_try) |
OLD | NEW |