Index: tools/auto_bisect/bisect_utils.py |
diff --git a/tools/auto_bisect/bisect_utils.py b/tools/auto_bisect/bisect_utils.py |
index 56a4cd8519c53766fb4aeaa09fab04dc3b948b1d..a0017012d352a94ad7ea971ac5d85c8255021335 100644 |
--- a/tools/auto_bisect/bisect_utils.py |
+++ b/tools/auto_bisect/bisect_utils.py |
@@ -285,18 +285,34 @@ def RunGClientAndCreateConfig(opts, custom_deps=None, cwd=None): |
return return_code |
-def IsDepsFileBlink(): |
+def IsDepsFileBlink(git_revision=''): |
"""Reads .DEPS.git and returns whether or not we're using blink. |
+ Args: |
+ git_revision: A git hash revision of chromium. |
Returns: |
True if blink, false if webkit. |
""" |
- locals = { |
+ git_cmd = ['cat-file', 'blob', '%s:%s' %(git_revision, FILE_DEPS_GIT)] |
+ search_str = 'blink.git' |
+ search_key = 'webkit_url' |
+ (out_put, ret_val) = RunGit(git_cmd) |
+ if ret_val: |
+ search_str = 'blink' |
+ search_key = 'webkit_trunk' |
+ git_cmd = ['cat-file', 'blob', '%s:%s' %(git_revision, 'FILE_DEPS')] |
+ (out_put, ret_val) = RunGit(git_cmd) |
+ if ret_val: |
+ print 'Error processing DEPS or .DEPS.git' |
+ return False |
+ locals = { |
'Var': lambda _: locals["vars"][_], |
'From': lambda *args: None |
} |
- execfile(FILE_DEPS_GIT, {}, locals) |
- return 'blink.git' in locals['vars']['webkit_url'] |
+ |
+ exec out_put in {}, locals |
+ |
+ return search_str in locals['vars'][search_key] |
def OnAccessError(func, path, _): |