Bug 80443

Summary: Copying old baselines throws an error if the new directory doesn't exist
Product: WebKit Reporter: Ojan Vafai <ojan>
Component: New BugsAssignee: Ojan Vafai <ojan>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dpranke, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch abarth: review+

Description Ojan Vafai 2012-03-06 14:39:07 PST
Copying old baselines throws an error if the new directory doesn't exist
Comment 1 Ojan Vafai 2012-03-06 14:40:50 PST
Created attachment 130445 [details]
Patch
Comment 2 Adam Barth 2012-03-06 14:43:12 PST
Comment on attachment 130445 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=130445&action=review

> Tools/Scripts/webkitpy/common/system/filesystem.py:73
> +        self.maybe_make_directory(self.dirname(destination))

copyfile is supposed to just be a wrapper around shutil.copyfile with the same semantics.  We should change the callers of copyfile to call maybe_make_directory or provide a new function that does both.
Comment 3 Ojan Vafai 2012-03-06 14:44:44 PST
(In reply to comment #2)
> (From update of attachment 130445 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=130445&action=review
> 
> > Tools/Scripts/webkitpy/common/system/filesystem.py:73
> > +        self.maybe_make_directory(self.dirname(destination))
> 
> copyfile is supposed to just be a wrapper around shutil.copyfile with the same semantics.  We should change the callers of copyfile to call maybe_make_directory or provide a new function that does both.

Why is it important that the semantics match?
Comment 4 Adam Barth 2012-03-06 14:47:17 PST
> Why is it important that the semantics match?

The idea behind filesystem is just to be able to mock out access to the real file system.  Having the functions match the native python functions means you can read the python docs to see how they work.
Comment 5 Ojan Vafai 2012-03-06 14:50:48 PST
Created attachment 130447 [details]
Patch
Comment 6 Adam Barth 2012-03-06 14:51:26 PST
Comment on attachment 130447 [details]
Patch

Thanks.
Comment 7 Ojan Vafai 2012-03-06 14:53:43 PST
Committed r109963: <http://trac.webkit.org/changeset/109963>
Comment 8 Dirk Pranke 2012-03-06 18:16:12 PST
I think this change broke test_start_cmd (webkitpy.layout_tests.servers.http_server_unittest.TestHttpServer) on the mac. I'll fix that in a separate change ...