On 10/13/07, C. Michael Pilato <cmpilato@collab.net> wrote:
> svn_ra_get_file(session, "/foo") is *not* a legal invocation. The paths
> provided to the RA API are, as the various docstring state, relative to the
> session URL. And that's how all four RA layers treat them. But some of the
> those layers can pass the "relative" path through to the FS directly, while
> others need to construct URLs out of them. And svn_path_join(session-url,
> "/foo") == "/foo", not "session-url/foo".
>
> Your use of the API was broken here, nothing more.
Well sure, there's much more here. I was invoking the API
incorrectly, and ra_local and ra_dav were *still working correctly*.
That's a bug to fix. :-)
I was thinking something like:
Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 27173)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -621,6 +621,11 @@
apr_hash_t **props,
apr_pool_t *pool)
{
+ if (*path == "/")
+ return svn_error_create
+ (SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("svn_ra_get_file was passed an absolute path."));
+
return session->vtable->get_file(session, path, revision, stream,
fetched_rev, props, pool);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 13 17:11:37 2007