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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 the 'rietveld' property. | 71 the 'rietveld' property. |
72 issue: The rietveld issue number to use. If omitted, will infer from | 72 issue: The rietveld issue number to use. If omitted, will infer from |
73 the 'issue' property. | 73 the 'issue' property. |
74 patchset: The rietveld issue patchset to use. If omitted, will infer from | 74 patchset: The rietveld issue patchset to use. If omitted, will infer from |
75 the 'patchset' property. | 75 the 'patchset' property. |
76 """ | 76 """ |
77 refs = refs or [] | 77 refs = refs or [] |
78 # We can re-use the gclient spec from the gclient module, since all the | 78 # We can re-use the gclient spec from the gclient module, since all the |
79 # data bot_update needs is already configured into the gclient spec. | 79 # data bot_update needs is already configured into the gclient spec. |
80 cfg = gclient_config or self.m.gclient.c | 80 cfg = gclient_config or self.m.gclient.c |
| 81 assert cfg is not None, ( |
| 82 'missing gclient_config or forgot api.gclient.set_config(...) before?') |
81 | 83 |
82 # Used by bot_update to determine if we want to run or not. | 84 # Used by bot_update to determine if we want to run or not. |
83 master = self._mastername | 85 master = self._mastername |
84 builder = self._buildername | 86 builder = self._buildername |
85 slave = self._slavename | 87 slave = self._slavename |
86 | 88 |
87 # Construct our bot_update command. This basically be inclusive of | 89 # Construct our bot_update command. This basically be inclusive of |
88 # everything required for bot_update to know: | 90 # everything required for bot_update to know: |
89 root = patch_root | 91 root = patch_root |
90 if root is None: | 92 if root is None: |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 290 |
289 # bot_update actually just sets root to be the folder name of the | 291 # bot_update actually just sets root to be the folder name of the |
290 # first solution. | 292 # first solution. |
291 if step_result.json.output['did_run']: | 293 if step_result.json.output['did_run']: |
292 co_root = step_result.json.output['root'] | 294 co_root = step_result.json.output['root'] |
293 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 295 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
294 if 'checkout' not in self.m.path: | 296 if 'checkout' not in self.m.path: |
295 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 297 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
296 | 298 |
297 return step_result | 299 return step_result |
OLD | NEW |