Title: [117714] trunk/Tools
- Revision
- 117714
- Author
- [email protected]
- Date
- 2012-05-20 16:29:58 -0700 (Sun, 20 May 2012)
Log Message
svn-apply fails to apply a patch that moves files from directory A to A/B
https://bugs.webkit.org/show_bug.cgi?id=86973
Reviewed by Eric Seidel.
Fixes an issue where svn-apply fails to apply a patch that moves files in a
directory A to some sub-directory B in A with a Git checkout of WebKit.
Currently, svn-apply only creates new directories along a file system path that
it hasn't already processed. That is, if svn-apply creates/traverses all the
intermediate directories along the path A/B then it will assume the directory A/B
exists for all subsequent requests to create sub-directories in A/B (e.g. A/B/C).
When moving a file F in directory A to directory A/B using a Git checkout, Git
may remove directory A if F is the last file in A. Therefore, svn-apply will fail
to create sub-directory B in A (since A no longer exists).
* Scripts/svn-apply:
(addDirectoriesIfNeeded):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (117713 => 117714)
--- trunk/Tools/ChangeLog 2012-05-20 23:12:57 UTC (rev 117713)
+++ trunk/Tools/ChangeLog 2012-05-20 23:29:58 UTC (rev 117714)
@@ -1,3 +1,24 @@
+2012-05-20 Daniel Bates <[email protected]>
+
+ svn-apply fails to apply a patch that moves files from directory A to A/B
+ https://bugs.webkit.org/show_bug.cgi?id=86973
+
+ Reviewed by Eric Seidel.
+
+ Fixes an issue where svn-apply fails to apply a patch that moves files in a
+ directory A to some sub-directory B in A with a Git checkout of WebKit.
+
+ Currently, svn-apply only creates new directories along a file system path that
+ it hasn't already processed. That is, if svn-apply creates/traverses all the
+ intermediate directories along the path A/B then it will assume the directory A/B
+ exists for all subsequent requests to create sub-directories in A/B (e.g. A/B/C).
+ When moving a file F in directory A to directory A/B using a Git checkout, Git
+ may remove directory A if F is the last file in A. Therefore, svn-apply will fail
+ to create sub-directory B in A (since A no longer exists).
+
+ * Scripts/svn-apply:
+ (addDirectoriesIfNeeded):
+
2012-05-20 Gyuyoung Kim <[email protected]>
[Chromium] Print layout test result on buildbot
Modified: trunk/Tools/Scripts/svn-apply (117713 => 117714)
--- trunk/Tools/Scripts/svn-apply 2012-05-20 23:12:57 UTC (rev 117713)
+++ trunk/Tools/Scripts/svn-apply 2012-05-20 23:29:58 UTC (rev 117714)
@@ -161,12 +161,16 @@
sub addDirectoriesIfNeeded($)
{
+ # Git removes a directory once the last file in it is removed. We need
+ # explicitly check for the existence of each directory along the path
+ # (and create it if it doesn't) so as to support patches that move all files in
+ # directory A to A/B. That is, we cannot depend on %checkedDirectories.
my ($path) = @_;
my @dirs = File::Spec->splitdir($path);
my $dir = ".";
while (scalar @dirs) {
$dir = File::Spec->catdir($dir, shift @dirs);
- next if exists $checkedDirectories{$dir};
+ next if !isGit() && exists $checkedDirectories{$dir};
if (! -e $dir) {
mkdir $dir or die "Failed to create required directory '$dir' for path '$path'\n";
scmAdd($dir);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes