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 26 matching lines...) Expand all Loading... |
37 kwargs['env'].setdefault('PATH', '%(PATH)s') | 37 kwargs['env'].setdefault('PATH', '%(PATH)s') |
38 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 38 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
39 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) | 39 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
40 return self.m.python(name, bot_update_path, cmd, **kwargs) | 40 return self.m.python(name, bot_update_path, cmd, **kwargs) |
41 | 41 |
42 @property | 42 @property |
43 def last_returned_properties(self): | 43 def last_returned_properties(self): |
44 return self._last_returned_properties | 44 return self._last_returned_properties |
45 | 45 |
46 # DO NOT USE. | 46 # DO NOT USE. |
47 # The below method will be removed after there are no more callers of | 47 # TODO(tandrii): refactor this into tryserver.maybe_apply_patch |
48 # tryserver.maybe_apply_issue (skbug.com/5588). | |
49 def apply_gerrit_ref(self, root, gerrit_no_reset=False, | 48 def apply_gerrit_ref(self, root, gerrit_no_reset=False, |
50 gerrit_no_rebase_patch_ref=False, **kwargs): | 49 gerrit_no_rebase_patch_ref=False, **kwargs): |
51 apply_gerrit_path = self.resource('apply_gerrit.py') | 50 apply_gerrit_path = self.resource('apply_gerrit.py') |
52 kwargs.setdefault('infra_step', True) | 51 kwargs.setdefault('infra_step', True) |
53 kwargs.setdefault('env', {}).setdefault('PATH', '%(PATH)s') | 52 kwargs.setdefault('env', {}).setdefault('PATH', '%(PATH)s') |
54 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 53 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
55 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) | 54 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
56 cmd = [ | 55 cmd = [ |
57 '--gerrit_repo', self._repository, | 56 '--gerrit_repo', self._repository, |
58 '--gerrit_ref', self._gerrit_ref or '', | 57 '--gerrit_ref', self._gerrit_ref or '', |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 299 |
301 # bot_update actually just sets root to be the folder name of the | 300 # bot_update actually just sets root to be the folder name of the |
302 # first solution. | 301 # first solution. |
303 if step_result.json.output['did_run']: | 302 if step_result.json.output['did_run']: |
304 co_root = step_result.json.output['root'] | 303 co_root = step_result.json.output['root'] |
305 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 304 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
306 if 'checkout' not in self.m.path: | 305 if 'checkout' not in self.m.path: |
307 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 306 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
308 | 307 |
309 return step_result | 308 return step_result |
OLD | NEW |