You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/08/31 21:15:10 UTC

svn commit: r991297 - in /subversion/trunk/subversion: include/svn_diff.h libsvn_client/patch.c libsvn_diff/parse-diff.c

Author: stsp
Date: Tue Aug 31 19:15:09 2010
New Revision: 991297

URL: http://svn.apache.org/viewvc?rev=991297&view=rev
Log:
* subversion/libsvn_diff/parse-diff.c
  (svn_diff_close_patch): Also close hunks from property patches, if any.
   Requires a new SCRATCH_POOL argument to loop over the prop hash table.

* subversion/include/svn_diff.h
  (svn_diff_close_patch): Update declaration.

* subversion/libsvn_client/patch.c
  (apply_patches): Adjust caller.

Modified:
    subversion/trunk/subversion/include/svn_diff.h
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_diff/parse-diff.c

Modified: subversion/trunk/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_diff.h?rev=991297&r1=991296&r2=991297&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_diff.h (original)
+++ subversion/trunk/subversion/include/svn_diff.h Tue Aug 31 19:15:09 2010
@@ -1008,11 +1008,12 @@ svn_diff_parse_next_patch(svn_patch_t **
 
 /**
  * Dispose of @a patch, closing any streams used by it.
+ * Use @a scratch_pool for all temporary allocations.
  *
  * @since New in 1.7.
  */
 svn_error_t *
-svn_diff_close_patch(const svn_patch_t *patch);
+svn_diff_close_patch(const svn_patch_t *patch, apr_pool_t *scratch_pool);
 
 #ifdef __cplusplus
 }

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=991297&r1=991296&r2=991297&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Aug 31 19:15:09 2010
@@ -2649,7 +2649,7 @@ apply_patches(void *baton,
               SVN_ERR(send_patch_notification(target, btn->ctx, iterpool));
             }
 
-          SVN_ERR(svn_diff_close_patch(patch));
+          SVN_ERR(svn_diff_close_patch(patch, iterpool));
         }
     }
   while (patch);

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=991297&r1=991296&r2=991297&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Tue Aug 31 19:15:09 2010
@@ -1331,9 +1331,10 @@ svn_diff_parse_next_patch(svn_patch_t **
 }
 
 svn_error_t *
-svn_diff_close_patch(const svn_patch_t *patch)
+svn_diff_close_patch(const svn_patch_t *patch, apr_pool_t *scratch_pool)
 {
   int i;
+  apr_hash_index_t *hi;
 
   for (i = 0; i < patch->hunks->nelts; i++)
     {
@@ -1342,5 +1343,22 @@ svn_diff_close_patch(const svn_patch_t *
       SVN_ERR(close_hunk(hunk));
     }
 
+  for (hi = apr_hash_first(scratch_pool, patch->prop_patches);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+          svn_prop_patch_t *prop_patch; 
+
+          prop_patch = svn__apr_hash_index_val(hi);
+
+          for (i = 0; i < prop_patch->hunks->nelts; i++)
+            {
+              const svn_diff_hunk_t *hunk;
+              
+              hunk = APR_ARRAY_IDX(prop_patch->hunks, i, svn_diff_hunk_t *);
+              SVN_ERR(close_hunk(hunk));
+            }
+    } 
+
   return SVN_NO_ERROR;
 }