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

Unified Diff: Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py

Issue 308793004: Optimize baselines in parallel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address review comments Created 6 years, 7 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 | « no previous file | Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
index 87fbd8e91f75868f90845c7510e93bb99f982c5c..a6d6ac198b14b1a15772f21b6fc1452449703632 100644
--- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
+++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
@@ -48,9 +48,12 @@ def _invert_dictionary(dictionary):
class BaselineOptimizer(object):
ROOT_LAYOUT_TESTS_DIRECTORY = 'LayoutTests'
- def __init__(self, host, port_names):
+ def __init__(self, host, port_names, skip_scm_commands):
self._filesystem = host.filesystem
self._port_factory = host.port_factory
+ self._skip_scm_commands = skip_scm_commands
+ self._files_to_delete = []
+ self._files_to_add = []
self._scm = host.scm()
self._port_names = port_names
# Only used by unittests.
@@ -224,7 +227,10 @@ class BaselineOptimizer(object):
_log.debug(" Deleting (SCM):")
for platform_dir in sorted(self._platform(filename) for filename in scm_files):
_log.debug(" " + platform_dir)
- self._scm.delete_list(scm_files)
+ if self._skip_scm_commands:
+ self._files_to_delete.extend(scm_files)
+ else:
+ self._scm.delete_list(scm_files)
if fs_files:
_log.debug(" Deleting (file system):")
for platform_dir in sorted(self._platform(filename) for filename in fs_files):
@@ -246,7 +252,12 @@ class BaselineOptimizer(object):
_log.debug(" Adding:")
for platform_dir in sorted(self._platform(filename) for filename in file_names):
_log.debug(" " + platform_dir)
- self._scm.add_list(file_names)
+ if self._skip_scm_commands:
+ # Have adds win over deletes.
+ self._files_to_delete = list(set(self._files_to_delete) - set(file_names))
+ self._files_to_add.extend(file_names)
+ else:
+ self._scm.add_list(file_names)
else:
_log.debug(" (Nothing to add)")
@@ -303,7 +314,10 @@ class BaselineOptimizer(object):
break
_log.debug("Deleting redundant virtual root expected result.")
- self._scm.delete(virtual_root_expected_baseline_path)
+ if self._skip_scm_commands:
+ self._files_to_delete.append(virtual_root_expected_baseline_path)
+ else:
+ self._scm.delete(virtual_root_expected_baseline_path)
def optimize(self, baseline_name):
# The virtual fallback path is the same as the non-virtual one tacked on to the bottom of the non-virtual path.
@@ -316,10 +330,10 @@ class BaselineOptimizer(object):
result = self._optimize_subtree(baseline_name)
non_virtual_baseline_name = self._port_factory.get().lookup_virtual_test_base(baseline_name)
if not non_virtual_baseline_name:
- return result
+ return result, self._files_to_delete, self._files_to_add
self._optimize_virtual_root(baseline_name, non_virtual_baseline_name)
_log.debug("Optimizing non-virtual fallback path.")
result |= self._optimize_subtree(non_virtual_baseline_name)
- return result
+ return result, self._files_to_delete, self._files_to_add
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698