[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RFT: add pool argument to RA->get_latest_revnum()

From: Matt Kraai <kraai_at_alumni.cmu.edu>
Date: 2003-03-07 19:10:42 CET

Howdy,

Would someone please regression test the following patch with
ra_dav? It adds a pool argument to RA->get_latest_revnum().

Matt

-- 
Oink!
Index: subversion/include/svn_ra.h
===================================================================
--- subversion/include/svn_ra.h	(revision 5230)
+++ subversion/include/svn_ra.h	(working copy)
@@ -278,9 +278,12 @@
    *
    * Get the latest revision number from the repository. This is
    * useful for the `svn status' command.  :)
+   *
+   * Use @a pool for memory allocation.
    */
   svn_error_t *(*get_latest_revnum) (void *session_baton,
-                                     svn_revnum_t *latest_revnum);
+                                     svn_revnum_t *latest_revnum,
+                                     apr_pool_t *pool);
 
   /** Get the latest revision number at time @a time. */
   svn_error_t *(*get_dated_revision) (void *session_baton,
Index: subversion/libsvn_ra_local/ra_plugin.c
===================================================================
--- subversion/libsvn_ra_local/ra_plugin.c	(revision 5230)
+++ subversion/libsvn_ra_local/ra_plugin.c	(working copy)
@@ -265,12 +265,13 @@
 
 static svn_error_t *
 svn_ra_local__get_latest_revnum (void *session_baton,
-                                 svn_revnum_t *latest_revnum)
+                                 svn_revnum_t *latest_revnum,
+                                 apr_pool_t *pool)
 {
   svn_ra_local__session_baton_t *baton = 
     (svn_ra_local__session_baton_t *) session_baton;
 
-  SVN_ERR (svn_fs_youngest_rev (latest_revnum, baton->fs, baton->pool));
+  SVN_ERR (svn_fs_youngest_rev (latest_revnum, baton->fs, pool));
 
   return SVN_NO_ERROR;
 }
@@ -390,7 +391,8 @@
     (svn_ra_local__session_baton_t *) session_baton;
   
   if (! SVN_IS_VALID_REVNUM(revision))
-    SVN_ERR (svn_ra_local__get_latest_revnum (sbaton, &revnum_to_fetch));
+    SVN_ERR (svn_ra_local__get_latest_revnum (sbaton, &revnum_to_fetch,
+                                              sbaton->pool));
   else
     revnum_to_fetch = revision;
 
@@ -423,7 +425,7 @@
 
   /* Get the HEAD revision if one is not supplied. */
   if (! SVN_IS_VALID_REVNUM(revision))
-    SVN_ERR (svn_ra_local__get_latest_revnum (sbaton, &revision));
+    SVN_ERR (svn_ra_local__get_latest_revnum (sbaton, &revision, sbaton->pool));
 
   /* If OTHER_URL was provided, validate it and convert it into a
      regular filesystem path. */
Index: subversion/libsvn_client/cat.c
===================================================================
--- subversion/libsvn_client/cat.c	(revision 5230)
+++ subversion/libsvn_client/cat.c	(working copy)
@@ -70,7 +70,7 @@
   SVN_ERR (svn_client__get_revision_number (&rev, ra_lib, session,
                                             revision, path_or_url, pool));
   if (! SVN_IS_VALID_REVNUM (rev))
-    SVN_ERR (ra_lib->get_latest_revnum (session, &rev));
+    SVN_ERR (ra_lib->get_latest_revnum (session, &rev, pool));
 
   /* Decide if the URL is a file or directory. */
   SVN_ERR (ra_lib->check_path (&url_kind, session, "", rev));
Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c	(revision 5230)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -287,7 +287,7 @@
   SVN_ERR (svn_client__get_revision_number
            (&src_revnum, ra_lib, sess, src_revision, NULL, pool));
 
-  SVN_ERR (ra_lib->get_latest_revnum (sess, &youngest));
+  SVN_ERR (ra_lib->get_latest_revnum (sess, &youngest, pool));
 
   /* Use YOUNGEST for copyfrom args if not provided. */
   if (! SVN_IS_VALID_REVNUM (src_revnum))
Index: subversion/libsvn_client/ls.c
===================================================================
--- subversion/libsvn_client/ls.c	(revision 5230)
+++ subversion/libsvn_client/ls.c	(working copy)
@@ -104,7 +104,7 @@
   SVN_ERR (svn_client__get_revision_number (&rev, ra_lib, session,
                                             revision, NULL, pool));
   if (! SVN_IS_VALID_REVNUM (rev))
-    SVN_ERR (ra_lib->get_latest_revnum (session, &rev));
+    SVN_ERR (ra_lib->get_latest_revnum (session, &rev, pool));
 
   /* Decide if the URL is a file or directory. */
   SVN_ERR (ra_lib->check_path (&url_kind, session, "", rev));
Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c	(revision 5230)
+++ subversion/libsvn_client/log.c	(working copy)
@@ -275,7 +275,7 @@
       {
         svn_revnum_t youngest_rev;
         
-        SVN_ERR (ra_lib->get_latest_revnum (session, &youngest_rev));
+        SVN_ERR (ra_lib->get_latest_revnum (session, &youngest_rev, pool));
         if (youngest_rev == 0)
           {
             err = SVN_NO_ERROR;
Index: subversion/libsvn_client/revisions.c
===================================================================
--- subversion/libsvn_client/revisions.c	(revision 5230)
+++ subversion/libsvn_client/revisions.c	(working copy)
@@ -65,7 +65,7 @@
   else if (revision->kind == svn_opt_revision_date)
     SVN_ERR (ra_lib->get_dated_revision (sess, revnum, revision->value.date));
   else if (revision->kind == svn_opt_revision_head)
-    SVN_ERR (ra_lib->get_latest_revnum (sess, revnum));
+    SVN_ERR (ra_lib->get_latest_revnum (sess, revnum, pool));
   else if (revision->kind == svn_opt_revision_unspecified)
     *revnum = SVN_INVALID_REVNUM;
   else if ((revision->kind == svn_opt_revision_committed)
Index: subversion/libsvn_client/commit.c
===================================================================
--- subversion/libsvn_client/commit.c	(revision 5230)
+++ subversion/libsvn_client/commit.c	(working copy)
@@ -459,7 +459,7 @@
 
   /* Fetch the latest revision if requested. */
   if (latest_rev)
-    SVN_ERR ((*ra_lib)->get_latest_revnum (*session, latest_rev));
+    SVN_ERR ((*ra_lib)->get_latest_revnum (*session, latest_rev, pool));
   
   /* Fetch RA commit editor. */
   return (*ra_lib)->get_commit_editor (*session, editor, edit_baton, 
Index: subversion/bindings/ruby/ra.c
===================================================================
--- subversion/bindings/ruby/ra.c	(revision 5230)
+++ subversion/bindings/ruby/ra.c	(working copy)
@@ -455,7 +455,8 @@
   if (ra->closed)
     rb_raise (rb_eRuntimeError, "not opened");
 
-  err = ra->plugin->get_latest_revnum (ra->session_baton, &latest_revnum);
+  err = ra->plugin->get_latest_revnum (ra->session_baton, &latest_revnum,
+                                       ra->pool);
 
   if (err)
     svn_ruby_raise (err);
Index: subversion/tests/libsvn_ra_local/ra-local-test.c
===================================================================
--- subversion/tests/libsvn_ra_local/ra-local-test.c	(revision 5230)
+++ subversion/tests/libsvn_ra_local/ra-local-test.c	(working copy)
@@ -154,7 +154,7 @@
                          pool));
 
   /* Get the youngest revision and make sure it's 0. */
-  SVN_ERR (plugin->get_latest_revnum (session, &latest_rev));
+  SVN_ERR (plugin->get_latest_revnum (session, &latest_rev, pool));
   
   if (latest_rev != 0)
       return svn_error_create (SVN_ERR_FS_GENERAL, NULL,
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c	(revision 5230)
+++ subversion/libsvn_ra_svn/client.c	(working copy)
@@ -398,10 +398,10 @@
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_get_latest_rev(void *sess, svn_revnum_t *rev)
+static svn_error_t *ra_svn_get_latest_rev(void *sess, svn_revnum_t *rev,
+                                          apr_pool_t *pool)
 {
   svn_ra_svn_conn_t *conn = sess;
-  apr_pool_t *pool = conn->pool;
 
   SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "get-latest-rev", ""));
   SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "r", rev));
Index: subversion/libsvn_ra_dav/ra_dav.h
===================================================================
--- subversion/libsvn_ra_dav/ra_dav.h	(revision 5230)
+++ subversion/libsvn_ra_dav/ra_dav.h	(working copy)
@@ -71,7 +71,8 @@
 /** plugin function prototypes */
 
 svn_error_t *svn_ra_dav__get_latest_revnum(void *session_baton,
-                                           svn_revnum_t *latest_revnum);
+                                           svn_revnum_t *latest_revnum,
+                                           apr_pool_t *pool);
 
 svn_error_t *svn_ra_dav__get_dated_revision (void *session_baton,
                                              svn_revnum_t *revision,
Index: subversion/libsvn_ra_dav/fetch.c
===================================================================
--- subversion/libsvn_ra_dav/fetch.c	(revision 5230)
+++ subversion/libsvn_ra_dav/fetch.c	(working copy)
@@ -1403,7 +1403,8 @@
 /* ------------------------------------------------------------------------- */
 
 svn_error_t *svn_ra_dav__get_latest_revnum(void *session_baton,
-                                           svn_revnum_t *latest_revnum)
+                                           svn_revnum_t *latest_revnum,
+                                           apr_pool_t *pool)
 {
   svn_ra_session_t *ras = session_baton;
 
@@ -1414,7 +1415,7 @@
      give us the latest revision number */
   SVN_ERR( svn_ra_dav__get_baseline_info(NULL, NULL, NULL, latest_revnum,
                                          ras->sess, ras->root.path,
-                                         SVN_INVALID_REVNUM, ras->pool) );
+                                         SVN_INVALID_REVNUM, pool) );
 
   SVN_ERR( svn_ra_dav__maybe_store_auth_info(ras) );
 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 7 19:10:25 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.