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

Unified Diff: tools/bisect_utils.py

Issue 14265008: Delete webkit directory on initial sync as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/bisect-perf-regression.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bisect_utils.py
diff --git a/tools/bisect_utils.py b/tools/bisect_utils.py
index 4447f48ecc20fee3aeb02e938c73ec3d6b7d97c3..590c4c9308d833967e2466ab49d5f7c290eed81a 100644
--- a/tools/bisect_utils.py
+++ b/tools/bisect_utils.py
@@ -8,6 +8,7 @@ used by the bisection scripts."""
import errno
import os
+import shutil
import subprocess
@@ -29,6 +30,7 @@ solutions = [
]
"""
GCLIENT_SPEC = ''.join([l for l in GCLIENT_SPEC.splitlines()])
+FILE_DEPS_GIT = '.DEPS.git'
def OutputAnnotationStepStart(name):
@@ -103,6 +105,34 @@ def RunGClientAndCreateConfig():
return return_code
+def IsDepsFileBlink():
+ """Reads .DEPS.git and returns whether or not we're using blink.
+
+ Returns:
+ True if blink, false if webkit.
+ """
+ locals = {'Var': lambda _: locals["vars"][_],
+ 'From': lambda *args: None}
+ execfile(FILE_DEPS_GIT, {}, locals)
+ return 'blink.git' in locals['vars']['webkit_url']
+
+
+def RemoveThirdPartyWebkitDirectory():
+ """Removes third_party/WebKit.
+
+ Returns:
+ True on success.
+ """
+ try:
+ path_to_dir = os.path.join(os.getcwd(), 'third_party', 'WebKit')
+ if os.path.exists(path_to_dir):
+ shutil.rmtree(path_to_dir)
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ return False
+ return True
+
+
def RunGClientAndSync(reset):
"""Runs gclient and does a normal sync.
@@ -137,7 +167,17 @@ def SetupGitDepot(output_buildbot_annotations, reset):
passed = False
if not RunGClientAndCreateConfig():
- if not RunGClientAndSync(reset):
+ passed_deps_check = True
+ if os.path.isfile(os.path.join('src', FILE_DEPS_GIT)):
+ cwd = os.getcwd()
+ os.chdir('src')
+ if not IsDepsFileBlink():
+ passed_deps_check = RemoveThirdPartyWebkitDirectory()
+ else:
+ passed_deps_check = True
+ os.chdir(cwd)
+
+ if passed_deps_check and not RunGClientAndSync(reset):
passed = True
if output_buildbot_annotations:
« no previous file with comments | « tools/bisect-perf-regression.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698