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

Re: issue #1169 patch strategy

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

On Fri, Mar 07, 2003 at 01:38:51PM -0600, cmpilato@collab.net wrote:
> Matt Kraai <kraai@alumni.cmu.edu> writes:
> > Should I continue to implement issue #1169 one function at a time,
> > or should I add pools to all of the remaining functions at once?
>
> Well, you can start with the RA->get_dir() patch I posted to the list
> (but couldn't test over DAV because ... well, everyone knows why by
> now, I guess). Beyond that, I think I'd still like to see the changes
> happen with per-RA-function granularity. Makes the reviewing simpler.

OK, in that case, would someone please test the following patch
with ra_dav? It adds a pool argument to RA->get_dated_revision().

I'll take up your RA->get_dir() patch next.

Matt

-- 
Oink!
Partially fix issue #1169:
* subversion/include/svn_ra.h
  (svn_ra_plugin_t): Add pool argument to get_dated_revision.
* subversion/libsvn_ra_dav/ra_dav.h
  (svn_ra_dav__get_dated_revision): Add pool argument.
* subversion/libsvn_ra_dav/fetch.c
  (svn_ra_dav__get_dated_revision): Add pool argument.
* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__get_dated_revision): Likewise.
* subversion/libsvn_ra_svn/client.c
  (ra_svn_get_dated_rev): Likewise.
* subversion/bindings/ruby/ra.c
  (ra_get_dated_revision): Pass pool to get_dated_revision.
* subversion/libsvn_client/revisions.c
  (svn_client__get_revision_number): Likewise.
Index: subversion/include/svn_ra.h
===================================================================
--- subversion/include/svn_ra.h	(revision 5241)
+++ subversion/include/svn_ra.h	(working copy)
@@ -288,7 +288,8 @@
   /** Get the latest revision number at time @a time. */
   svn_error_t *(*get_dated_revision) (void *session_baton,
                                       svn_revnum_t *revision,
-                                      apr_time_t tm);
+                                      apr_time_t tm,
+                                      apr_pool_t *pool);
 
   /** Set the property @a name to @a value on revision @a rev.
    *
Index: subversion/libsvn_ra_local/ra_plugin.c
===================================================================
--- subversion/libsvn_ra_local/ra_plugin.c	(revision 5241)
+++ subversion/libsvn_ra_local/ra_plugin.c	(working copy)
@@ -283,12 +283,13 @@
 static svn_error_t *
 svn_ra_local__get_dated_revision (void *session_baton,
                                   svn_revnum_t *revision,
-                                  apr_time_t tm)
+                                  apr_time_t tm,
+                                  apr_pool_t *pool)
 {
   svn_ra_local__session_baton_t *baton = 
     (svn_ra_local__session_baton_t *) session_baton;
 
-  SVN_ERR (svn_repos_dated_revision (revision, baton->repos, tm, baton->pool));
+  SVN_ERR (svn_repos_dated_revision (revision, baton->repos, tm, pool));
 
   return SVN_NO_ERROR;
 }
Index: subversion/libsvn_client/revisions.c
===================================================================
--- subversion/libsvn_client/revisions.c	(revision 5241)
+++ subversion/libsvn_client/revisions.c	(working copy)
@@ -63,7 +63,8 @@
   if (revision->kind == svn_opt_revision_number)
     *revnum = revision->value.number;
   else if (revision->kind == svn_opt_revision_date)
-    SVN_ERR (ra_lib->get_dated_revision (sess, revnum, revision->value.date));
+    SVN_ERR (ra_lib->get_dated_revision (sess, revnum, revision->value.date,
+                                         pool));
   else if (revision->kind == svn_opt_revision_head)
     SVN_ERR (ra_lib->get_latest_revnum (sess, revnum, pool));
   else if (revision->kind == svn_opt_revision_unspecified)
Index: subversion/bindings/ruby/ra.c
===================================================================
--- subversion/bindings/ruby/ra.c	(revision 5241)
+++ subversion/bindings/ruby/ra.c	(working copy)
@@ -482,7 +482,8 @@
     sec = NUM2LONG (rb_funcall (aDate, rb_intern ("tv_sec"), 0));
     usec = NUM2LONG (rb_funcall (aDate, rb_intern ("tv_usec"), 0));
     err = ra->plugin->get_dated_revision (ra->session_baton, &revision,
-                                          apr_time_make(sec, usec));
+                                          apr_time_make(sec, usec),
+                                          ra->pool);
   }
 
   if (err)
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c	(revision 5241)
+++ subversion/libsvn_ra_svn/client.c	(working copy)
@@ -409,10 +409,9 @@
 }
 
 static svn_error_t *ra_svn_get_dated_rev(void *sess, svn_revnum_t *rev,
-                                         apr_time_t tm)
+                                         apr_time_t tm, 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-dated-rev", "c",
                                svn_time_to_cstring(tm, pool)));
Index: subversion/libsvn_ra_dav/ra_dav.h
===================================================================
--- subversion/libsvn_ra_dav/ra_dav.h	(revision 5241)
+++ subversion/libsvn_ra_dav/ra_dav.h	(working copy)
@@ -76,7 +76,8 @@
 
 svn_error_t *svn_ra_dav__get_dated_revision (void *session_baton,
                                              svn_revnum_t *revision,
-                                             apr_time_t timestamp);
+                                             apr_time_t timestamp,
+                                             apr_pool_t *pool);
 
 svn_error_t *svn_ra_dav__change_rev_prop (void *session_baton,
                                           svn_revnum_t rev,
Index: subversion/libsvn_ra_dav/fetch.c
===================================================================
--- subversion/libsvn_ra_dav/fetch.c	(revision 5241)
+++ subversion/libsvn_ra_dav/fetch.c	(working copy)
@@ -1464,26 +1464,27 @@
 
 svn_error_t *svn_ra_dav__get_dated_revision (void *session_baton,
                                              svn_revnum_t *revision,
-                                             apr_time_t timestamp)
+                                             apr_time_t timestamp,
+                                             apr_pool_t *pool)
 {
   svn_ra_session_t *ras = session_baton;
   const char *body;
   svn_error_t *err;
 
-  body = apr_psprintf(ras->pool,
+  body = apr_psprintf(pool,
                       "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
                       "<S:dated-rev-report xmlns:S=\"" SVN_XML_NAMESPACE "\" "
                       "xmlns:D=\"DAV:\">"
                       "<D:creationdate>%s</D:creationdate>"
                       "</S:dated-rev-report>",
-                      svn_time_to_cstring(timestamp, ras->pool));
+                      svn_time_to_cstring(timestamp, pool));
 
   *revision = SVN_INVALID_REVNUM;
   err = svn_ra_dav__parsed_request(ras, "REPORT", ras->root.path, body, NULL,
                                    drev_report_elements,
                                    drev_validate_element,
                                    drev_start_element, drev_end_element,
-                                   revision, NULL, ras->pool);
+                                   revision, NULL, pool);
   if (err && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
     return svn_error_quick_wrap(err, "Server does not support date-based "
                                 "operations.");
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 7 21:33:01 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.