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

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

Issue 1917433002: Generalize patch_project to patch root conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 cfg = gclient_config or self.m.gclient.c 78 cfg = gclient_config or self.m.gclient.c
79 79
80 # Used by bot_update to determine if we want to run or not. 80 # Used by bot_update to determine if we want to run or not.
81 master = self._mastername 81 master = self._mastername
82 builder = self._buildername 82 builder = self._buildername
83 slave = self._slavename 83 slave = self._slavename
84 84
85 # Construct our bot_update command. This basically be inclusive of 85 # Construct our bot_update command. This basically be inclusive of
86 # everything required for bot_update to know: 86 # everything required for bot_update to know:
87 root = patch_root 87 root = patch_root
88 if root == 'TODO(TANDRII): REMOVE THIS TRANSITION TO patch_projects':
89 assert patch_project_roots is None
90 root = self.m.gclient.calculate_patch_root(
91 self.m.properties.get('patch_project'), cfg)
92 # TODO(tandrii): get rid the condition below after transition.
93
88 if root is None: 94 if root is None:
89 root = cfg.solutions[0].name 95 root = cfg.solutions[0].name
90 additional = self.m.rietveld.calculate_issue_root(patch_project_roots) 96 additional = self.m.rietveld.calculate_issue_root(patch_project_roots)
91 if additional: 97 if additional:
92 root = self.m.path.join(root, additional) 98 root = self.m.path.join(root, additional)
93 99
94 if patch: 100 if patch:
95 issue = issue or self._issue 101 issue = issue or self._issue
96 patchset = patchset or self._patchset 102 patchset = patchset or self._patchset
97 patch_url = self._patch_url 103 patch_url = self._patch_url
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 276
271 # bot_update actually just sets root to be the folder name of the 277 # bot_update actually just sets root to be the folder name of the
272 # first solution. 278 # first solution.
273 if step_result.json.output['did_run']: 279 if step_result.json.output['did_run']:
274 co_root = step_result.json.output['root'] 280 co_root = step_result.json.output['root']
275 cwd = kwargs.get('cwd', self.m.path['slave_build']) 281 cwd = kwargs.get('cwd', self.m.path['slave_build'])
276 if 'checkout' not in self.m.path: 282 if 'checkout' not in self.m.path:
277 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) 283 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep))
278 284
279 return step_result 285 return step_result
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698