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

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

Issue 1919863003: patch_root cleanup: transition everyone to new code. (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
« 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 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': 88 if (root == 'TODO(TANDRII): REMOVE THIS TRANSITION TO patch_projects' or
89 root is None):
89 # This special condition is here for initial rollout of this code, 90 # This special condition is here for initial rollout of this code,
90 # because it's hard to test this change without rolling into build 91 # because it's hard to test this change without rolling into build
91 # repository. 92 # repository.
92 # After the switch to new code is complete, this special TODOstring will 93 # After the switch to new code is complete, this special TODOstring will
93 # be removed in favor of "root is None" 94 # be removed in favor of "root is None"
94 assert patch_project_roots is None 95 assert patch_project_roots is None
95 root = self.m.gclient.calculate_patch_root( 96 root = self.m.gclient.calculate_patch_root(
96 self.m.properties.get('patch_project'), cfg) 97 self.m.properties.get('patch_project'), cfg)
97 # TODO(tandrii): get rid the condition below after transition.
98
99 if root is None:
100 root = cfg.solutions[0].name
101 additional = self.m.rietveld.calculate_issue_root(patch_project_roots)
102 if additional:
103 root = self.m.path.join(root, additional)
104 98
105 if patch: 99 if patch:
106 issue = issue or self._issue 100 issue = issue or self._issue
107 patchset = patchset or self._patchset 101 patchset = patchset or self._patchset
108 patch_url = self._patch_url 102 patch_url = self._patch_url
109 gerrit_repo = self._repository 103 gerrit_repo = self._repository
110 gerrit_ref = self._gerrit_ref 104 gerrit_ref = self._gerrit_ref
111 else: 105 else:
112 # The trybot recipe sometimes wants to de-apply the patch. In which case 106 # The trybot recipe sometimes wants to de-apply the patch. In which case
113 # we pretend the issue/patchset/patch_url never existed. 107 # we pretend the issue/patchset/patch_url never existed.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 281
288 # bot_update actually just sets root to be the folder name of the 282 # bot_update actually just sets root to be the folder name of the
289 # first solution. 283 # first solution.
290 if step_result.json.output['did_run']: 284 if step_result.json.output['did_run']:
291 co_root = step_result.json.output['root'] 285 co_root = step_result.json.output['root']
292 cwd = kwargs.get('cwd', self.m.path['slave_build']) 286 cwd = kwargs.get('cwd', self.m.path['slave_build'])
293 if 'checkout' not in self.m.path: 287 if 'checkout' not in self.m.path:
294 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) 288 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep))
295 289
296 return step_result 290 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