| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 | 4 |
| 5 import cgi | 5 import cgi |
| 6 import re | 6 import re |
| 7 | 7 |
| 8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 | 10 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 """ | 196 """ |
| 197 cfg = self.m.gclient.make_config() | 197 cfg = self.m.gclient.make_config() |
| 198 soln = cfg.solutions.add() | 198 soln = cfg.solutions.add() |
| 199 soln.name = 'chromite' | 199 soln.name = 'chromite' |
| 200 soln.url = self.chromite_url | 200 soln.url = self.chromite_url |
| 201 # Set the revision using 'bot_update' remote branch:revision notation. | 201 # Set the revision using 'bot_update' remote branch:revision notation. |
| 202 # Omitting the revision uses HEAD. | 202 # Omitting the revision uses HEAD. |
| 203 soln.revision = '%s:' % (self.c.chromite_branch,) | 203 soln.revision = '%s:' % (self.c.chromite_branch,) |
| 204 return cfg | 204 return cfg |
| 205 | 205 |
| 206 def checkout(self, manifest_url=None, repo_url=None): | 206 def checkout(self, manifest_url=None, repo_url=None, force_sync=False): |
| 207 manifest_url = manifest_url or self.manifest_url | 207 manifest_url = manifest_url or self.manifest_url |
| 208 repo_url = repo_url or self.repo_url | 208 repo_url = repo_url or self.repo_url |
| 209 | 209 |
| 210 self.m.repo.init(manifest_url, '--repo-url', repo_url) | 210 self.m.repo.init(manifest_url, '--repo-url', repo_url) |
| 211 self.m.repo.sync() | 211 args = [] |
| 212 if force_sync: |
| 213 args.append('--force-sync') |
| 214 self.m.repo.sync(*args) |
| 212 | 215 |
| 213 @property | 216 @property |
| 214 def using_old_chromite_layout(self): | 217 def using_old_chromite_layout(self): |
| 215 """Returns (bool): True if we're using old Chromite checkout layout. | 218 """Returns (bool): True if we're using old Chromite checkout layout. |
| 216 """ | 219 """ |
| 217 return self.c.chromite_branch in self.c.old_chromite_branches | 220 return self.c.chromite_branch in self.c.old_chromite_branches |
| 218 | 221 |
| 219 def cbuildbot(self, name, config, args=None, **kwargs): | 222 def cbuildbot(self, name, config, args=None, **kwargs): |
| 220 """Runs the cbuildbot command defined by the arguments. | 223 """Runs the cbuildbot command defined by the arguments. |
| 221 | 224 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 cbb_args.extend(['--master-build-id', self.c.cbb.build_id]) | 432 cbb_args.extend(['--master-build-id', self.c.cbb.build_id]) |
| 430 | 433 |
| 431 # Add custom args, if there are any. | 434 # Add custom args, if there are any. |
| 432 cbb_args.extend(self.c.cbb.extra_args) | 435 cbb_args.extend(self.c.cbb.extra_args) |
| 433 | 436 |
| 434 # Run cbuildbot. | 437 # Run cbuildbot. |
| 435 return self.cbuildbot(str('cbuildbot [%s]' % (self.c.cbb.config,)), | 438 return self.cbuildbot(str('cbuildbot [%s]' % (self.c.cbb.config,)), |
| 436 self.c.cbb.config, | 439 self.c.cbb.config, |
| 437 args=cbb_args, | 440 args=cbb_args, |
| 438 cwd=self.m.path['slave_build']) | 441 cwd=self.m.path['slave_build']) |
| OLD | NEW |