subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1658987 - in /subversion/branches/reuse-ra-session/subversion/libsvn_client: commit.c log.c
Date Wed, 11 Feb 2015 15:18:01 GMT
Author: ivan
Date: Wed Feb 11 15:18:00 2015
New Revision: 1658987

URL: http://svn.apache.org/r1658987
Log:
On the reuse-ra-session branch: Explictly release RA sessions once we do
not need them.

* subversion/libsvn_client/commit.c
  (check_url_kind_baton): Remove POOL, SESSION and REPOS_ROOT_URL members.
  (check_url_kind): Rely on RA session cache framework for reusing RA 
   sessions.
  (svn_client_commit6): Do not initialize removed fields.

* subversion/libsvn_client/log.c
  (pre_15_receiver): Remove TODO comment.
  (run_ra_get_log): Release RA session once we finished.

Modified:
    subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c
    subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c

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=1658987&r1=1658986&r2=1658987&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/commit.c Wed Feb 11 15:18:00
2015
@@ -384,9 +384,6 @@ determine_lock_targets(apr_array_header_
 /* Baton for check_url_kind */
 struct check_url_kind_baton
 {
-  apr_pool_t *pool;
-  svn_ra_session_t *session;
-  const char *repos_root_url;
   svn_client_ctx_t *ctx;
 };
 
@@ -399,22 +396,19 @@ check_url_kind(void *baton,
                apr_pool_t *scratch_pool)
 {
   struct check_url_kind_baton *cukb = baton;
+  svn_ra_session_t *ra_session;
 
-  /* 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,
-                                     cukb->pool));
-    }
-  else
-    SVN_ERR(svn_ra_reparent(cukb->session, url, scratch_pool));
+  /* Open RA session: RA session cache framework will reuse existing
+     session if possible. */
+  SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL, cukb->ctx,
+                                      scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_ra_check_path(ra_session, "", revision, kind, scratch_pool));
 
-  return svn_error_trace(
-                svn_ra_check_path(cukb->session, "", revision,
-                                  kind, scratch_pool));
+  /* Release RA session to cache. */
+  SVN_ERR(svn_client__ra_session_release(cukb->ctx, ra_session));
+
+  return SVN_NO_ERROR;
 }
 
 /* Recurse into every target in REL_TARGETS, finding committable externals
@@ -617,9 +611,6 @@ svn_client_commit6(const apr_array_heade
     struct check_url_kind_baton cukb;
 
     /* Prepare for when we have a copy containing not-present nodes. */
-    cukb.pool = iterpool;
-    cukb.session = NULL; /* ### Can we somehow reuse session? */
-    cukb.repos_root_url = NULL;
     cukb.ctx = ctx;
 
     cmt_err = svn_error_trace(

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=1658987&r1=1658986&r2=1658987&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/log.c Wed Feb 11 15:18:00
2015
@@ -246,7 +246,6 @@ 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,
@@ -273,7 +272,6 @@ 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,
@@ -836,6 +834,9 @@ run_ra_get_log(apr_array_header_t *revis
     }
   svn_pool_destroy(iterpool);
 
+  if (rb.ra_session)
+    SVN_ERR(svn_client__ra_session_release(ctx, rb.ra_session));
+
   return SVN_NO_ERROR;
 }
 



Mime
View raw message