Title: [173438] trunk/Tools
Revision
173438
Author
[email protected]
Date
2014-09-09 13:12:56 -0700 (Tue, 09 Sep 2014)

Log Message

svn-{apply, unapply} fails to apply/unapply SVN 1.7 patch that adds new file with property change
https://bugs.webkit.org/show_bug.cgi?id=136379

Patch by Daniel Bates <[email protected]> on 2014-09-09
Reviewed by David Kilzer.

Fixes an issue where svn-{apply, unapply} fail to apply or unapply, respectively,
a patch generated using Subversion 1.7.4 (r1295709) that both adds a new file F
and sets a property on F (say, the executable bit).

* Scripts/svn-apply:
(patch): Only add file if the diff has text chunks.
* Scripts/svn-unapply:
(patch): Only delete added file if the diff has text chunks.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (173437 => 173438)


--- trunk/Tools/ChangeLog	2014-09-09 19:51:15 UTC (rev 173437)
+++ trunk/Tools/ChangeLog	2014-09-09 20:12:56 UTC (rev 173438)
@@ -1,3 +1,19 @@
+2014-09-09  Daniel Bates  <[email protected]>
+
+        svn-{apply, unapply} fails to apply/unapply SVN 1.7 patch that adds new file with property change
+        https://bugs.webkit.org/show_bug.cgi?id=136379
+
+        Reviewed by David Kilzer.
+
+        Fixes an issue where svn-{apply, unapply} fail to apply or unapply, respectively,
+        a patch generated using Subversion 1.7.4 (r1295709) that both adds a new file F
+        and sets a property on F (say, the executable bit).
+
+        * Scripts/svn-apply:
+        (patch): Only add file if the diff has text chunks.
+        * Scripts/svn-unapply:
+        (patch): Only delete added file if the diff has text chunks.
+
 2014-09-09  Carlos Alberto Lopez Perez  <[email protected]>
 
         [GTK] Unreviewed GTK gardening.

Modified: trunk/Tools/Scripts/svn-apply (173437 => 173438)


--- trunk/Tools/Scripts/svn-apply	2014-09-09 19:51:15 UTC (rev 173437)
+++ trunk/Tools/Scripts/svn-apply	2014-09-09 20:12:56 UTC (rev 173438)
@@ -353,10 +353,10 @@
         } elsif ($deletion) {
             applyPatch($patch, $fullPath, ["--force"]) if $patch;
             scmRemove($fullPath);
-        } elsif ($addition) {
+        } elsif ($addition && $hasTextChunks) {
             # Addition
             rename($fullPath, "$fullPath.orig") if -e $fullPath;
-            applyPatch($patch, $fullPath) if $patch;
+            applyPatch($patch, $fullPath);
             unlink("$fullPath.orig") if -e "$fullPath.orig" && checksum($fullPath) eq checksum("$fullPath.orig");
             scmAdd($fullPath);
             my $escapedFullPath = escapeSubversionPath("$fullPath.orig");

Modified: trunk/Tools/Scripts/svn-unapply (173437 => 173438)


--- trunk/Tools/Scripts/svn-unapply	2014-09-09 19:51:15 UTC (rev 173437)
+++ trunk/Tools/Scripts/svn-unapply	2014-09-09 20:12:56 UTC (rev 173438)
@@ -200,13 +200,13 @@
 
             # Show status if the file is modifed
             system "svn", "stat", $escapedFullPath;
-        } elsif ($addition) {
+        } elsif ($addition && $hasTextChunks) {
             # Reverse addition
             #
             # FIXME: This should use the same logic as svn-apply's deletion
             #        code.  In particular, svn-apply's scmRemove() subroutine
             #        should be used here.
-            unapplyPatch($patch, $fullPath, ["--force"]) if $patch;
+            unapplyPatch($patch, $fullPath, ["--force"]);
             unlink($fullPath) if -z $fullPath;
             system "svn", "revert", $escapedFullPath;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to