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

Re: svn commit: r1365324 - reparenting an RA session each time it's used

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 25 Jul 2012 16:02:42 +0100 (BST)

Daniel Shahaf wrote:

>C. Michael Pilato wrote on Tue, Jul 24, 2012 at 21:31:49 -0400:
>> For ra_svn:  I was totally wrong.  This thing always requires network
>> activity: a "reparent" command/response at best; at worst, the complete
>> teardown and re-opening of the session.  This is just a side-effect of the
>> stateful protocol.  Unlike with HTTP, the server here is privy to the
>> "session URL" concept -- clients only perform operations using relpaths
>> against that URL -- and so the server must be told when that has changed.
>So... should we revv ra_svn so 1.8 clients/servers can talk to each
>other exclusively in repos-root-relative paths?

That sounds good to me, but I don't understand the authz impact.

In much of the merge code, it is convenient to carry around just one RA session and reparent it as necessary to address (parts of) the source and target trees in the repository.  I have been changing more of the code to work that way, and would like to continue.

If we can alleviate any ra_svn performance impact by adjusting RA_svn, that would seem to be best.

I can't see the session URL semantics documented where I'm looking for it (in svn_ra.h).  Would the following doc string update for ra_open4() be an improvement?

- Julian

Index: subversion/include/svn_ra.h
--- subversion/include/svn_ra.h    (revision 1365585)
+++ subversion/include/svn_ra.h    (working copy)
@@ -601,39 +601,52 @@
  * Open a repository access session to the repository at @a repos_URL,
  * or inform the caller regarding a correct URL by which to access
  * that repository.
  * If @a repos_URL can be used successfully to access the repository,
  * set @a *session_p to an opaque object representing a repository
  * session for the repository and (if @a corrected_url is non-NULL)
  * set @a *corrected_url to NULL.  If there's a better URL that the
  * caller should try and @a corrected_url is non-NULL, set
  * @a *session_p to NULL and @a *corrected_url to the corrected URL.  If
  * there's a better URL that the caller should try, and @a
  * corrected_url is NULL, return an #SVN_ERR_RA_SESSION_URL_MISMATCH
  * error.  Allocate all returned items in @a pool.
+ * The @a repos_URL need not point to the root of the repository: subject
+ * to authorization, it may point to any path within the repository, even
+ * a path at which no node exists in the repository.  The session will
+ * remember this URL as its "session URL" (also called "session root URL"),
+ * until changed by svn_ra_reparent().  Many RA functions take or return
+ * paths that are relative to the session URL.
+ *
+ * If a @a corrected_url is returned, it will point to the same path
+ * within the new repository root URL that @a repos_URL pointed to within
+ * the old repository root URL.
+ *
  * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
  * to the UUID of the repository at @c repos_URL.
  * @a callbacks/@a callback_baton is a table of callbacks provided by the
  * client; see @c svn_ra_callbacks2_t.
  * @a config is a hash mapping <tt>const char *</tt> keys to
  * @c svn_config_t * values.  For example, the @c svn_config_t for the
  * "~/.subversion/config" file is under the key "config".
  * All RA requests require a session; they will continue to
  * use @a pool for memory allocation.
  * @see svn_client_open_ra_session().
  * @since New in 1.7.
 svn_error_t *
 svn_ra_open4(svn_ra_session_t **session_p,
              const char **corrected_url,
              const char *repos_URL,
              const char *uuid,
              const svn_ra_callbacks2_t *callbacks,
              void *callback_baton,
Received on 2012-07-25 17:03:19 CEST

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.