subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1130380 - in /subversion/trunk/subversion/libsvn_ra_serf: commit.c property.c serf.c update.c
Date Thu, 02 Jun 2011 02:19:17 GMT
Author: gstein
Date: Thu Jun  2 02:19:17 2011
New Revision: 1130380

URL: http://svn.apache.org/viewvc?rev=1130380&view=rev
Log:
Clarify pool usage in svn_ra_serf__walk_all_props(). The passed param will
be interpreted as a scratch_pool. If the callback wants a pool with a
different lifetime, then it must be passed as part of the baton (for
example, see walker_baton_t in commit.c).

* subversion/libsvn_ra_serf/serf.c:
  (struct dirent_walker_baton_t): baton for direct_walker() to include a
    pool for any allocations that must reside in ENTRY.
  (dirent_walker): rename param to SCRATCH_POOL, and switch the baton to
    the new 'struct dirent_walker_baton_t'. grab the entry and pool from
    the baton.
  (path_dirent_walker): set up a dirent_walker_baton_t and pass that in
    the call to dirent_walker().
  (svn_ra_serf__stat): set up and pass a dirent_walker_baton_t through the
    walk_all_props() call.

* subversion/libsvn_ra_serf/update.c:
  (open_dir, handle_fetch, handle_propchange_only): create a SCRATCH_POOL
    localvar for clarity, and pass it to walk_all_props().

* subversion/libsvn_ra_serf/property.c:
  (svn_ra_serf__walk_all_props): rename param to SCRATCH_POOL and
    introduce an ITERPOOL into this function. pass the ITERPOOL to the
    callback for its pool argument (since longer-lived pools are now
    passed through the baton).
  (svn_ra_serf__flatten_props): pass SCRATCH_POOL into the walker
  (svn_ra_serf__set_bare_props): rename param for clarity

* subversion/libsvn_ra_serf/commit.c:
  (get_encoding_and_cdata): switch to a two-pool paradigm for clarity and
    so that we can toss the results from XML-escaping.
  (struct walker_baton_t): add BODY_POOL member to clarify that certain
    allocations need to live longer (the lifetime of the request).
  (derive_old_val): remove POOL argument. unused.
  (proppatch_walker): rename param to SCRATCH_POOL for clarity. this
    function will now use WB->BODY_POOL for certain strings that need to
    live longer. moved the PROP_NAME initializaton until after the
    filtering, and place these values into BODY_POOL. update the calls to
    get_encoding_and_cdata() for the two-pools.
  (struct proppatch_body_baton_t): quick new baton to bring a BODY_POOL
    into the create_proppatch_body() callback.
  (create_proppatch_body): switch the bucket from a simple
    proppatch_context_t to the larger proppatch_body_baton_t. pass the
    BODY_POOL down into the proppatch_walker walks.
  (proppatch_resource): switch the baton to the body delegate (ie. the
    create_proppatch_body callback).

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/commit.c
    subversion/trunk/subversion/libsvn_ra_serf/property.c
    subversion/trunk/subversion/libsvn_ra_serf/serf.c
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1130380&r1=1130379&r2=1130380&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Thu Jun  2 02:19:17 2011
@@ -625,7 +625,8 @@ get_encoding_and_cdata(const char **enco
                        const svn_string_t **encoded_value_p,
                        serf_bucket_alloc_t *alloc,
                        const svn_string_t *value,
-                       apr_pool_t *pool)
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
 {
   if (value == NULL)
     {
@@ -639,14 +640,14 @@ get_encoding_and_cdata(const char **enco
   if (svn_xml_is_xml_safe(value->data, value->len))
     {
       svn_stringbuf_t *xml_esc = NULL;
-      svn_xml_escape_cdata_string(&xml_esc, value, pool);
+      svn_xml_escape_cdata_string(&xml_esc, value, scratch_pool);
       *encoding_p = NULL;
-      *encoded_value_p = svn_string_create_from_buf(xml_esc, pool);
+      *encoded_value_p = svn_string_create_from_buf(xml_esc, result_pool);
     }
   else
     {
       *encoding_p = "base64";
-      *encoded_value_p = svn_base64_encode_string2(value, TRUE, pool);
+      *encoded_value_p = svn_base64_encode_string2(value, TRUE, result_pool);
     }
 
   return SVN_NO_ERROR;
@@ -654,8 +655,11 @@ get_encoding_and_cdata(const char **enco
 
 typedef struct walker_baton_t {
   serf_bucket_t *body_bkt;
+  apr_pool_t *body_pool;
+
   apr_hash_t *previous_changed_props;
   apr_hash_t *previous_removed_props;
+
   const char *path;
 
   /* Hack, since change_rev_prop(old_value_p != NULL, value = NULL) uses D:set
@@ -672,16 +676,13 @@ typedef struct walker_baton_t {
 
 /* If we have (recorded in WB) the old value of the property named NS:NAME,
  * then set *HAVE_OLD_VAL to TRUE and set *OLD_VAL_P to that old value
- * (which may be NULL); else set *HAVE_OLD_VAL to FALSE.
- *
- * The string pointed to by *OLD_VAL_P is not copied into POOL. */
+ * (which may be NULL); else set *HAVE_OLD_VAL to FALSE.  */
 static svn_error_t *
 derive_old_val(svn_boolean_t *have_old_val,
                const svn_string_t **old_val_p,
                walker_baton_t *wb,
                const char *ns,
-               const char *name,
-               apr_pool_t *pool)
+               const char *name)
 {
   *have_old_val = FALSE;
 
@@ -717,7 +718,7 @@ proppatch_walker(void *baton,
                  const char *ns,
                  const char *name,
                  const svn_string_t *val,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
   walker_baton_t *wb = baton;
   serf_bucket_t *body_bkt = wb->body_bkt;
@@ -727,16 +728,9 @@ proppatch_walker(void *baton,
   svn_boolean_t have_old_val;
   const svn_string_t *old_val;
   const svn_string_t *encoded_value;
-  char *prop_name;
-
-  /* Use the namespace prefix instead of adding the xmlns attribute to support
-     property names containing ':' */
-  if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
-    prop_name = apr_pstrcat(pool, "S:", name, (char *)NULL);
-  else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
-    prop_name = apr_pstrcat(pool, "C:", name, (char *)NULL);
+  const char *prop_name;
 
-  SVN_ERR(derive_old_val(&have_old_val, &old_val, wb, ns, name, pool));
+  SVN_ERR(derive_old_val(&have_old_val, &old_val, wb, ns, name));
 
   /* Jump through hoops to work with D:remove and its val = (""-for-NULL)
    * representation. */
@@ -752,7 +746,8 @@ proppatch_walker(void *baton,
 
   alloc = body_bkt->allocator;
 
-  SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, val, pool));
+  SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, val,
+                                 wb->body_pool, scratch_pool));
   if (encoded_value)
     {
       cdata_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(encoded_value->data,
@@ -764,6 +759,13 @@ proppatch_walker(void *baton,
       cdata_bkt = NULL;
     }
 
+  /* Use the namespace prefix instead of adding the xmlns attribute to support
+     property names containing ':' */
+  if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
+    prop_name = apr_pstrcat(wb->body_pool, "S:", name, (char *)NULL);
+  else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
+    prop_name = apr_pstrcat(wb->body_pool, "C:", name, (char *)NULL);
+
   if (cdata_bkt)
     svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, prop_name,
                                       "V:encoding", encoding,
@@ -780,7 +782,8 @@ proppatch_walker(void *baton,
       serf_bucket_t *cdata_bkt2;
 
       SVN_ERR(get_encoding_and_cdata(&encoding2, &encoded_value2,
-                                     alloc, old_val, pool));
+                                     alloc, old_val,
+                                     wb->body_pool, scratch_pool));
 
       if (encoded_value2)
         {
@@ -851,14 +854,23 @@ setup_proppatch_headers(serf_bucket_t *h
   return SVN_NO_ERROR;
 }
 
+
+struct proppatch_body_baton_t {
+  proppatch_context_t *proppatch;
+
+  /* Content in the body should be allocated here, to live long enough.  */
+  apr_pool_t *body_pool;
+};
+
 /* Implements svn_ra_serf__request_body_delegate_t */
 static svn_error_t *
 create_proppatch_body(serf_bucket_t **bkt,
                       void *baton,
                       serf_bucket_alloc_t *alloc,
-                      apr_pool_t *pool)
+                      apr_pool_t *scratch_pool)
 {
-  proppatch_context_t *ctx = baton;
+  struct proppatch_body_baton_t *pbb = baton;
+  proppatch_context_t *ctx = pbb->proppatch;
   serf_bucket_t *body_bkt;
   walker_baton_t wb = { 0 };
 
@@ -873,6 +885,7 @@ create_proppatch_body(serf_bucket_t **bk
                                     NULL);
 
   wb.body_bkt = body_bkt;
+  wb.body_pool = pbb->body_pool;
   wb.previous_changed_props = ctx->previous_changed_props;
   wb.previous_removed_props = ctx->previous_removed_props;
   wb.path = ctx->path;
@@ -886,7 +899,8 @@ create_proppatch_body(serf_bucket_t **bk
       wb.deleting = FALSE;
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
                                           SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb, pool));
+                                          proppatch_walker, &wb,
+                                          scratch_pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
@@ -901,7 +915,8 @@ create_proppatch_body(serf_bucket_t **bk
       wb.deleting = TRUE;
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
                                           SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb, pool));
+                                          proppatch_walker, &wb,
+                                          scratch_pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
@@ -916,7 +931,8 @@ create_proppatch_body(serf_bucket_t **bk
       wb.deleting = TRUE;
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
                                           SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb, pool));
+                                          proppatch_walker, &wb,
+                                          scratch_pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:remove");
@@ -934,6 +950,7 @@ proppatch_resource(proppatch_context_t *
                    apr_pool_t *pool)
 {
   svn_ra_serf__handler_t *handler;
+  struct proppatch_body_baton_t pbb;
 
   handler = apr_pcalloc(pool, sizeof(*handler));
   handler->method = "PROPPATCH";
@@ -944,8 +961,10 @@ proppatch_resource(proppatch_context_t *
   handler->header_delegate = setup_proppatch_headers;
   handler->header_delegate_baton = proppatch;
 
+  pbb.proppatch = proppatch;
+  pbb.body_pool = pool;
   handler->body_delegate = create_proppatch_body;
-  handler->body_delegate_baton = proppatch;
+  handler->body_delegate_baton = &pbb;
 
   handler->response_handler = svn_ra_serf__handle_multistatus_only;
   handler->response_baton = &proppatch->progress;

Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=1130380&r1=1130379&r2=1130380&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Thu Jun  2 02:19:17 2011
@@ -657,55 +657,66 @@ svn_ra_serf__retrieve_props(apr_hash_t *
   return SVN_NO_ERROR;
 }
 
+
 svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
                             const char *name,
                             svn_revnum_t rev,
                             svn_ra_serf__walker_visitor_t walker,
                             void *baton,
-                            apr_pool_t *pool)
+                            apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *ns_hi;
-  apr_hash_t *ver_props, *path_props;
+  apr_hash_t *ver_props;
+  apr_hash_t *path_props;
+  apr_pool_t *iterpool;
 
   ver_props = apr_hash_get(props, &rev, sizeof(rev));
-
   if (!ver_props)
     {
       return SVN_NO_ERROR;
     }
 
-  path_props = apr_hash_get(ver_props, name, strlen(name));
-
+  path_props = apr_hash_get(ver_props, name, APR_HASH_KEY_STRING);
   if (!path_props)
     {
       return SVN_NO_ERROR;
     }
 
-  for (ns_hi = apr_hash_first(pool, path_props); ns_hi;
+  iterpool = svn_pool_create(scratch_pool);
+  for (ns_hi = apr_hash_first(scratch_pool, path_props); ns_hi;
        ns_hi = apr_hash_next(ns_hi))
     {
       void *ns_val;
       const void *ns_name;
       apr_hash_index_t *name_hi;
 
+      /* NOTE: We do not clear ITERPOOL in this loop. Generally, there are
+           very few namespaces, so this loop will not have many iterations.
+           Instead, ITERPOOL is used for the inner loop.  */
+
       apr_hash_this(ns_hi, &ns_name, NULL, &ns_val);
 
-      for (name_hi = apr_hash_first(pool, ns_val); name_hi;
+      for (name_hi = apr_hash_first(scratch_pool, ns_val); name_hi;
            name_hi = apr_hash_next(name_hi))
         {
           void *prop_val;
           const void *prop_name;
 
+          /* See note above, regarding clearing of this pool.  */
+          svn_pool_clear(iterpool);
+
           apr_hash_this(name_hi, &prop_name, NULL, &prop_val);
-          /* use a subpool? */
-          SVN_ERR(walker(baton, ns_name, prop_name, prop_val, pool));
+
+          SVN_ERR(walker(baton, ns_name, prop_name, prop_val, iterpool));
         }
     }
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }
 
+
 svn_error_t *
 svn_ra_serf__walk_all_paths(apr_hash_t *props,
                             svn_revnum_t rev,
@@ -839,7 +850,7 @@ svn_ra_serf__flatten_props(apr_hash_t **
                             props, path, revision,
                             set_flat_props,
                             *flat_props /* baton */,
-                            result_pool));
+                            scratch_pool));
 }
 
 
@@ -848,7 +859,7 @@ svn_ra_serf__set_bare_props(void *baton,
                             const char *ns,
                             const char *name,
                             const svn_string_t *val,
-                            apr_pool_t *pool)
+                            apr_pool_t *scratch_pool)
 {
   apr_hash_t *props = baton;
   apr_pool_t *result_pool = apr_hash_pool_get(props);

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1130380&r1=1130379&r2=1130380&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Thu Jun  2 02:19:17 2011
@@ -662,22 +662,31 @@ svn_ra_serf__check_path(svn_ra_session_t
   return SVN_NO_ERROR;
 }
 
+
+struct dirent_walker_baton_t {
+  /* Update the fields in this entry.  */
+  svn_dirent_t *entry;
+
+  /* If allocations are necessary, then use this pool.  */
+  apr_pool_t *result_pool;
+};
+
 static svn_error_t *
 dirent_walker(void *baton,
               const char *ns,
               const char *name,
               const svn_string_t *val,
-              apr_pool_t *pool)
+              apr_pool_t *scratch_pool)
 {
-  svn_dirent_t *entry = baton;
+  struct dirent_walker_baton_t *dwb = baton;
 
   if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
     {
-      entry->has_props = TRUE;
+      dwb->entry->has_props = TRUE;
     }
   else if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
     {
-      entry->has_props = TRUE;
+      dwb->entry->has_props = TRUE;
     }
   else if (strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0)
     {
@@ -685,40 +694,42 @@ dirent_walker(void *baton,
         {
           apr_int64_t deadprop_count;
           SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data));
-          entry->has_props = deadprop_count > 0;
+          dwb->entry->has_props = deadprop_count > 0;
         }
     }
   else if (strcmp(ns, "DAV:") == 0)
     {
       if (strcmp(name, SVN_DAV__VERSION_NAME) == 0)
         {
-          entry->created_rev = SVN_STR_TO_REV(val->data);
+          dwb->entry->created_rev = SVN_STR_TO_REV(val->data);
         }
       else if (strcmp(name, "creator-displayname") == 0)
         {
-          entry->last_author = val->data;
+          dwb->entry->last_author = val->data;
         }
       else if (strcmp(name, SVN_DAV__CREATIONDATE) == 0)
         {
-          SVN_ERR(svn_time_from_cstring(&entry->time, val->data, pool));
+          SVN_ERR(svn_time_from_cstring(&dwb->entry->time,
+                                        val->data,
+                                        dwb->result_pool));
         }
       else if (strcmp(name, "getcontentlength") == 0)
         {
           /* 'getcontentlength' property is empty for directories. */
           if (val->len)
             {
-              SVN_ERR(svn_cstring_atoi64(&entry->size, val->data));
+              SVN_ERR(svn_cstring_atoi64(&dwb->entry->size, val->data));
             }
         }
       else if (strcmp(name, "resourcetype") == 0)
         {
           if (strcmp(val->data, "collection") == 0)
             {
-              entry->kind = svn_node_dir;
+              dwb->entry->kind = svn_node_dir;
             }
           else
             {
-              entry->kind = svn_node_file;
+              dwb->entry->kind = svn_node_file;
             }
         }
     }
@@ -741,6 +752,7 @@ path_dirent_walker(void *baton,
                    apr_pool_t *pool)
 {
   struct path_dirent_visitor_t *dirents = baton;
+  struct dirent_walker_baton_t dwb;
   svn_dirent_t *entry;
 
   /* Skip our original path. */
@@ -765,7 +777,9 @@ path_dirent_walker(void *baton,
       apr_hash_set(dirents->base_paths, base_name, APR_HASH_KEY_STRING, entry);
     }
 
-  return dirent_walker(entry, ns, name, val, pool);
+  dwb.entry = entry;
+  dwb.result_pool = pool;  /* ### fix this!  */
+  return svn_error_return(dirent_walker(&dwb, ns, name, val, pool));
 }
 
 static const svn_ra_serf__dav_props_t *
@@ -836,8 +850,8 @@ svn_ra_serf__stat(svn_ra_session_t *ra_s
   svn_ra_serf__propfind_context_t *prop_ctx;
   const char *path;
   svn_revnum_t fetched_rev;
-  svn_dirent_t *entry;
   svn_error_t *err;
+  struct dirent_walker_baton_t dwb;
 
   err = fetch_path_props(&prop_ctx, &props, &path, &fetched_rev,
                          session, rel_path, revision,
@@ -854,12 +868,13 @@ svn_ra_serf__stat(svn_ra_session_t *ra_s
         return svn_error_return(err);
     }
 
-  entry = apr_pcalloc(pool, sizeof(*entry));
-
-  SVN_ERR(svn_ra_serf__walk_all_props(props, path, fetched_rev, dirent_walker,
-                                      entry, pool));
+  dwb.entry = apr_pcalloc(pool, sizeof(*dwb.entry));
+  dwb.result_pool = pool;  /* ### fix this  */
+  SVN_ERR(svn_ra_serf__walk_all_props(props, path, fetched_rev,
+                                      dirent_walker, &dwb,
+                                      pool));
 
-  *dirent = entry;
+  *dirent = dwb.entry;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1130380&r1=1130379&r2=1130380&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Thu Jun  2 02:19:17 2011
@@ -586,29 +586,32 @@ open_dir(report_dir_t *dir)
 static svn_error_t *
 close_dir(report_dir_t *dir)
 {
-  report_dir_t *prev, *sibling;
+  report_dir_t *prev;
+  report_dir_t *sibling;
+
+  /* ### is there a better pool... this is tossed at end-of-func  */
+  apr_pool_t *scratch_pool = dir->dir_baton_pool;
 
   SVN_ERR_ASSERT(! dir->ref_count);
 
   SVN_ERR(svn_ra_serf__walk_all_props(dir->props, dir->base_name,
                                       dir->base_rev,
                                       set_dir_props, dir,
-                                      dir->dir_baton_pool));
+                                      scratch_pool));
 
   SVN_ERR(svn_ra_serf__walk_all_props(dir->removed_props, dir->base_name,
                                       dir->base_rev, remove_dir_props, dir,
-                                      dir->dir_baton_pool));
+                                      scratch_pool));
 
   if (dir->fetch_props)
     {
       SVN_ERR(svn_ra_serf__walk_all_props(dir->props, dir->url,
                                           dir->target_rev,
                                           set_dir_props, dir,
-                                          dir->dir_baton_pool));
+                                          scratch_pool));
     }
 
-  SVN_ERR(dir->update_editor->close_directory(dir->dir_baton,
-                                              dir->dir_baton_pool));
+  SVN_ERR(dir->update_editor->close_directory(dir->dir_baton, scratch_pool));
 
   /* remove us from our parent's children list */
   if (dir->parent_dir)
@@ -961,6 +964,10 @@ handle_fetch(serf_request_t *request,
         {
           report_info_t *info = fetch_ctx->info;
 
+          /* ### this doesn't feel quite right. but it gets tossed at the
+             ### end of this block, so it will work for now.  */
+          apr_pool_t *scratch_pool = info->editor_pool;
+
           err = info->textdelta(NULL, info->textdelta_baton);
           if (err)
             {
@@ -974,28 +981,28 @@ handle_fetch(serf_request_t *request,
           err = svn_ra_serf__walk_all_props(info->props,
                                             info->base_name,
                                             info->base_rev,
-                                            set_file_props,
-                                            info, info->editor_pool);
+                                            set_file_props, info,
+                                            scratch_pool);
 
           if (!err)
             err = svn_ra_serf__walk_all_props(info->dir->removed_props,
                                               info->base_name,
                                               info->base_rev,
-                                              remove_file_props,
-                                              info, info->editor_pool);
+                                              remove_file_props, info,
+                                              scratch_pool);
           if (!err && info->fetch_props)
             {
               err = svn_ra_serf__walk_all_props(info->props,
                                                 info->url,
                                                 info->target_rev,
-                                                set_file_props,
-                                                info, info->editor_pool);
+                                                set_file_props, info,
+                                                scratch_pool);
             }
 
           if (!err)
             err = info->dir->update_editor->close_file(info->file_baton,
                                                        info->final_checksum,
-                                                       info->editor_pool);
+                                                       scratch_pool);
 
           if (err)
             {
@@ -1125,6 +1132,8 @@ handle_stream(serf_request_t *request,
 static svn_error_t *
 handle_propchange_only(report_info_t *info)
 {
+  apr_pool_t *scratch_pool;
+
   /* Ensure our parent is open. */
   SVN_ERR(open_dir(info->dir));
 
@@ -1169,25 +1178,29 @@ handle_propchange_only(report_info_t *in
   if (info->lock_token)
     check_lock(info);
 
+  /* ### not sure this is right, but it gets tossed in a bit. workable.  */
+  scratch_pool = info->editor_pool;
+
   /* set all of the properties we received */
   SVN_ERR(svn_ra_serf__walk_all_props(info->props,
                                       info->base_name, info->base_rev,
                                       set_file_props, info,
-                                      info->editor_pool));
+                                      scratch_pool));
   SVN_ERR(svn_ra_serf__walk_all_props(info->dir->removed_props,
                                       info->base_name, info->base_rev,
                                       remove_file_props, info,
-                                      info->editor_pool));
+                                      scratch_pool));
   if (info->fetch_props)
     {
       SVN_ERR(svn_ra_serf__walk_all_props(info->props, info->url,
-                                          info->target_rev, set_file_props,
-                                          info, info->editor_pool));
+                                          info->target_rev,
+                                          set_file_props, info,
+                                          scratch_pool));
     }
 
   SVN_ERR(info->dir->update_editor->close_file(info->file_baton,
                                                info->final_checksum,
-                                               info->editor_pool));
+                                               scratch_pool));
 
   /* We're done with our pools. */
   svn_pool_destroy(info->editor_pool);



Mime
View raw message