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

Side by Side Diff: tools/auto_bisect/bisect_utils.py

Issue 503283002: Update bisect script to handle deleted .DEPS.git from chromium source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | tools/auto_bisect/source_control.py » ('j') | 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 """Utility functions used by the bisect tool. 5 """Utility functions used by the bisect tool.
6 6
7 This includes functions related to checking out the depot and outputting 7 This includes functions related to checking out the depot and outputting
8 annotations for the Buildbot waterfall. 8 annotations for the Buildbot waterfall.
9 """ 9 """
10 10
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 spec = ''.join([l for l in spec.splitlines()]) 278 spec = ''.join([l for l in spec.splitlines()])
279 279
280 if 'android' in opts.target_platform: 280 if 'android' in opts.target_platform:
281 spec += GCLIENT_SPEC_ANDROID 281 spec += GCLIENT_SPEC_ANDROID
282 282
283 return_code = RunGClient( 283 return_code = RunGClient(
284 ['config', '--spec=%s' % spec], cwd=cwd) 284 ['config', '--spec=%s' % spec], cwd=cwd)
285 return return_code 285 return return_code
286 286
287 287
288 def IsDepsFileBlink(): 288 def IsDepsFileBlink(git_revision=''):
289 """Reads .DEPS.git and returns whether or not we're using blink. 289 """Reads .DEPS.git and returns whether or not we're using blink.
290 290
291 Args:
292 git_revision: A git hash revision of chromium.
291 Returns: 293 Returns:
292 True if blink, false if webkit. 294 True if blink, false if webkit.
293 """ 295 """
294 locals = { 296 git_cmd = ['cat-file', 'blob', '%s:%s' %(git_revision, FILE_DEPS_GIT)]
297 search_str = 'blink.git'
298 search_key = 'webkit_url'
299 (out_put, ret_val) = RunGit(git_cmd)
300 if ret_val:
301 search_str = 'blink'
302 search_key = 'webkit_trunk'
303 git_cmd = ['cat-file', 'blob', '%s:%s' %(git_revision, 'FILE_DEPS')]
304 (out_put, ret_val) = RunGit(git_cmd)
305 if ret_val:
306 print 'Error processing DEPS or .DEPS.git'
307 return False
308 locals = {
295 'Var': lambda _: locals["vars"][_], 309 'Var': lambda _: locals["vars"][_],
296 'From': lambda *args: None 310 'From': lambda *args: None
297 } 311 }
298 execfile(FILE_DEPS_GIT, {}, locals) 312
299 return 'blink.git' in locals['vars']['webkit_url'] 313 exec out_put in {}, locals
314
315 return search_str in locals['vars'][search_key]
300 316
301 317
302 def OnAccessError(func, path, _): 318 def OnAccessError(func, path, _):
303 """Error handler for shutil.rmtree. 319 """Error handler for shutil.rmtree.
304 320
305 Source: http://goo.gl/DEYNCT 321 Source: http://goo.gl/DEYNCT
306 322
307 If the error is due to an access error (read only file), it attempts to add 323 If the error is due to an access error (read only file), it attempts to add
308 write permissions, then retries. 324 write permissions, then retries.
309 325
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return sys.platform.startswith('linux') 606 return sys.platform.startswith('linux')
591 607
592 608
593 def IsMacHost(): 609 def IsMacHost():
594 """Checks whether or not the script is running on Mac. 610 """Checks whether or not the script is running on Mac.
595 611
596 Returns: 612 Returns:
597 True if running on Mac. 613 True if running on Mac.
598 """ 614 """
599 return sys.platform.startswith('darwin') 615 return sys.platform.startswith('darwin')
OLDNEW
« no previous file with comments | « no previous file | tools/auto_bisect/source_control.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698