Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1213)

Side by Side Diff: recipe_modules/bot_update/api.py

Issue 2175343002: bot_update: improve UX when gclient is not configured. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: how about this? Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698