You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/01/21 12:31:59 UTC
svn commit: r1436285 - in /subversion/trunk/subversion:
libsvn_client/patch.c tests/cmdline/patch_tests.py
Author: rhuijben
Date: Mon Jan 21 11:31:58 2013
New Revision: 1436285
URL: http://svn.apache.org/viewvc?rev=1436285&view=rev
Log:
Resolve issue #4273, by fixing a filestat in the patch apply code, to stat the
symlink instead of the resolved target.
* trunk/subversion/tests/cmdline/patch_tests.py
(patch_change_symlink_target): Remove XFail marker.
* trunk/subversion/libsvn_client/patch.c
(init_prop_target,
get_hunk_info): Use apr_pcalloc to make sure new fields will be set to 0.
(apply_one_patch): Stat the symlink, not the target to find our result.
(apply_patches): Use apr_pcalloc to make sure new fields will be set to 0.
Modified:
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/tests/cmdline/patch_tests.py
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1436285&r1=1436284&r2=1436285&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Jan 21 11:31:58 2013
@@ -646,7 +646,7 @@ init_prop_target(prop_patch_target_t **p
content->hunks = apr_array_make(result_pool, 0, sizeof(hunk_info_t *));
content->keywords = apr_hash_make(result_pool);
- new_prop_target = apr_palloc(result_pool, sizeof(*new_prop_target));
+ new_prop_target = apr_pcalloc(result_pool, sizeof(*new_prop_target));
new_prop_target->name = apr_pstrdup(result_pool, prop_name);
new_prop_target->operation = operation;
new_prop_target->content = content;
@@ -669,7 +669,7 @@ init_prop_target(prop_patch_target_t **p
/* Wire up the read and write callbacks. */
- prop_read_baton = apr_palloc(result_pool, sizeof(*prop_read_baton));
+ prop_read_baton = apr_pcalloc(result_pool, sizeof(*prop_read_baton));
prop_read_baton->value = value;
prop_read_baton->offset = 0;
content->readline = readline_prop;
@@ -1642,7 +1642,7 @@ get_hunk_info(hunk_info_t **hi, patch_ta
matched_line = 0;
}
- (*hi) = apr_palloc(result_pool, sizeof(hunk_info_t));
+ (*hi) = apr_pcalloc(result_pool, sizeof(hunk_info_t));
(*hi)->hunk = hunk;
(*hi)->matched_line = matched_line;
(*hi)->rejected = (matched_line == 0);
@@ -2239,10 +2239,10 @@ apply_one_patch(patch_target_t **patch_t
* We'll need those to figure out whether we should delete the
* patched file. */
SVN_ERR(svn_io_stat(&patched_file, target->patched_path,
- APR_FINFO_SIZE, scratch_pool));
+ APR_FINFO_SIZE | APR_FINFO_LINK, scratch_pool));
if (target->kind_on_disk == svn_node_file)
SVN_ERR(svn_io_stat(&working_file, target->local_abspath,
- APR_FINFO_SIZE, scratch_pool));
+ APR_FINFO_SIZE | APR_FINFO_LINK, scratch_pool));
else
working_file.size = 0;
@@ -2889,7 +2889,7 @@ apply_patches(/* The path to the patch f
{
/* Save info we'll still need when we're done patching. */
patch_target_info_t *target_info =
- apr_palloc(scratch_pool, sizeof(patch_target_info_t));
+ apr_pcalloc(scratch_pool, sizeof(patch_target_info_t));
target_info->local_abspath = apr_pstrdup(scratch_pool,
target->local_abspath);
target_info->deleted = target->deleted;
Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1436285&r1=1436284&r2=1436285&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Mon Jan 21 11:31:58 2013
@@ -4207,7 +4207,6 @@ def patch_git_with_index_line(sbox):
1, # check-props
1) # dry-run
-@XFail(svntest.main.is_posix_os)
@Issue(4273)
def patch_change_symlink_target(sbox):
"patch changes symlink target"