Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 5 |
| 6 """Recipe module to ensure a checkout is consistant on a bot.""" | 6 """Recipe module to ensure a checkout is consistant on a bot.""" |
| 7 | 7 |
| 8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 kwargs.setdefault('env', {}) | 46 kwargs.setdefault('env', {}) |
| 47 kwargs['env'].setdefault('PATH', '%(PATH)s') | 47 kwargs['env'].setdefault('PATH', '%(PATH)s') |
| 48 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 48 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
| 49 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) | 49 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
| 50 return self.m.python(name, bot_update_path, cmd, **kwargs) | 50 return self.m.python(name, bot_update_path, cmd, **kwargs) |
| 51 | 51 |
| 52 @property | 52 @property |
| 53 def last_returned_properties(self): | 53 def last_returned_properties(self): |
| 54 return self._last_returned_properties | 54 return self._last_returned_properties |
| 55 | 55 |
| 56 # DO NOT USE. | |
| 57 # The below method will be removed after there are no more callers of | |
| 58 # tryserver.maybe_apply_issue (skbug.com/5588). | |
| 59 def apply_gerrit_ref(self, root, gerrit_no_reset=False, | |
| 60 gerrit_rebase_patch_ref=True, **kwargs): | |
| 61 apply_gerrit_path = self.resource('apply_gerrit.py') | |
| 62 kwargs.setdefault('infra_step', True) | |
| 63 kwargs.setdefault('env', {}) | |
| 64 kwargs['env'].setdefault('PATH', '%(PATH)s') | |
|
tandrii(chromium)
2016/08/19 17:50:42
Just because I can :)
kwargs.setdefault('env', {}
rmistry
2016/08/19 18:11:19
Done.
| |
| 65 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | |
| 66 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) | |
| 67 cmd = [ | |
| 68 '--gerrit_repo', self._repository, | |
| 69 '--gerrit_ref', self._gerrit_ref or '', | |
| 70 '--root', str(root), | |
| 71 ] | |
| 72 if gerrit_no_reset: | |
| 73 cmd.append('--gerrit_no_reset') | |
| 74 if gerrit_rebase_patch_ref: | |
| 75 cmd.append('--gerrit_rebase_patch_ref') | |
| 76 return self.m.python('apply_gerrit', apply_gerrit_path, cmd, **kwargs) | |
| 77 | |
| 56 def ensure_checkout(self, gclient_config=None, suffix=None, | 78 def ensure_checkout(self, gclient_config=None, suffix=None, |
| 57 patch=True, update_presentation=True, | 79 patch=True, update_presentation=True, |
| 58 force=False, patch_root=None, no_shallow=False, | 80 force=False, patch_root=None, no_shallow=False, |
| 59 with_branch_heads=False, refs=None, | 81 with_branch_heads=False, refs=None, |
| 60 patch_oauth2=False, use_site_config_creds=True, | 82 patch_oauth2=False, use_site_config_creds=True, |
| 61 output_manifest=True, clobber=False, | 83 output_manifest=True, clobber=False, |
| 62 root_solution_revision=None, rietveld=None, issue=None, | 84 root_solution_revision=None, rietveld=None, issue=None, |
| 63 patchset=None, gerrit_no_reset=False, | 85 patchset=None, gerrit_no_reset=False, |
| 64 gerrit_rebase_patch_ref=False, **kwargs): | 86 gerrit_rebase_patch_ref=False, **kwargs): |
| 65 """ | 87 """ |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 | 315 |
| 294 # bot_update actually just sets root to be the folder name of the | 316 # bot_update actually just sets root to be the folder name of the |
| 295 # first solution. | 317 # first solution. |
| 296 if step_result.json.output['did_run']: | 318 if step_result.json.output['did_run']: |
| 297 co_root = step_result.json.output['root'] | 319 co_root = step_result.json.output['root'] |
| 298 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 320 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
| 299 if 'checkout' not in self.m.path: | 321 if 'checkout' not in self.m.path: |
| 300 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 322 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
| 301 | 323 |
| 302 return step_result | 324 return step_result |
| OLD | NEW |