Bug 80443 - Copying old baselines throws an error if the new directory doesn't exist
Summary: Copying old baselines throws an error if the new directory doesn't exist
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ojan Vafai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-06 14:39 PST by Ojan Vafai
Modified: 2012-03-06 18:16 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.25 KB, patch)
2012-03-06 14:40 PST, Ojan Vafai
no flags Details | Formatted Diff | Diff
Patch (3.63 KB, patch)
2012-03-06 14:50 PST, Ojan Vafai
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 ...