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

Side by Side Diff: scripts/slave/bot_update.py

Issue 550103004: Revert of Teach bot_update to support patching deps in solutions other than the patch_root (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 6 years, 3 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # TODO(hinoka): Use logging. 6 # TODO(hinoka): Use logging.
7 7
8 import cStringIO 8 import cStringIO
9 import codecs 9 import codecs
10 import collections 10 import collections
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 # Get a checkout of each solution, without DEPS or hooks. 1250 # Get a checkout of each solution, without DEPS or hooks.
1251 # Calling git directly because there is no way to run Gclient without 1251 # Calling git directly because there is no way to run Gclient without
1252 # invoking DEPS. 1252 # invoking DEPS.
1253 print 'Fetching Git checkout' 1253 print 'Fetching Git checkout'
1254 git_ref = git_checkout(solutions, revisions, shallow, with_branch_heads) 1254 git_ref = git_checkout(solutions, revisions, shallow, with_branch_heads)
1255 1255
1256 patches = None 1256 patches = None
1257 if patch_url: 1257 if patch_url:
1258 patches = get_svn_patch(patch_url) 1258 patches = get_svn_patch(patch_url)
1259 1259
1260 already_patched = []
1261 for solution in solutions: 1260 for solution in solutions:
1262 if (patch_root == solution['name'] or 1261 # At first, only patch top-level DEPS.
1263 solution['name'].startswith(patch_root + '/')): 1262 if patch_root == solution['name']:
1264 relative_root = solution['name'][len(patch_root) + 1:]
1265 target = '/'.join([relative_root, 'DEPS']).lstrip('/')
1266 if patches: 1263 if patches:
1267 apply_svn_patch(patch_root, patches, whitelist=[target]) 1264 apply_svn_patch(patch_root, patches, whitelist=['DEPS'])
1268 already_patched.append(target)
1269 elif issue: 1265 elif issue:
1270 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server, 1266 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1271 revision_mapping, git_ref, whitelist=[target]) 1267 revision_mapping, git_ref, whitelist=['DEPS'])
1272 already_patched.append(target) 1268 break
1273 1269
1274 if buildspec: 1270 if buildspec:
1275 buildspecs2git(first_sln, buildspec) 1271 buildspecs2git(first_sln, buildspec)
1276 else: 1272 else:
1277 # Run deps2git if there is a DEPS change after the last .DEPS.git commit. 1273 # Run deps2git if there is a DEPS change after the last .DEPS.git commit.
1278 for solution in solutions: 1274 for solution in solutions:
1279 ensure_deps2git(solution, shallow) 1275 ensure_deps2git(solution, shallow)
1280 1276
1281 # Ensure our build/ directory is set up with the correct .gclient file. 1277 # Ensure our build/ directory is set up with the correct .gclient file.
1282 gclient_configure(solutions, target_os, target_os_only) 1278 gclient_configure(solutions, target_os, target_os_only)
(...skipping 12 matching lines...) Expand all
1295 # TODO(hinoka): Remove this when the official builders run their own 1291 # TODO(hinoka): Remove this when the official builders run their own
1296 # runhooks step. 1292 # runhooks step.
1297 gclient_runhooks(gyp_env) 1293 gclient_runhooks(gyp_env)
1298 1294
1299 # Finally, ensure that all DEPS are pinned to the correct revision. 1295 # Finally, ensure that all DEPS are pinned to the correct revision.
1300 dir_names = [sln['name'] for sln in solutions] 1296 dir_names = [sln['name'] for sln in solutions]
1301 ensure_deps_revisions(gclient_output.get('solutions', {}), 1297 ensure_deps_revisions(gclient_output.get('solutions', {}),
1302 dir_names, revisions) 1298 dir_names, revisions)
1303 # Apply the rest of the patch here (sans DEPS) 1299 # Apply the rest of the patch here (sans DEPS)
1304 if patches: 1300 if patches:
1305 apply_svn_patch(patch_root, patches, blacklist=already_patched) 1301 apply_svn_patch(patch_root, patches, blacklist=['DEPS'])
1306 elif issue: 1302 elif issue:
1307 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server, 1303 apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
1308 revision_mapping, git_ref, blacklist=already_patched) 1304 revision_mapping, git_ref, blacklist=['DEPS'])
1309 1305
1310 # Reset the deps_file point in the solutions so that hooks get run properly. 1306 # Reset the deps_file point in the solutions so that hooks get run properly.
1311 for sln in solutions: 1307 for sln in solutions:
1312 sln['deps_file'] = sln.get('deps_file', 'DEPS').replace('.DEPS.git', 'DEPS') 1308 sln['deps_file'] = sln.get('deps_file', 'DEPS').replace('.DEPS.git', 'DEPS')
1313 gclient_configure(solutions, target_os, target_os_only) 1309 gclient_configure(solutions, target_os, target_os_only)
1314 1310
1315 return gclient_output 1311 return gclient_output
1316 1312
1317 1313
1318 def parse_revisions(revisions, root): 1314 def parse_revisions(revisions, root):
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 except Exception: 1636 except Exception:
1641 # Unexpected failure. 1637 # Unexpected failure.
1642 emit_flag(options.flag_file) 1638 emit_flag(options.flag_file)
1643 raise 1639 raise
1644 else: 1640 else:
1645 emit_flag(options.flag_file) 1641 emit_flag(options.flag_file)
1646 1642
1647 1643
1648 if __name__ == '__main__': 1644 if __name__ == '__main__':
1649 sys.exit(main()) 1645 sys.exit(main())
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