[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:31:46 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 67d284783b6b8dc189b708281b82a133a26e32c2
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 22 09:48:37 2009 +0000
2009-09-22 Eric Seidel <eric at webkit.org>
Reviewed by David Kilzer.
svn-apply can't handle single-line binary file additions
https://bugs.webkit.org/show_bug.cgi?id=29100
Fixed the regexp and added a unit test.
* Scripts/modules/scm_unittest.py:
* Scripts/svn-apply:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c00b86c..c0249e3 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2009-09-22 Eric Seidel <eric at webkit.org>
+
+ Reviewed by David Kilzer.
+
+ svn-apply can't handle single-line binary file additions
+ https://bugs.webkit.org/show_bug.cgi?id=29100
+
+ Fixed the regexp and added a unit test.
+
+ * Scripts/modules/scm_unittest.py:
+ * Scripts/svn-apply:
+
2009-09-11 Eric Seidel <eric at webkit.org>
Reviewed by David Kilzer.
diff --git a/WebKitTools/Scripts/modules/scm_unittest.py b/WebKitTools/Scripts/modules/scm_unittest.py
index 3ada66a..9ca308c 100644
--- a/WebKitTools/Scripts/modules/scm_unittest.py
+++ b/WebKitTools/Scripts/modules/scm_unittest.py
@@ -27,6 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import base64
import os
import re
import stat
@@ -197,6 +198,27 @@ class SVNTest(SCMTest):
self.assertEqual(scm.display_name(), "svn")
self.assertEqual(scm.supports_local_commits(), False)
+ def test_apply_small_binary_patch(self):
+ patch_contents = """Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+"""
+ expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==")
+ self._setup_webkittools_scripts_symlink(self.scm)
+ patch_file = self._create_patch(patch_contents)
+ self.scm.apply_patch(patch_file)
+ actual_contents = read_from_path("test_file.swf")
+ self.assertEqual(actual_contents, expected_contents)
+
def test_apply_svn_patch(self):
scm = detect_scm_system(self.svn_checkout_path)
patch = self._create_patch(run(['svn', 'diff', '-r4:3']))
diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply
index 0e56616..17a6ab4 100755
--- a/WebKitTools/Scripts/svn-apply
+++ b/WebKitTools/Scripts/svn-apply
@@ -333,7 +333,10 @@ sub gitdiff2svndiff($)
sub handleBinaryChange($$)
{
my ($fullPath, $contents) = @_;
- if ($contents =~ m#((\n[A-Za-z0-9+/]{76})+\n[A-Za-z0-9+/=]{4,76}\n)#) {
+ # [A-Za-z0-9+/] is the class of allowed base64 characters.
+ # One or more lines, at most 76 characters in length.
+ # The last line is allowed to have up to two '=' characters at the end (to signify padding).
+ if ($contents =~ m#((\n[A-Za-z0-9+/]{76})*\n[A-Za-z0-9+/]{2,74}?[A-Za-z0-9+/=]{2}\n)#) {
# Addition or Modification
open FILE, ">", $fullPath or die;
print FILE decode_base64($1);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list