Log message and patch:
Teach ra_svn to report syntax errors in the .subversion/servers
config file as ra_dav does (thanks to Greg Hudson for help).
* subversion/libsvn_ra_svn/client.c:
(find_tunnel_agent): Return svn_error_t * instead of returning
the const char * output. Now take a const char ** output
parameter. Finally, report errors from svn_config_read_servers.
(ra_svn_open): Adapt to new interface of and report errors from
find_tunnel_agent.
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 4508)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -242,22 +242,19 @@
/* --- RA LAYER IMPLEMENTATION --- */
-static const char *find_tunnel_agent(const char *hostname, apr_pool_t *pool)
+static svn_error_t *find_tunnel_agent(const char *hostname, apr_pool_t *pool,
+ const char **agent)
{
svn_config_t *cfg;
- const char *server_group, *agent = NULL;
- svn_error_t *err;
+ const char *server_group;
+
+ SVN_ERR( svn_config_read_servers(cfg, pool) );
- err = svn_config_read_servers(cfg, pool);
- if (err)
- {
- svn_error_clear(err);
- return NULL;
- }
server_group = svn_config_find_group(cfg, hostname, groups, pool);
if (server_group)
- svn_config_get(cfg, agent, server_group, svn-tunnel-agent, NULL);
- return agent;
+ svn_config_get(cfg, agent, server_group, svn-tunnel-agent, NULL);
+
+ return SVN_NO_ERROR;
}
static svn_boolean_t find_mech(apr_array_header_t *mechlist, const char *mech)
@@ -298,7 +295,7 @@
return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
Illegal svn repository URL %s, url);
- tunnel_agent = find_tunnel_agent(hostname, pool);
+ SVN_ERR( find_tunnel_agent(hostname, pool, tunnel_agent) );
if (tunnel_agent)
{
/* ### It would be nice if tunnel_agent could contain flags. */
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:07:26 2006