Title: [109963] trunk/Tools
Revision
109963
Author
[email protected]
Date
2012-03-06 14:52:33 -0800 (Tue, 06 Mar 2012)

Log Message

Copying old baselines throws an error if the new directory doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=80443

Reviewed by Adam Barth.

Existing tests cover the new code with the fix to filesystem_mock.

* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.copyfile):
Fix the mock to better match python's copyfile semantics.

* Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py:
(Rebaseliner._create_html_baseline_files):
* Scripts/webkitpy/tool/commands/rebaseline.py:
(RebaselineTest._copy_existing_baseline):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (109962 => 109963)


--- trunk/Tools/ChangeLog	2012-03-06 22:45:12 UTC (rev 109962)
+++ trunk/Tools/ChangeLog	2012-03-06 22:52:33 UTC (rev 109963)
@@ -1,3 +1,21 @@
+2012-03-06  Ojan Vafai  <[email protected]>
+
+        Copying old baselines throws an error if the new directory doesn't exist
+        https://bugs.webkit.org/show_bug.cgi?id=80443
+
+        Reviewed by Adam Barth.
+
+        Existing tests cover the new code with the fix to filesystem_mock.
+
+        * Scripts/webkitpy/common/system/filesystem_mock.py:
+        (MockFileSystem.copyfile):
+        Fix the mock to better match python's copyfile semantics.
+
+        * Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py:
+        (Rebaseliner._create_html_baseline_files):
+        * Scripts/webkitpy/tool/commands/rebaseline.py:
+        (RebaselineTest._copy_existing_baseline):
+
 2012-03-05  Ojan Vafai  <[email protected]>
 
         Add a mechanism to rebaseline new ports

Modified: trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py (109962 => 109963)


--- trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py	2012-03-06 22:45:12 UTC (rev 109962)
+++ trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py	2012-03-06 22:52:33 UTC (rev 109963)
@@ -110,6 +110,8 @@
             raise IOError(errno.EISDIR, source, os.strerror(errno.ISDIR))
         if self.isdir(destination):
             raise IOError(errno.EISDIR, destination, os.strerror(errno.ISDIR))
+        if not self.exists(self.dirname(destination)):
+            raise IOError(errno.ENOENT, destination, os.strerror(errno.ENOENT))
 
         self.files[destination] = self.files[source]
         self.written_files[destination] = self.files[source]

Modified: trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py (109962 => 109963)


--- trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py	2012-03-06 22:45:12 UTC (rev 109962)
+++ trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py	2012-03-06 22:52:33 UTC (rev 109963)
@@ -550,6 +550,7 @@
         baseline_filename = self._filesystem.basename(baseline_fullpath)
         new_file = get_result_file_fullpath(self._filesystem, self._options.html_directory,
                                             baseline_filename, self._platform, 'new')
+        self._filesystem.maybe_make_directory(self._filesystem.dirname(new_file))
         self._filesystem.copyfile(baseline_fullpath, new_file)
         _log.debug('  Html: copied new baseline file from "%s" to "%s".',
                   baseline_fullpath, new_file)

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py (109962 => 109963)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-03-06 22:45:12 UTC (rev 109962)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-03-06 22:52:33 UTC (rev 109963)
@@ -80,6 +80,7 @@
             print("Existing baseline at %s, not copying over it." % new_baseline)
         else:
             print("Copying baseline from %s to %s." % (old_baseline, new_baseline))
+            self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dirname(new_baseline))
             self._tool.filesystem.copyfile(old_baseline, new_baseline)
             if not self._tool.scm().exists(new_baseline):
                 self._tool.scm().add(new_baseline)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to