2011-01-13 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2011 01:51:57 +0000 (01:51 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2011 01:51:57 +0000 (01:51 +0000)
        Reviewed by Adam Barth.

        results archives from commit-queue are too large to upload
        https://bugs.webkit.org/show_bug.cgi?id=52405

        * Scripts/webkitpy/common/system/filesystem.py:
        * Scripts/webkitpy/common/system/filesystem_mock.py:
        * Scripts/webkitpy/tool/commands/queues.py:

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

Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/filesystem.py
Tools/Scripts/webkitpy/common/system/filesystem_mock.py
Tools/Scripts/webkitpy/tool/commands/queues.py

index 2c534517198f5596f389fc4423ea9a45ca2029d7..8a3a748b1e07ed16851e6d6f60e39a2f11f2ba76 100644 (file)
@@ -1,3 +1,14 @@
+2011-01-13  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Adam Barth.
+
+        results archives from commit-queue are too large to upload
+        https://bugs.webkit.org/show_bug.cgi?id=52405
+
+        * Scripts/webkitpy/common/system/filesystem.py:
+        * Scripts/webkitpy/common/system/filesystem_mock.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+
 2011-01-13  Alejandro G. Castro  <alex@igalia.com>
 
         Reviewed by Martin Robinson.
index 8830ea8dc6c051da4b324eeffca20617071290d1..527b6bdea5ad68da2530f3069fe7f87bf2eb6eb2 100644 (file)
@@ -124,6 +124,9 @@ class FileSystem(object):
                 if retry_timeout_sec < 0:
                     raise e
 
+    def remove_tree(self, path, ignore_errors=False):
+        shutil.rmtree(path, ignore_errors)
+
     def read_binary_file(self, path):
         """Return the contents of the file at the given path as a byte string."""
         with file(path, 'rb') as f:
index c605cb218d7be26bbf3301e88c7d8691aec248fc..809c4c6fbaabac056565a7d63e6cbc9353b9b1fc 100644 (file)
@@ -116,3 +116,6 @@ class MockFileSystem(object):
 
     def remove(self, path):
         del self.files[path]
+
+    def remove_tree(self, path, ignore_errors=False):
+        self.files = [file for file in self.files if not file.startswith(path)]
index 90b2b4dd94867a3e78c58b4238fe9d54eec43815..42321cfb45bae8f29e55b1e838f378e032ad7458 100644 (file)
@@ -323,7 +323,11 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
         results_name, _ = os.path.splitext(os.path.basename(results_directory))
         # Note: We name the zip with the bug_id instead of patch_id to match work_item_log_path().
         zip_path = self._tool.workspace.find_unused_filename(self._log_directory(), "%s-%s" % (patch.bug_id(), results_name), "zip")
-        return self._tool.workspace.create_zip(zip_path, results_directory)
+        archive = self._tool.workspace.create_zip(zip_path, results_directory)
+        # Remove the results directory to prevent http logs, etc. from getting huge between runs.
+        # We could have create_zip remove the original, but this is more explicit.
+        self._tool.filesystem.remove_tree(results_directory, ignore_errors=True)
+        return archive
 
     def refetch_patch(self, patch):
         return self._tool.bugs.fetch_attachment(patch.id())