You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/12/02 08:35:18 UTC
svn commit: r1717574 - in /subversion/trunk/subversion:
libsvn_ra/ra_loader.c libsvn_ra/ra_loader.h libsvn_ra_local/ra_plugin.c
libsvn_ra_serf/serf.c libsvn_ra_svn/client.c
Author: rhuijben
Date: Wed Dec 2 07:35:18 2015
New Revision: 1717574
URL: http://svn.apache.org/viewvc?rev=1717574&view=rev
Log:
Extend and cleanup the ra api a bit to allow ra session implementations to
open other ra sessions. (This is similar to how the fs layer receives a
pointer to svn_fs_openX())
The ra-git branch will use this to implement ra_git by passing most of the
ra functions to an ra_local session to the local git repository.
* subversion/libsvn_ra/ra_loader.c
(svn_ra_open4,
svn_ra__dup_session): Call set_svn_ra_open.
* subversion/libsvn_ra/ra_loader.h
(svn_ra__open_func_t): New prototype.
(svn_ra__vtable_t): Introduce set_svn_ra_open. Move experimental functions
to the end of the list.
* subversion/libsvn_ra_local/ra_plugin.c
(ra_local_vtable): Update table. Document missing items.
* subversion/libsvn_ra_serf/serf.c
(serf_vtable): Update table. Document missing items.
* subversion/libsvn_ra_svn/client.c
(ra_svn_vtable): Update table. Document missing items.
Modified:
subversion/trunk/subversion/libsvn_ra/ra_loader.c
subversion/trunk/subversion/libsvn_ra/ra_loader.h
subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
subversion/trunk/subversion/libsvn_ra_serf/serf.c
subversion/trunk/subversion/libsvn_ra_svn/client.c
Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1717574&r1=1717573&r2=1717574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Wed Dec 2 07:35:18 2015
@@ -410,6 +410,9 @@ svn_error_t *svn_ra_open4(svn_ra_session
return SVN_NO_ERROR;
}
+ if (vtable->set_svn_ra_open)
+ SVN_ERR(vtable->set_svn_ra_open(session, svn_ra_open4));
+
/* Check the UUID. */
if (uuid)
{
@@ -468,6 +471,9 @@ svn_ra__dup_session(svn_ra_session_t **n
result_pool,
scratch_pool));
+ if (session->vtable->set_svn_ra_open)
+ SVN_ERR(session->vtable->set_svn_ra_open(session, svn_ra_open4));
+
*new_session = session;
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.h?rev=1717574&r1=1717573&r2=1717574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.h Wed Dec 2 07:35:18 2015
@@ -38,6 +38,17 @@
extern "C" {
#endif
+/* Prototype of most recent version of svn_ra_openX() api, optionally
+ handed to the ra api to allow opening other ra sessions. */
+typedef svn_error_t * (*svn_ra__open_func_t)(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,
+ apr_hash_t *config,
+ apr_pool_t *pool);
+
/* The RA layer vtable. */
typedef struct svn_ra__vtable_t {
/* This field should always remain first in the vtable. */
@@ -308,10 +319,6 @@ typedef struct svn_ra__vtable_t {
svn_revnum_t end_revision,
svn_revnum_t *revision_deleted,
apr_pool_t *pool);
-
- /* See svn_ra__register_editor_shim_callbacks() */
- svn_error_t *(*register_editor_shim_callbacks)(svn_ra_session_t *session,
- svn_delta_shim_callbacks_t *callbacks);
/* See svn_ra_get_inherited_props(). */
svn_error_t *(*get_inherited_props)(svn_ra_session_t *session,
apr_array_header_t **iprops,
@@ -319,6 +326,17 @@ typedef struct svn_ra__vtable_t {
svn_revnum_t revision,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+ /* If not NULL, receives a pointer to svn_ra_open, to alllow opening
+ a new ra session from inside the ra layer without a circular
+ library dependency*/
+ svn_error_t *(*set_svn_ra_open)(svn_ra_session_t *session,
+ svn_ra__open_func_t func);
+
+ /* Experimental support below here */
+
+ /* See svn_ra__register_editor_shim_callbacks() */
+ svn_error_t *(*register_editor_shim_callbacks)(svn_ra_session_t *session,
+ svn_delta_shim_callbacks_t *callbacks);
/* See svn_ra__get_commit_ev2() */
svn_error_t *(*get_commit_ev2)(
svn_editor_t **editor,
Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1717574&r1=1717573&r2=1717574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Wed Dec 2 07:35:18 2015
@@ -1833,9 +1833,11 @@ static const svn_ra__vtable_t ra_local_v
svn_ra_local__has_capability,
svn_ra_local__replay_range,
svn_ra_local__get_deleted_rev,
- svn_ra_local__register_editor_shim_callbacks,
svn_ra_local__get_inherited_props,
- svn_ra_local__get_commit_ev2
+ NULL /* set_svn_ra_open */,
+ svn_ra_local__register_editor_shim_callbacks,
+ svn_ra_local__get_commit_ev2,
+ NULL /* replay_range_ev2 */
};
Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1717574&r1=1717573&r2=1717574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Wed Dec 2 07:35:18 2015
@@ -1050,8 +1050,11 @@ static const svn_ra__vtable_t serf_vtabl
svn_ra_serf__has_capability,
svn_ra_serf__replay_range,
svn_ra_serf__get_deleted_rev,
+ svn_ra_serf__get_inherited_props,
+ NULL /* set_svn_ra_open */,
svn_ra_serf__register_editor_shim_callbacks,
- svn_ra_serf__get_inherited_props
+ NULL /* commit_ev2 */,
+ NULL /* replay_range_ev2 */
};
svn_error_t *
Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1717574&r1=1717573&r2=1717574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Wed Dec 2 07:35:18 2015
@@ -2951,8 +2951,11 @@ static const svn_ra__vtable_t ra_svn_vta
ra_svn_has_capability,
ra_svn_replay_range,
ra_svn_get_deleted_rev,
+ ra_svn_get_inherited_props,
+ NULL /* ra_set_svn_ra_open */,
ra_svn_register_editor_shim_callbacks,
- ra_svn_get_inherited_props
+ NULL /* commit_ev2 */,
+ NULL /* replay_range_ev2 */
};
svn_error_t *