Changeset 48622 in webkit
- Timestamp:
- Sep 22, 2009 2:48:37 AM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r48614 r48622 1 2009-09-22 Eric Seidel <eric@webkit.org> 2 3 Reviewed by David Kilzer. 4 5 svn-apply can't handle single-line binary file additions 6 https://bugs.webkit.org/show_bug.cgi?id=29100 7 8 Fixed the regexp and added a unit test. 9 10 * Scripts/modules/scm_unittest.py: 11 * Scripts/svn-apply: 12 1 13 2009-09-11 Eric Seidel <eric@webkit.org> 2 14 -
trunk/WebKitTools/Scripts/modules/scm_unittest.py
r48320 r48622 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 import base64 30 31 import os 31 32 import re … … 198 199 self.assertEqual(scm.supports_local_commits(), False) 199 200 201 def test_apply_small_binary_patch(self): 202 patch_contents = """Index: test_file.swf 203 =================================================================== 204 Cannot display: file marked as a binary type. 205 svn:mime-type = application/octet-stream 206 207 Property changes on: test_file.swf 208 ___________________________________________________________________ 209 Name: svn:mime-type 210 + application/octet-stream 211 212 213 Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== 214 """ 215 expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==") 216 self._setup_webkittools_scripts_symlink(self.scm) 217 patch_file = self._create_patch(patch_contents) 218 self.scm.apply_patch(patch_file) 219 actual_contents = read_from_path("test_file.swf") 220 self.assertEqual(actual_contents, expected_contents) 221 200 222 def test_apply_svn_patch(self): 201 223 scm = detect_scm_system(self.svn_checkout_path) -
trunk/WebKitTools/Scripts/svn-apply
r48242 r48622 334 334 { 335 335 my ($fullPath, $contents) = @_; 336 if ($contents =~ m#((\n[A-Za-z0-9+/]{76})+\n[A-Za-z0-9+/=]{4,76}\n)#) { 336 # [A-Za-z0-9+/] is the class of allowed base64 characters. 337 # One or more lines, at most 76 characters in length. 338 # The last line is allowed to have up to two '=' characters at the end (to signify padding). 339 if ($contents =~ m#((\n[A-Za-z0-9+/]{76})*\n[A-Za-z0-9+/]{2,74}?[A-Za-z0-9+/=]{2}\n)#) { 337 340 # Addition or Modification 338 341 open FILE, ">", $fullPath or die;
Note: See TracChangeset
for help on using the changeset viewer.