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 2011/04/27 00:34:49 UTC
svn commit: r1096934 - in /subversion/trunk/subversion: include/svn_ra.h
libsvn_ra/ra_loader.c
Author: rhuijben
Date: Tue Apr 26 22:34:48 2011
New Revision: 1096934
URL: http://svn.apache.org/viewvc?rev=1096934&view=rev
Log:
Make two relpath calculation apis properly decode their returned
paths.
* subversion/include/svn_ra.h
(svn_ra_get_path_relative_to_session,
svn_ra_get_path_relative_to_root): Update documentation.
* subversion/libsvn_ra/ra_loader.c
(svn_ra_get_path_relative_to_session,
svn_ra_get_path_relative_to_root): Call svn_path_uri_decode on
the path before returning it to the caller.
Modified:
subversion/trunk/subversion/include/svn_ra.h
subversion/trunk/subversion/libsvn_ra/ra_loader.c
Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1096934&r1=1096933&r2=1096934&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Tue Apr 26 22:34:48 2011
@@ -695,6 +695,9 @@ svn_ra_get_session_url(svn_ra_session_t
* is parented, setting @a *rel_path to that value. If @a url is not
* a child of the session URL, return @c SVN_ERR_RA_ILLEGAL_URL.
*
+ * The returned path is uri decoded to allow using it with the ra or other
+ * apis as a valid relpath.
+ *
* @since New in 1.7.
*/
svn_error_t *
@@ -708,6 +711,9 @@ svn_ra_get_path_relative_to_session(svn_
* *rel_path to that value. If @a url is not a child of repository
* root URL, return @c SVN_ERR_RA_ILLEGAL_URL.
*
+ * The returned path is uri decoded to allow using it with the ra or other
+ * apis as a valid relpath.
+ *
* @since New in 1.7.
*/
svn_error_t *
Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1096934&r1=1096933&r2=1096934&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Tue Apr 26 22:34:48 2011
@@ -575,11 +575,13 @@ svn_error_t *svn_ra_get_path_relative_to
}
else
{
- *rel_path = svn_uri_is_child(sess_url, url, pool);
- if (! *rel_path)
+ const char *relpath = svn_uri_is_child(sess_url, url, pool);
+ if (! *relpath)
return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
_("'%s' isn't a child of session URL '%s'"),
url, sess_url);
+
+ *rel_path = svn_path_uri_decode(relpath, pool);
}
return SVN_NO_ERROR;
}
@@ -597,12 +599,14 @@ svn_error_t *svn_ra_get_path_relative_to
}
else
{
- *rel_path = svn_uri_is_child(root_url, url, pool);
- if (! *rel_path)
+ const char *relpath = svn_uri_is_child(root_url, url, pool);
+ if (! *relpath)
return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
_("'%s' isn't a child of repository root "
"URL '%s'"),
url, root_url);
+
+ *rel_path = svn_path_uri_decode(relpath, pool);
}
return SVN_NO_ERROR;