Skip to content
Permalink
Browse files
2009-11-18 Shinichiro Hamaji <hamaji@chromium.org>
        Reviewed by Eric Seidel.

        GitTest.test_create_binary_patch fails if /tmp is symlink
        https://bugs.webkit.org/show_bug.cgi?id=31536

        * Scripts/modules/scm_unittest.py:

Canonical link: https://commits.webkit.org/42602@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Shinichiro Hamaji committed Nov 19, 2009
1 parent d42f788 commit 958cfcd4d5eb6e02a0b49ce8e32cba0107149ecb
Showing with 14 additions and 4 deletions.
  1. +9 −0 WebKitTools/ChangeLog
  2. +5 −4 WebKitTools/Scripts/modules/scm_unittest.py
@@ -1,3 +1,12 @@
2009-11-18 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Eric Seidel.

GitTest.test_create_binary_patch fails if /tmp is symlink
https://bugs.webkit.org/show_bug.cgi?id=31536

* Scripts/modules/scm_unittest.py:

2009-11-18 Yaar Schnitman <yaar@chromium.org>

Reviewed by Darin Adler.
@@ -563,23 +563,24 @@ def test_svn_apply_git_patch(self):
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')
test_file_name = 'binary_file'
test_file_path = os.path.join(self.git_checkout_path, test_file_name)
file_contents = ''.join(map(chr, range(256)))
write_into_file_at_path(test_file_path, file_contents)
run(['git', 'add', test_file_path])
run(['git', 'add', test_file_name])
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])
run(['git', 'rm', '-f', test_file_name])
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', 'add', test_file_name])
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))

0 comments on commit 958cfcd

Please sign in to comment.