Author: cmpilato
Date: Tue Mar 29 20:49:21 2011
New Revision: 1086735
URL: http://svn.apache.org/viewvc?rev=1086735&view=rev
Log:
Followup to r1085464, using a second RA session for auxiliary
out-of-band file/dir property lookups. This fixes the
svnrdump_test.py 39, which was failing over ra_svn.
* subversion/svnrdump/svnrdump.c
(opt_baton_t): Add 'ctx' member.
(init_client_context): Was 'open_connection'. Now just initializes
the client context baton, deferring the RA session open for someone
else to do.
(load_revisions): Add 'aux_session' parameter, passed to updated
call to load_dumpstream().
(load_cmd): Open a second RA session, and pass it to load_revisions().
(main): Track rename and repurpose of init_client_context().
Explicitly call svn_client_open_ra_session().
* subversion/svnrdump/load_editor.h
(struct parse_baton): Add 'aux_session' member.
(load_dumpstream): Add 'aux_session' parameter.
* subversion/svnrdump/load_editor.c
(remove_node_props): Use the aux_session rather than the primary
session when fetching dir/file properties.
(load_dumpstream): Add 'aux_session' parameter, and toss its value
into the parse_baton.
Modified:
subversion/trunk/subversion/svnrdump/load_editor.c
subversion/trunk/subversion/svnrdump/load_editor.h
subversion/trunk/subversion/svnrdump/svnrdump.c
Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1086735&r1=1086734&r2=1086735&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Tue Mar 29 20:49:21 2011
@@ -451,13 +451,13 @@ remove_node_props(void *baton)
if (nb->kind == svn_node_file)
{
- SVN_ERR(svn_ra_get_file(nb->rb->pb->session, nb->path,
SVN_INVALID_REVNUM,
- NULL, NULL, &props, pool));
+ SVN_ERR(svn_ra_get_file(nb->rb->pb->aux_session, nb->path,
+ SVN_INVALID_REVNUM, NULL, NULL, &props, pool));
}
else /* nb->kind == svn_node_dir */
{
- SVN_ERR(svn_ra_get_dir2(nb->rb->pb->session, NULL, NULL, &props,
nb->path,
- SVN_INVALID_REVNUM, 0, pool));
+ SVN_ERR(svn_ra_get_dir2(nb->rb->pb->aux_session, NULL, NULL, &props,
+ nb->path, SVN_INVALID_REVNUM, 0, pool));
}
for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
@@ -591,6 +591,7 @@ close_revision(void *baton)
svn_error_t *
load_dumpstream(svn_stream_t *stream,
svn_ra_session_t *session,
+ svn_ra_session_t *aux_session,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool)
@@ -623,6 +624,7 @@ load_dumpstream(svn_stream_t *stream,
parse_baton = apr_pcalloc(pool, sizeof(*parse_baton));
parse_baton->session = session;
+ parse_baton->aux_session = aux_session;
parse_baton->root_url = root_url;
err = svn_repos_parse_dumpstream2(stream, parser, parse_baton,
Modified: subversion/trunk/subversion/svnrdump/load_editor.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.h?rev=1086735&r1=1086734&r2=1086735&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.h (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.h Tue Mar 29 20:49:21 2011
@@ -36,6 +36,7 @@ struct parse_baton
const svn_delta_editor_t *commit_editor;
void *commit_edit_baton;
svn_ra_session_t *session;
+ svn_ra_session_t *aux_session;
const char *uuid;
const char *root_url;
};
@@ -90,13 +91,16 @@ struct revision_baton
/**
* Load the dumpstream carried in @a stream to the location described
- * by @a session. Use @a pool for all memory allocations. Use @a
+ * by @a session. Use @a aux_session (which is opened to the same URL
+ * as @a session) for any secondary, out-of-band RA communications
+ * required. Use @a pool for all memory allocations. Use @a
* cancel_func and @a cancel_baton to check for user cancellation of
* the operation (for timely-but-safe termination).
*/
svn_error_t *
load_dumpstream(svn_stream_t *stream,
svn_ra_session_t *session,
+ svn_ra_session_t *aux_session,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool);
Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=1086735&r1=1086734&r2=1086735&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.c Tue Mar 29 20:49:21 2011
@@ -156,6 +156,7 @@ struct replay_baton {
/* Option set */
typedef struct opt_baton_t {
+ svn_client_ctx_t *ctx;
svn_ra_session_t *session;
const char *url;
svn_boolean_t help;
@@ -237,22 +238,20 @@ replay_revend(svn_revnum_t revision,
return SVN_NO_ERROR;
}
-/* Set *SESSION to a new RA session opened to URL. Allocate *SESSION
- * and related data structures in POOL. Use CONFIG_DIR and pass
- * USERNAME, PASSWORD, CONFIG_DIR and NO_AUTH_CACHE to initialize the
- * authorization baton. CONFIG_OPTIONS (if not NULL) is a list of
- * configuration overrides.
+/* Initialize the RA layer, and set *CTX to a new client context baton
+ * allocated from POOL. Use CONFIG_DIR and pass USERNAME, PASSWORD,
+ * CONFIG_DIR and NO_AUTH_CACHE to initialize the authorization baton.
+ * CONFIG_OPTIONS (if not NULL) is a list of configuration overrides.
*/
static svn_error_t *
-open_connection(svn_ra_session_t **session,
- const char *url,
- svn_boolean_t non_interactive,
- const char *username,
- const char *password,
- const char *config_dir,
- svn_boolean_t no_auth_cache,
- apr_array_header_t *config_options,
- apr_pool_t *pool)
+init_client_context(svn_client_ctx_t **ctx_p,
+ svn_boolean_t non_interactive,
+ const char *username,
+ const char *password,
+ const char *config_dir,
+ svn_boolean_t no_auth_cache,
+ apr_array_header_t *config_options,
+ apr_pool_t *pool)
{
svn_client_ctx_t *ctx = NULL;
svn_config_t *cfg_config;
@@ -280,7 +279,7 @@ open_connection(svn_ra_session_t **sessi
no_auth_cache, FALSE, cfg_config,
ctx->cancel_func, ctx->cancel_baton,
pool));
- SVN_ERR(svn_client_open_ra_session(session, url, ctx, pool));
+ *ctx_p = ctx;
return SVN_NO_ERROR;
}
@@ -431,10 +430,13 @@ replay_revisions(svn_ra_session_t *sessi
/* Read a dumpstream from stdin, and use it to feed a loader capable
* of transmitting that information to the repository located at URL
- * (to which SESSION has been opened).
+ * (to which SESSION has been opened). AUX_SESSION is a second RA
+ * session opened to the same URL for performing auxiliary out-of-band
+ * operations.
*/
static svn_error_t *
load_revisions(svn_ra_session_t *session,
+ svn_ra_session_t *aux_session,
const char *url,
svn_boolean_t quiet,
apr_pool_t *pool)
@@ -445,8 +447,8 @@ load_revisions(svn_ra_session_t *session
apr_file_open_stdin(&stdin_file, pool);
stdin_stream = svn_stream_from_aprfile2(stdin_file, FALSE, pool);
- SVN_ERR(load_dumpstream(stdin_stream, session, check_cancel,
- NULL, pool));
+ SVN_ERR(load_dumpstream(stdin_stream, session, aux_session,
+ check_cancel, NULL, pool));
SVN_ERR(svn_stream_close(stdin_stream));
@@ -533,7 +535,11 @@ load_cmd(apr_getopt_t *os,
apr_pool_t *pool)
{
opt_baton_t *opt_baton = baton;
- return load_revisions(opt_baton->session, opt_baton->url,
+ svn_ra_session_t *aux_session;
+
+ SVN_ERR(svn_client_open_ra_session(&aux_session, opt_baton->url,
+ opt_baton->ctx, pool));
+ return load_revisions(opt_baton->session, aux_session, opt_baton->url,
opt_baton->quiet, pool);
}
@@ -899,15 +905,18 @@ main(int argc, const char **argv)
opt_baton->url = svn_uri_canonicalize(repos_url, pool);
}
- SVNRDUMP_ERR(open_connection(&(opt_baton->session),
- opt_baton->url,
- non_interactive,
- username,
- password,
- config_dir,
- no_auth_cache,
- config_options,
- pool));
+ SVNRDUMP_ERR(init_client_context(&(opt_baton->ctx),
+ non_interactive,
+ username,
+ password,
+ config_dir,
+ no_auth_cache,
+ config_options,
+ pool));
+
+ SVNRDUMP_ERR(svn_client_open_ra_session(&(opt_baton->session),
+ opt_baton->url,
+ opt_baton->ctx, pool));
/* Have sane opt_baton->start_revision and end_revision defaults if
unspecified. */