subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1657451 - in /subversion/branches/reuse-ra-session: ./ subversion/libsvn_client/
Date Thu, 05 Feb 2015 00:44:58 GMT
Author: brane
Date: Thu Feb  5 00:44:57 2015
New Revision: 1657451

URL: http://svn.apache.org/r1657451
Log:
On the reuse-ra-session branch: Add explicit session reuse in libsvn_client.

* BRANCH-README: Update status.

* subversion/libsvn_client/add.c (mkdir_urls),
  subversion/libsvn_client/blame.c (svn_client_blame5),
  subversion/libsvn_client/cat.c (svn_client_cat3),
  subversion/libsvn_client/checkout.c (svn_client__checkout_internal),
  subversion/libsvn_client/commit.c (svn_client_commit6),
  subversion/libsvn_client/copy.c (repos_to_repos_copy,
                                   wc_to_repos_copy,
                                   repos_to_wc_copy),
  subversion/libsvn_client/copy_foreign.c (svn_client__copy_foreign),
  subversion/libsvn_client/diff.c (diff_repos_repos, diff_repos_wc),
  subversion/libsvn_client/export.c (handle_external_item_change),
  subversion/libsvn_client/import.c (svn_client_import5),
  subversion/libsvn_client/info.c (svn_client_info4),
  subversion/libsvn_client/iprops.c (get_inheritable_props),
  subversion/libsvn_client/list.c (list_internal),
  subversion/libsvn_client/locking_commands.c (svn_client_lock,
                                               svn_client_unlock),
  subversion/libsvn_client/log.c (svn_client__get_copy_source),
  subversion/libsvn_client/merge.c (merge_locked,
                                    merge_reintegrate_locked,
                                    merge_peg_locked,
                                    find_automatic_merge_no_wc,
                                    client_find_automatic_merge),
  subversion/libsvn_client/mergeinfo.c (get_mergeinfo,
                                        logs_for_mergeinfo_rangelist,
                                        svn_client__mergeinfo_log,
                                        svn_client_suggest_merge_sources),
  subversion/libsvn_client/prop_commands.c (propset_on_url,
                                            svn_client_revprop_set2,
                                            svn_client_propget5,
                                            svn_client_revprop_get,
                                            get_remote_props,
                                            svn_client_revprop_list),
  subversion/libsvn_client/ra.c (svn_client__repos_locations),
  subversion/libsvn_client/status.c (svn_client_status6),
  subversion/libsvn_client/switch.c (switch_internal),
  subversion/libsvn_client/update.c (svn_client__update_internal),
  subversion/libsvn_client/util.c (svn_client_get_repos_root):
   Release locally created sessions if there were no errors.


* subversion/libsvn_client/mergeinfo.c (svn_client__get_wc_or_repos_mergeinfo_catalog),
  subversion/libsvn_client/ra.c (svn_client__get_youngest_common_ancestor),
  subversion/libsvn_client/status.c (reporter_finish_report):
   Remove the session management pool. Instead, release locally
   created sessions if there were no errors.

* subversion/libsvn_client/commit.c (check_url_kind),
  subversion/libsvn_client/delete.c (delete_urls_multi_repos),
  subversion/libsvn_client/log.c (pre_15_receiver),
  subversion/libsvn_client/merge.c (ensure_ra_session_url):
   Add commend about adding explicit session reuse.

Modified:
    subversion/branches/reuse-ra-session/BRANCH-README
    subversion/branches/reuse-ra-session/subversion/libsvn_client/add.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/blame.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/cat.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/checkout.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/copy.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/copy_foreign.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/delete.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/diff.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/export.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/externals.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/import.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/info.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/iprops.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/list.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/locking_commands.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/merge.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/mergeinfo.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/prop_commands.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/ra.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/status.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/switch.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/update.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/util.c

Modified: subversion/branches/reuse-ra-session/BRANCH-README
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/BRANCH-README?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/BRANCH-README (original)
+++ subversion/branches/reuse-ra-session/BRANCH-README Thu Feb  5 00:44:57 2015
@@ -9,19 +9,21 @@ all changes made in the branch.
 STATUS
 ======
 
-done:
+DONE:
 - Initial implementation.
 - Separate active and inactive session lists.
 - Introduce explicit session reuse and closing.
-
-todo:
 - Add explicit session reuse throughout libsvn_client.
+
+TODO:
+- Add explicit session reuse in the MTCC implementation.
 - Add new RA method (svn_ra__ping?) to verify that a session
   about to be reused is valid.
 - Limit the number of idle open sessions in the cache.
 - Run performance comparisons between trunk and branch to prove that
   the RA session cache does in fact speed things up.
 - Implement svn_client_close_all_sessions().
+- Find and resolve all 'RA_CACHE TODO' comments.
 
 PROBLEM
 =======

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/add.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/add.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/add.c Thu Feb  5 00:44:57 2015
@@ -1251,7 +1251,9 @@ mkdir_urls(const apr_array_header_t *url
     }
 
   /* Close the edit. */
-  return svn_error_trace(editor->close_edit(edit_baton, pool));
+  SVN_ERR(editor->close_edit(edit_baton, pool));
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+  return SVN_NO_ERROR;
 }
 
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/blame.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/blame.c Thu Feb  5 00:44:57 2015
@@ -901,5 +901,6 @@ svn_client_blame5(const char *target,
     }
   svn_pool_destroy(iterpool);
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/cat.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/cat.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/cat.c Thu Feb  5 00:44:57 2015
@@ -333,5 +333,6 @@ svn_client_cat3(apr_hash_t **returned_pr
     /* Close the interjected stream */
     SVN_ERR(svn_stream_close(output));
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/checkout.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/checkout.c Thu Feb  5 00:44:57 2015
@@ -81,6 +81,7 @@ svn_client__checkout_internal(svn_revnum
 {
   svn_node_kind_t kind;
   svn_client__pathrev_t *pathrev;
+  svn_boolean_t new_ra_session = FALSE;
 
   /* Sanity check.  Without these, the checkout is meaningless. */
   SVN_ERR_ASSERT(local_abspath != NULL);
@@ -122,6 +123,7 @@ svn_client__checkout_internal(svn_revnum
       SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
                                                 url, NULL, peg_revision,
                                                 revision, ctx, scratch_pool));
+      new_ra_session = TRUE;
     }
 
   SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind, scratch_pool));
@@ -192,6 +194,8 @@ svn_client__checkout_internal(svn_revnum
                                       FALSE, FALSE, ra_session,
                                       ctx, scratch_pool));
 
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c Thu Feb  5 00:44:57 2015
@@ -403,6 +403,7 @@ check_url_kind(void *baton,
   /* If we don't have a session or can't use the session, get one */
   if (!cukb->session || !svn_uri__is_ancestor(cukb->repos_root_url, url))
     {
+      /* RA_CACHE TODO: release RA session */
       SVN_ERR(svn_client_open_ra_session2(&cukb->session, url, NULL, cukb->ctx,
                                           cukb->pool, scratch_pool));
       SVN_ERR(svn_ra_get_repos_root2(cukb->session, &cukb->repos_root_url,
@@ -516,7 +517,7 @@ svn_client_commit6(const apr_array_heade
   const svn_delta_editor_t *editor;
   void *edit_baton;
   struct capture_baton_t cb;
-  svn_ra_session_t *ra_session;
+  svn_ra_session_t *ra_session = NULL;
   const char *log_msg;
   const char *base_abspath;
   const char *base_url;
@@ -993,6 +994,13 @@ svn_client_commit6(const apr_array_heade
 
   svn_pool_destroy(iterpool);
 
-  return svn_error_trace(reconcile_errors(cmt_err, unlock_err, bump_err,
-                                          pool));
+  {
+    svn_error_t *const final_err =
+      svn_error_trace(reconcile_errors(cmt_err, unlock_err, bump_err, pool));
+
+    if (!final_err && ra_session)
+      SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
+    return final_err;
+  }
 }

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/copy.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/copy.c Thu Feb  5 00:44:57 2015
@@ -1128,7 +1128,10 @@ repos_to_repos_copy(const apr_array_head
       SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
                                       ctx, pool));
       if (! message)
-        return SVN_NO_ERROR;
+        {
+          SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+          return SVN_NO_ERROR;
+        }
     }
   else
     message = "";
@@ -1202,7 +1205,9 @@ repos_to_repos_copy(const apr_array_head
     }
 
   /* Close the edit. */
-  return svn_error_trace(editor->close_edit(edit_baton, pool));
+  SVN_ERR(editor->close_edit(edit_baton, pool));
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+  return SVN_NO_ERROR;
 }
 
 /* Baton for check_url_kind */
@@ -1458,6 +1463,7 @@ wc_to_repos_copy(const apr_array_header_
                                       ctx, scratch_pool));
       if (! message)
         {
+          SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
           svn_pool_destroy(iterpool);
           svn_pool_destroy(session_pool);
           return SVN_NO_ERROR;
@@ -1523,6 +1529,7 @@ wc_to_repos_copy(const apr_array_header_
                                   NULL, ctx, session_pool, session_pool),
             _("Commit failed (details follow):"));
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(iterpool);
   svn_pool_destroy(session_pool);
 
@@ -1921,6 +1928,8 @@ repos_to_wc_copy(svn_boolean_t *timestam
                             copy_pairs, top_dst_path, ignore_externals,
                             ra_session, ctx, pool),
     ctx->wc_ctx, lock_abspath, FALSE, pool);
+
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/copy_foreign.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/copy_foreign.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/copy_foreign.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/copy_foreign.c Thu Feb  5 00:44:57 2015
@@ -571,5 +571,6 @@ svn_client__copy_foreign(const char *url
                                  scratch_pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/delete.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/delete.c Thu Feb  5 00:44:57 2015
@@ -331,6 +331,7 @@ delete_urls_multi_repos(const apr_array_
 
           /* Open an RA session to (ultimately) the root of the
              repository in which URI is found.  */
+          /* RA_CACHE TODO: release RA session */
           SVN_ERR(svn_client_open_ra_session2(&ra_session, uri, NULL,
                                               ctx, pool, pool));
           SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root, pool));

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/diff.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/diff.c Thu Feb  5 00:44:57 2015
@@ -1845,8 +1845,9 @@ diff_repos_repos(const char **root_relpa
                              FALSE, NULL,
                              scratch_pool));
 
-  return svn_error_trace(
-                  reporter->finish_report(reporter_baton, scratch_pool));
+  SVN_ERR(reporter->finish_report(reporter_baton, scratch_pool));
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+  return SVN_NO_ERROR;
 }
 
 /* Perform a diff between a repository path and a working-copy path.
@@ -2132,6 +2133,7 @@ diff_repos_wc(const char **root_relpath,
                                       scratch_pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/export.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/export.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/export.c Thu Feb  5 00:44:57 2015
@@ -1448,6 +1448,8 @@ svn_client_export5(svn_revnum_t *result_
                                    from_path_or_url);
         }
       /* kind == svn_node_unknown not handled */
+
+      SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
     }
   else
     {

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/externals.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/externals.c Thu Feb  5 00:44:57 2015
@@ -708,6 +708,7 @@ handle_external_item_change(svn_client_c
   svn_client__pathrev_t *new_loc;
   const char *new_url;
   svn_node_kind_t ext_kind;
+  svn_boolean_t new_ra_session = FALSE;
 
   SVN_ERR_ASSERT(repos_root_url && parent_dir_url);
   SVN_ERR_ASSERT(new_item != NULL);
@@ -753,11 +754,14 @@ handle_external_item_change(svn_client_c
     }
 
   if (!ra_session)
-    SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
-                                              new_url, NULL,
-                                              &(new_item->peg_revision),
-                                              &(new_item->revision), ctx,
-                                              scratch_pool));
+    {
+      SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
+                                                new_url, NULL,
+                                                &(new_item->peg_revision),
+                                                &(new_item->revision), ctx,
+                                                scratch_pool));
+      new_ra_session = TRUE;
+    }
 
   SVN_ERR(svn_ra_check_path(ra_session, "", new_loc->rev, &ext_kind,
                             scratch_pool));
@@ -855,12 +859,15 @@ handle_external_item_change(svn_client_c
             new_url = svn_path_url_add_component2(local_repos_root_url,
                                                   ext_repos_relpath,
                                                   scratch_pool);
+            if (new_ra_session)
+              SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
             SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc,
                                                       new_url,
                                                       NULL,
                                                       &(new_item->peg_revision),
                                                       &(new_item->revision),
                                                       ctx, scratch_pool));
+            new_ra_session = TRUE;
           }
 
         SVN_ERR(switch_file_external(local_abspath,
@@ -879,6 +886,8 @@ handle_external_item_change(svn_client_c
         break;
     }
 
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/import.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/import.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/import.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/import.c Thu Feb  5 00:44:57 2015
@@ -1006,6 +1006,7 @@ svn_client_import5(const char *path,
                     editor->abort_edit(edit_baton, scratch_pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/info.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/info.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/info.c Thu Feb  5 00:44:57 2015
@@ -457,6 +457,7 @@ svn_client_info4(const char *abspath_or_
                             depth, ctx, locks, pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/iprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/iprops.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/iprops.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/iprops.c Thu Feb  5 00:44:57 2015
@@ -139,6 +139,7 @@ get_inheritable_props(apr_hash_t **wcroo
   apr_hash_index_t *hi;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_pool_t *session_pool = NULL;
+  const svn_boolean_t new_ra_session = !ra_session;
   *wcroot_iprops = apr_hash_make(result_pool);
 
   SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(revision));
@@ -213,6 +214,8 @@ get_inheritable_props(apr_hash_t **wcroo
               if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
                 return svn_error_trace(err);
 
+              if (new_ra_session)
+                SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
               svn_error_clear(err);
               continue;
             }
@@ -220,6 +223,9 @@ get_inheritable_props(apr_hash_t **wcroo
           svn_hash_sets(*wcroot_iprops,
                         apr_pstrdup(result_pool, child_abspath),
                         inherited_props);
+
+          if (new_ra_session)
+            SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
         }
 
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/list.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/list.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/list.c Thu Feb  5 00:44:57 2015
@@ -317,6 +317,7 @@ list_internal(const char *path_or_url,
                              ctx, pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/locking_commands.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/locking_commands.c Thu Feb  5 00:44:57 2015
@@ -554,6 +554,8 @@ svn_client_lock(const apr_array_header_t
   /* Lock the paths. */
   err = svn_ra_lock(ra_session, path_revs, comment,
                     steal_lock, store_locks_callback, &cb, pool);
+  if (!err)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
 
 release_locks:
   if (lock_abspaths)
@@ -627,6 +629,8 @@ svn_client_unlock(const apr_array_header
   /* Unlock the paths. */
   err = svn_ra_unlock(ra_session, path_tokens, break_lock,
                       store_locks_callback, &cb, pool);
+  if (!err)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
 
 release_locks:
   if (lock_abspaths)

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c Thu Feb  5 00:44:57 2015
@@ -106,6 +106,7 @@ svn_client__get_copy_source(const char *
   apr_pool_t *sesspool = svn_pool_create(scratch_pool);
   svn_client__pathrev_t *at_loc;
   const char *old_session_url = NULL;
+  svn_boolean_t new_ra_session = FALSE;
 
   copyfrom_info.is_first = TRUE;
   copyfrom_info.path = NULL;
@@ -118,6 +119,7 @@ svn_client__get_copy_source(const char *
                                                 path_or_url, NULL,
                                                 revision, revision,
                                                 ctx, sesspool));
+      new_ra_session = TRUE;
     }
   else
     {
@@ -162,6 +164,8 @@ svn_client__get_copy_source(const char *
                     err,
                     svn_ra_reparent(ra_session, old_session_url, sesspool));
 
+  if (!err && new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(sesspool);
 
   if (err)
@@ -242,6 +246,7 @@ pre_15_receiver(void *baton, svn_log_ent
               continue;
             }
 
+          /* RA_CACHE TODO: release RA session */
           if (rb->ra_session == NULL)
             SVN_ERR(svn_client_open_ra_session2(&rb->ra_session,
                                                 rb->ra_session_url, NULL,
@@ -268,6 +273,7 @@ pre_15_receiver(void *baton, svn_log_ent
     }
   else
     {
+      /* RA_CACHE TODO: release RA session */
       if (rb->ra_session == NULL)
         SVN_ERR(svn_client_open_ra_session2(&rb->ra_session,
                                             rb->ra_session_url, NULL,

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/merge.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/merge.c Thu Feb  5 00:44:57 2015
@@ -9621,6 +9621,7 @@ ensure_ra_session_url(svn_ra_session_t *
   if (! *ra_session || (err && err->apr_err == SVN_ERR_RA_ILLEGAL_URL))
     {
       svn_error_clear(err);
+      /* RA_CACHE TODO: release RA session */
       err = svn_client_open_ra_session2(ra_session, url, wri_abspath,
                                         ctx, pool, pool);
     }
@@ -10532,6 +10533,8 @@ merge_locked(conflict_report_t **conflic
                  ctx, result_pool, scratch_pool);
 
   /* Close our temporary RA sessions. */
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session2));
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session1));
   svn_pool_destroy(sesspool);
 
   if (use_sleep)
@@ -11694,6 +11697,9 @@ merge_reintegrate_locked(conflict_report
                                                ctx,
                                                result_pool, scratch_pool);
 
+  SVN_ERR(svn_client__ra_session_release(ctx, source_ra_session));
+  SVN_ERR(svn_client__ra_session_release(ctx, target_ra_session));
+
   if (use_sleep)
     svn_io_sleep_for_timestamps(target_abspath, scratch_pool);
 
@@ -11801,6 +11807,8 @@ merge_peg_locked(conflict_report_t **con
                  ctx, result_pool, scratch_pool);
 
   /* We're done with our RA session. */
+  if (!err)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(sesspool);
 
   if (use_sleep)
@@ -12483,6 +12491,9 @@ find_automatic_merge_no_wc(automatic_mer
   SVN_ERR(find_automatic_merge(&merge->base, &merge->is_reintegrate_like, s_t,
                                ctx, result_pool, scratch_pool));
 
+  SVN_ERR(svn_client__ra_session_release(ctx, s_t->target_ra_session));
+  SVN_ERR(svn_client__ra_session_release(ctx, s_t->source_ra_session));
+
   merge->right = s_t->source;
   merge->target = &s_t->target->loc;
   merge->yca = s_t->yca;
@@ -12556,6 +12567,10 @@ client_find_automatic_merge(automatic_me
 
   SVN_ERR(find_automatic_merge(&merge->base, &merge->is_reintegrate_like, s_t,
                                ctx, result_pool, scratch_pool));
+
+  SVN_ERR(svn_client__ra_session_release(ctx, s_t->source_ra_session));
+  SVN_ERR(svn_client__ra_session_release(ctx, s_t->target_ra_session));
+
   merge->yca = s_t->yca;
   merge->right = s_t->source;
   merge->target = &s_t->target->loc;
@@ -12565,8 +12580,6 @@ client_find_automatic_merge(automatic_me
 
   *merge_p = merge;
 
-  /* TODO: Close the source and target sessions here? */
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/mergeinfo.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/mergeinfo.c Thu Feb  5 00:44:57 2015
@@ -679,15 +679,12 @@ svn_client__get_wc_or_repos_mergeinfo_ca
                                             result_pool, scratch_pool));
           if (!svn_hash_gets(original_props, SVN_PROP_MERGEINFO))
             {
-              apr_pool_t *sesspool = NULL;
+              const svn_boolean_t new_ra_session = !ra_session;
 
-              if (! ra_session)
-                {
-                  sesspool = svn_pool_create(scratch_pool);
-                  SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
-                                                      ctx,
-                                                      sesspool, sesspool));
-                }
+              if (new_ra_session)
+                SVN_ERR(svn_client_open_ra_session2(
+                            &ra_session, url, NULL, ctx,
+                            scratch_pool, scratch_pool));
 
               SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
                         &target_mergeinfo_cat_repos, ra_session,
@@ -707,10 +704,8 @@ svn_client__get_wc_or_repos_mergeinfo_ca
               /* If we created an RA_SESSION above, destroy it.
                  Otherwise, if reparented an existing session, point
                  it back where it was when we were called. */
-              if (sesspool)
-                {
-                  svn_pool_destroy(sesspool);
-                }
+              if (new_ra_session)
+                SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
             }
         }
     }
@@ -1043,6 +1038,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
   const char *local_abspath;
   svn_boolean_t use_url = svn_path_is_url(path_or_url);
   svn_client__pathrev_t *peg_loc;
+  svn_boolean_t new_ra_session = FALSE;
 
   if (ra_session && svn_path_is_url(path_or_url))
     {
@@ -1059,6 +1055,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
                                                 path_or_url, NULL,
                                                 peg_revision,
                                                 peg_revision, ctx, scratch_pool));
+      new_ra_session = TRUE;
     }
 
   /* If PATH_OR_URL is as working copy path determine if we will need to
@@ -1097,6 +1094,8 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
         result_pool, scratch_pool));
     }
 
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 
@@ -1517,6 +1516,7 @@ logs_for_mergeinfo_rangelist(const char
   svn_merge_range_t *oldest_range, *youngest_range;
   svn_revnum_t oldest_rev, youngest_rev;
   struct filter_log_entry_baton_t fleb;
+  svn_boolean_t new_ra_session = FALSE;
 
   if (! rangelist->nelts)
     return SVN_NO_ERROR;
@@ -1552,9 +1552,12 @@ logs_for_mergeinfo_rangelist(const char
   fleb.ctx = ctx;
 
   if (!ra_session)
-    SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, source_url,
-                                                 NULL, NULL, FALSE, FALSE, ctx,
-                                                 scratch_pool, scratch_pool));
+    {
+      SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, source_url,
+                                                   NULL, NULL, FALSE, FALSE, ctx,
+                                                   scratch_pool, scratch_pool));
+      new_ra_session = TRUE;
+    }
   else
     SVN_ERR(svn_ra_reparent(ra_session, source_url, scratch_pool));
 
@@ -1575,6 +1578,9 @@ logs_for_mergeinfo_rangelist(const char
                             scratch_pool));
   }
 
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
   /* Check for cancellation. */
   if (ctx->cancel_func)
     SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
@@ -1706,6 +1712,7 @@ svn_client__mergeinfo_log(svn_boolean_t
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
   svn_boolean_t oldest_revs_first = TRUE;
+  svn_boolean_t new_target_session = FALSE;
   apr_pool_t *subpool;
 
   /* We currently only support depth = empty | infinity. */
@@ -1773,6 +1780,7 @@ svn_client__mergeinfo_log(svn_boolean_t
                                                         target_peg_revision,
                                                         target_peg_revision,
                                                         ctx, subpool));
+              new_target_session = TRUE;
             }
           SVN_ERR(svn_ra_get_repos_root2(target_session, &repos_root,
                                          scratch_pool));
@@ -1849,16 +1857,20 @@ svn_client__mergeinfo_log(svn_boolean_t
    * should share a single session, tracking the two URLs separately. */
   {
     svn_ra_session_t *source_session;
+    svn_boolean_t new_source_session = FALSE;
     svn_revnum_t start_rev, end_rev, youngest_rev = SVN_INVALID_REVNUM;
 
     if (! finding_merged)
       {
         if (!target_session)
-          SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev,
-                                                    target_path_or_url, NULL,
-                                                    target_peg_revision,
-                                                    target_peg_revision,
-                                                    ctx, subpool));
+          {
+            SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev,
+                                                      target_path_or_url, NULL,
+                                                      target_peg_revision,
+                                                      target_peg_revision,
+                                                      ctx, subpool));
+            new_target_session = TRUE;
+          }
         SVN_ERR(svn_client__get_history_as_mergeinfo(&target_history, NULL,
                                                      pathrev,
                                                      SVN_INVALID_REVNUM,
@@ -1888,6 +1900,7 @@ svn_client__mergeinfo_log(svn_boolean_t
                                                   source_peg_revision,
                                                   source_peg_revision,
                                                   ctx, subpool));
+        new_source_session = TRUE;
       }
     SVN_ERR(svn_client__get_revision_number(&start_rev, &youngest_rev,
                                             ctx->wc_ctx, source_path_or_url,
@@ -1907,6 +1920,10 @@ svn_client__mergeinfo_log(svn_boolean_t
                                                  scratch_pool));
     if (start_rev > end_rev)
       oldest_revs_first = FALSE;
+
+    /* Release the source session */
+    if (new_source_session)
+      SVN_ERR(svn_client__ra_session_release(ctx, source_session));
   }
 
   /* Separate the explicit or inherited mergeinfo on TARGET_PATH_OR_URL,
@@ -2177,7 +2194,9 @@ svn_client__mergeinfo_log(svn_boolean_t
                                        log_receiver, log_receiver_baton,
                                        ctx, target_session, scratch_pool);
 
-    /* Close the source and target sessions. */
+    /* Release or close the target session. */
+    if (!err && new_target_session)
+      SVN_ERR(svn_client__ra_session_release(ctx, target_session));
     svn_pool_destroy(subpool); /* For SVN_ERR_CEASE_INVOCATION */
 
     return svn_error_trace(err);
@@ -2291,6 +2310,7 @@ svn_client_suggest_merge_sources(apr_arr
         }
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(session_pool);
 
   *suggestions = list;

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/prop_commands.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/prop_commands.c Thu Feb  5 00:44:57 2015
@@ -250,7 +250,9 @@ propset_on_url(const char *propname,
       ctx->notify_func2(ctx->notify_baton2, notify, pool);
     }
   /* Close the edit. */
-  return editor->close_edit(edit_baton, pool);
+  SVN_ERR(editor->close_edit(edit_baton, pool));
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+  return SVN_NO_ERROR;
 }
 
 /* Check that PROPNAME is a valid name for a versioned property.  Return an
@@ -511,6 +513,8 @@ svn_client_revprop_set2(const char *prop
                                     original_propval, propval, pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
   if (ctx->notify_func2)
     {
       svn_wc_notify_t *notify = svn_wc_create_notify_url(URL,
@@ -877,7 +881,6 @@ svn_client_propget5(apr_hash_t **props,
   if ((inherited_props && !local_iprops)
       || !local_explicit_props)
     {
-      svn_ra_session_t *ra_session;
       svn_node_kind_t kind;
       svn_opt_revision_t new_operative_rev;
       svn_opt_revision_t new_peg_rev;
@@ -955,6 +958,7 @@ svn_client_propget5(apr_hash_t **props,
       /* Do we still have anything to ask the repository about? */
       if (!local_explicit_props || !local_iprops)
         {
+          svn_ra_session_t *ra_session;
           svn_client__pathrev_t *loc;
 
           /* Get an RA plugin for this filesystem object. */
@@ -976,6 +980,7 @@ svn_client_propget5(apr_hash_t **props,
                                  kind, loc->rev, ra_session,
                                  depth, result_pool, scratch_pool));
           revnum = loc->rev;
+          SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
         }
     }
 
@@ -1011,6 +1016,7 @@ svn_client_revprop_get(const char *propn
   err = svn_ra_rev_prop(ra_session, *set_rev, propname, propval, pool);
 
   /* Close RA session */
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(subpool);
   return svn_error_trace(err);
 }
@@ -1379,6 +1385,8 @@ get_remote_props(const char *path_or_url
                           depth, receiver, receiver_baton,
                           ctx->cancel_func, ctx->cancel_baton,
                           scratch_pool));
+
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 
@@ -1589,6 +1597,10 @@ svn_client_revprop_list(apr_hash_t **pro
   err = svn_ra_rev_proplist(ra_session, *set_rev, &proplist, pool);
 
   *props = proplist;
-  svn_pool_destroy(subpool); /* Close RA session */
+
+  /* Close RA session */
+  if (!err)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+  svn_pool_destroy(subpool);
   return svn_error_trace(err);
 }

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/ra.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/ra.c Thu Feb  5 00:44:57 2015
@@ -802,6 +802,7 @@ svn_client__repos_locations(const char *
   svn_revnum_t peg_revnum = SVN_INVALID_REVNUM;
   svn_revnum_t start_revnum, end_revnum;
   svn_revnum_t youngest_rev = SVN_INVALID_REVNUM;
+  svn_boolean_t new_ra_session = FALSE;
   apr_pool_t *subpool = svn_pool_create(pool);
 
   /* Ensure that we are given some real revision data to work with.
@@ -882,8 +883,11 @@ svn_client__repos_locations(const char *
 
   /* Open a RA session to this URL if we don't have one already. */
   if (! ra_session)
-    SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
-                                        ctx, subpool, subpool));
+    {
+      SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
+                                          ctx, subpool, subpool));
+      new_ra_session = TRUE;
+    }
 
   /* Resolve the opt_revision_ts. */
   if (peg_revnum == SVN_INVALID_REVNUM)
@@ -915,6 +919,9 @@ svn_client__repos_locations(const char *
                           ra_session, url, peg_revnum,
                           start_revnum, end_revnum, youngest_rev,
                           pool, subpool));
+
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   svn_pool_destroy(subpool);
   return SVN_NO_ERROR;
 }
@@ -1001,10 +1008,10 @@ svn_client__get_youngest_common_ancestor
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool)
 {
-  apr_pool_t *sesspool = NULL;
   apr_hash_t *history1, *history2;
   svn_boolean_t has_rev_zero_history1;
   svn_boolean_t has_rev_zero_history2;
+  svn_boolean_t new_ra_session = FALSE;
 
   if (strcmp(loc1->repos_root_url, loc2->repos_root_url) != 0)
     {
@@ -1015,9 +1022,9 @@ svn_client__get_youngest_common_ancestor
   /* Open an RA session for the two locations. */
   if (session == NULL)
     {
-      sesspool = svn_pool_create(scratch_pool);
       SVN_ERR(svn_client_open_ra_session2(&session, loc1->url, NULL, ctx,
-                                          sesspool, sesspool));
+                                          scratch_pool, scratch_pool));
+      new_ra_session = TRUE;
     }
 
   /* We're going to cheat and use history-as-mergeinfo because it
@@ -1034,9 +1041,10 @@ svn_client__get_youngest_common_ancestor
                                                SVN_INVALID_REVNUM,
                                                SVN_INVALID_REVNUM,
                                                session, ctx, scratch_pool));
+
   /* Close the ra session if we opened one. */
-  if (sesspool)
-    svn_pool_destroy(sesspool);
+  if (new_ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, session));
 
   SVN_ERR(svn_client__calc_youngest_common_ancestor(ancestor_p,
                                                     loc1, history1,

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/status.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/status.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/status.c Thu Feb  5 00:44:57 2015
@@ -185,13 +185,11 @@ reporter_finish_report(void *report_bato
   svn_ra_session_t *ras;
   apr_hash_t *locks;
   const char *repos_root;
-  apr_pool_t *subpool = svn_pool_create(pool);
   svn_error_t *err = SVN_NO_ERROR;
 
-  /* Open an RA session to our common ancestor and grab the locks under it.
-   */
+  /* Open an RA session to our common ancestor and grab the locks under it. */
   SVN_ERR(svn_client_open_ra_session2(&ras, rb->ancestor, NULL,
-                                      rb->ctx, subpool, subpool));
+                                      rb->ctx, pool, pool));
 
   /* The locks need to live throughout the edit.  Note that if the
      server doesn't support lock discovery, we'll just not do locky
@@ -208,7 +206,7 @@ reporter_finish_report(void *report_bato
   SVN_ERR(svn_ra_get_repos_root2(ras, &repos_root, rb->pool));
 
   /* Close the RA session. */
-  svn_pool_destroy(subpool);
+  SVN_ERR(svn_client__ra_session_release(rb->ctx, ras));
 
   SVN_ERR(svn_wc_status_set_repos_locks(rb->set_locks_baton, locks,
                                         repos_root, rb->pool));
@@ -571,6 +569,8 @@ svn_client_status6(svn_revnum_t *result_
                                           NULL, NULL, pool));
         }
 
+      SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
       if (ctx->notify_func2)
         {
           svn_wc_notify_t *notify

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/switch.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/switch.c Thu Feb  5 00:44:57 2015
@@ -369,6 +369,8 @@ switch_internal(svn_revnum_t *result_rev
                                            ctx, pool));
     }
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
   /* Let everyone know we're finished here. */
   if (ctx->notify_func2)
     {

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/update.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/update.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/update.c Thu Feb  5 00:44:57 2015
@@ -570,6 +570,7 @@ svn_client__update_internal(svn_revnum_t
   svn_opt_revision_t peg_revision = *revision;
   apr_hash_t *conflicted_paths
     = ctx->conflict_func2 ? apr_hash_make(pool) : NULL;
+  const svn_boolean_t new_ra_session = !ra_session;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(! (innerupdate && make_parents));
@@ -661,6 +662,9 @@ svn_client__update_internal(svn_revnum_t
     }
 
  cleanup:
+  if (!err && new_ra_session && ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
+
   err = svn_error_compose_create(
             err,
             svn_wc__release_write_lock(ctx->wc_ctx, lockroot_abspath, pool));

Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/util.c?rev=1657451&r1=1657450&r2=1657451&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/util.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/util.c Thu Feb  5 00:44:57 2015
@@ -288,6 +288,7 @@ svn_client_get_repos_root(const char **r
   if (repos_uuid)
     SVN_ERR(svn_ra_get_uuid2(ra_session, repos_uuid, result_pool));
 
+  SVN_ERR(svn_client__ra_session_release(ctx, ra_session));
   return SVN_NO_ERROR;
 }
 



Mime
View raw message