Author: philip
Date: Mon Jan 16 11:42:19 2012
New Revision: 1231945

URL: http://svn.apache.org/viewvc?rev=1231945&view=rev
Log:
Fix a patch problem where the patch file causes multiple levels of
directories to be added and also deletes a file.

* subversion/libsvn_client/patch.c
  (delete_empty_dirs): Only check deleted targets.

* subversion/tests/cmdline/patch_tests.py
  (patch_add_and_delete): Remove XFAIL.

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=1231945&r1=1231944&r2=1231945&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Jan 16 11:42:19 2012
@@ -2718,7 +2718,7 @@ delete_empty_dirs(apr_array_header_t *ta
   empty_dirs = apr_hash_make(scratch_pool);
   non_empty_dirs = apr_hash_make(scratch_pool);
   iterpool = svn_pool_create(scratch_pool);
-  for (i = 0; i < targets_info->nelts; i++)
+  for (i = 0; i < deleted_targets->nelts; i++)
     {
       svn_boolean_t parent_empty;
       patch_target_info_t *target_info;
@@ -2729,7 +2729,7 @@ delete_empty_dirs(apr_array_header_t *ta
       if (ctx->cancel_func)
         SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
-      target_info = APR_ARRAY_IDX(targets_info, i, patch_target_info_t *);
+      target_info = APR_ARRAY_IDX(deleted_targets, i, patch_target_info_t *);
 
       parent = svn_dirent_dirname(target_info->local_abspath, iterpool);
 

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1231945&r1=1231944&r2=1231945&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Mon Jan 16 
11:42:19 2012
@@ -4045,7 +4045,6 @@ def patch_target_no_eol_at_eof(sbox):
                                        1, # check-props
                                        1) # dry-run
 
-@XFail()
 def patch_add_and_delete(sbox):
   "patch add multiple levels and delete"
 


Reply via email to