webkit-patch optimize-baselines should add/delete files in batches from the vcs
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 21:46:29 +0000 (21:46 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 21:46:29 +0000 (21:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87538

Reviewed by Ojan Vafai.

Invoking git and svn on one file at a time is kinda slow. We
should batch the add and rm operations together.

* Scripts/webkitpy/common/checkout/baselineoptimizer.py:
(BaselineOptimizer._move_baselines):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118838 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py

index d404739..a37148d 100644 (file)
@@ -1,5 +1,18 @@
 2012-05-29  Dirk Pranke  <dpranke@chromium.org>
 
+        webkit-patch optimize-baselines should add/delete files in batches from the vcs
+        https://bugs.webkit.org/show_bug.cgi?id=87538
+
+        Reviewed by Ojan Vafai.
+
+        Invoking git and svn on one file at a time is kinda slow. We
+        should batch the add and rm operations together.
+
+        * Scripts/webkitpy/common/checkout/baselineoptimizer.py:
+        (BaselineOptimizer._move_baselines):
+
+2012-05-29  Dirk Pranke  <dpranke@chromium.org>
+
         garden-o-matic should rebaseline baselines in parallel
         https://bugs.webkit.org/show_bug.cgi?id=87451
 
index b305c19..8ae0bb9 100644 (file)
@@ -154,17 +154,22 @@ class BaselineOptimizer(object):
                 source = self._filesystem.join(self._scm.checkout_root, directory, baseline_name)
                 data_for_result[result] = self._filesystem.read_binary_file(source)
 
+        file_names = []
         for directory, result in results_by_directory.items():
             if new_results_by_directory.get(directory) != result:
-                file_name = self._filesystem.join(self._scm.checkout_root, directory, baseline_name)
-                self._scm.delete(file_name)
+                file_names.append(self._filesystem.join(self._scm.checkout_root, directory, baseline_name))
+        if file_names:
+            self._scm.delete_list(file_names)
 
+        file_names = []
         for directory, result in new_results_by_directory.items():
             if results_by_directory.get(directory) != result:
                 destination = self._filesystem.join(self._scm.checkout_root, directory, baseline_name)
                 self._filesystem.maybe_make_directory(self._filesystem.split(destination)[0])
                 self._filesystem.write_binary_file(destination, data_for_result[result])
-                self._scm.add(destination)
+                file_names.append(destination)
+        if file_names:
+            self._scm.add_list(file_names)
 
     def directories_by_result(self, baseline_name):
         results_by_directory = self._read_results_by_directory(baseline_name)