subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1149557 - /subversion/trunk/subversion/libsvn_subr/mergeinfo.c
Date Fri, 22 Jul 2011 10:38:02 GMT
Author: stsp
Date: Fri Jul 22 10:38:01 2011
New Revision: 1149557

URL: http://svn.apache.org/viewvc?rev=1149557&view=rev
Log:
Convert libsvn_subr/mergeinfo.c over to svn_rangelist_merge2().

* subversion/libsvn_subr/mergeinfo.c
  (parse_revision_line): Use svn_rangelist_merge2() instead of
    svn_rangelist_merge().
  (svn_mergeinfo_merge): Same, and pass an iterpool as the scratch_pool
   for svn_rangelist_merge2().

Modified:
    subversion/trunk/subversion/libsvn_subr/mergeinfo.c

Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1149557&r1=1149556&r2=1149557&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Fri Jul 22 10:38:01 2011
@@ -672,7 +672,7 @@ parse_revision_line(const char **input, 
      absolute path key. */
   existing_rangelist = apr_hash_get(hash, pathname->data, APR_HASH_KEY_STRING);
   if (existing_rangelist)
-    SVN_ERR(svn_rangelist_merge(&rangelist, existing_rangelist, pool));
+    SVN_ERR(svn_rangelist_merge2(rangelist, existing_rangelist, pool, pool));
 
   apr_hash_set(hash, pathname->data, APR_HASH_KEY_STRING, rangelist);
 
@@ -1300,6 +1300,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
 {
   apr_array_header_t *sorted1, *sorted2;
   int i, j;
+  apr_pool_t *iterpool;
 
   if (!apr_hash_count(changes))
     return SVN_NO_ERROR;
@@ -1309,11 +1310,14 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
 
   i = 0;
   j = 0;
+  iterpool = svn_pool_create(pool);
   while (i < sorted1->nelts && j < sorted2->nelts)
     {
       svn_sort__item_t elt1, elt2;
       int res;
 
+      svn_pool_clear(iterpool);
+
       elt1 = APR_ARRAY_IDX(sorted1, i, svn_sort__item_t);
       elt2 = APR_ARRAY_IDX(sorted2, j, svn_sort__item_t);
       res = svn_sort_compare_items_as_paths(&elt1, &elt2);
@@ -1325,8 +1329,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
           rl1 = elt1.value;
           rl2 = elt2.value;
 
-          SVN_ERR(svn_rangelist_merge(&rl1, rl2,
-                                      pool));
+          SVN_ERR(svn_rangelist_merge2(rl1, rl2, pool, iterpool));
           apr_hash_set(mergeinfo, elt1.key, elt1.klen, rl1);
           i++;
           j++;
@@ -1341,6 +1344,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
           j++;
         }
     }
+  svn_pool_destroy(iterpool);
 
   /* Copy back any remaining elements from the second hash. */
   for (; j < sorted2->nelts; j++)



Mime
View raw message