[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
abarth at webkit.org
abarth at webkit.org
Thu Dec 3 13:37:07 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 72b8dcd8eea4bb749e593c80613fe597b6f7226b
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Nov 15 23:32:34 2009 +0000
2009-11-15 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Eric Seidel.
bugzilla-tool should post git binary diff
https://bugs.webkit.org/show_bug.cgi?id=31458
Add --binary option to Git.create_patch.
* Scripts/modules/scm.py:
* Scripts/modules/scm_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 96cfa02..143ffc4 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-15 Shinichiro Hamaji <hamaji at chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool should post git binary diff
+ https://bugs.webkit.org/show_bug.cgi?id=31458
+
+ Add --binary option to Git.create_patch.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
2009-11-15 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py
index 8a87aa7..a9bd0dd 100644
--- a/WebKitTools/Scripts/modules/scm.py
+++ b/WebKitTools/Scripts/modules/scm.py
@@ -452,7 +452,7 @@ class Git(SCM):
return "git"
def create_patch(self):
- return self.run_command(['git', 'diff', 'HEAD'])
+ return self.run_command(['git', 'diff', '--binary', 'HEAD'])
@classmethod
def git_commit_from_svn_revision(cls, revision):
@@ -495,10 +495,10 @@ class Git(SCM):
# Git-specific methods:
def create_patch_from_local_commit(self, commit_id):
- return self.run_command(['git', 'diff', commit_id + "^.." + commit_id])
+ return self.run_command(['git', 'diff', '--binary', commit_id + "^.." + commit_id])
def create_patch_since_local_commit(self, commit_id):
- return self.run_command(['git', 'diff', commit_id])
+ return self.run_command(['git', 'diff', '--binary', commit_id])
def commit_locally_with_message(self, message):
self.run_command(['git', 'commit', '--all', '-F', '-'], input=message)
diff --git a/WebKitTools/Scripts/modules/scm_unittest.py b/WebKitTools/Scripts/modules/scm_unittest.py
index 3f86ef5..0cac037 100644
--- a/WebKitTools/Scripts/modules/scm_unittest.py
+++ b/WebKitTools/Scripts/modules/scm_unittest.py
@@ -560,5 +560,35 @@ class GitTest(SCMTest):
def test_svn_apply_git_patch(self):
self._shared_test_svn_apply_git_patch()
+ def test_create_binary_patch(self):
+ # Create a git binary patch and check the contents.
+ scm = detect_scm_system(self.git_checkout_path)
+ test_file_path = os.path.join(self.git_checkout_path, 'binary_file')
+ file_contents = ''.join(map(chr, range(256)))
+ write_into_file_at_path(test_file_path, file_contents)
+ run(['git', 'add', test_file_path])
+ patch = scm.create_patch()
+ self.assertTrue(re.search(r'\nliteral 0\n', patch))
+ self.assertTrue(re.search(r'\nliteral 256\n', patch))
+
+ # Check if we can apply the created patch.
+ run(['git', 'rm', '-f', test_file_path])
+ self._setup_webkittools_scripts_symlink(scm)
+ self.scm.apply_patch(self._create_patch(patch))
+ self.assertEqual(file_contents, read_from_path(test_file_path))
+
+ # Check if we can create a patch from a local commit.
+ write_into_file_at_path(test_file_path, file_contents)
+ run(['git', 'add', test_file_path])
+ run(['git', 'commit', '-m', 'binary diff'])
+ patch_from_local_commit = scm.create_patch_from_local_commit('HEAD')
+ self.assertTrue(re.search(r'\nliteral 0\n', patch_from_local_commit))
+ self.assertTrue(re.search(r'\nliteral 256\n', patch_from_local_commit))
+ patch_since_local_commit = scm.create_patch_since_local_commit('HEAD^1')
+ self.assertTrue(re.search(r'\nliteral 0\n', patch_since_local_commit))
+ self.assertTrue(re.search(r'\nliteral 256\n', patch_since_local_commit))
+ self.assertEqual(patch_from_local_commit, patch_since_local_commit)
+
+
if __name__ == '__main__':
unittest.main()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list