You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/01/20 17:03:28 UTC
svn commit: r1061361 - in /subversion/branches/uris-as-urls/subversion:
include/svn_dirent_uri.h libsvn_subr/dirent_uri.c
Author: cmpilato
Date: Thu Jan 20 16:03:28 2011
New Revision: 1061361
URL: http://svn.apache.org/viewvc?rev=1061361&view=rev
Log:
On the 'uris-as-urls' branch, add another helpful API function (which
is really somewhat of a replacement for a similar one recently
removed).
* subversion/include/svn_dirent_uri.h,
* subversion/libsvn_subr/dirent_uri.c
(svn_url_join_relpath): New function.
Modified:
subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h
subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c
Modified: subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h?rev=1061361&r1=1061360&r2=1061361&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h (original)
+++ subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h Thu Jan 20 16:03:28 2011
@@ -197,6 +197,19 @@ svn_relpath_join(const char *base,
const char *component,
apr_pool_t *pool);
+/** Join a base uri (@a base) with a relpath (@a relpath), allocating
+ * the result in @a pool. This function does NOT URI-encode relpath;
+ * it is assumed that the caller has handled this already. (For
+ * another function that does this encoding for you, see
+ * svn_path_url_add_component2().)
+ *
+ * @since New in 1.7.
+ */
+char *
+svn_url_join_relpath(const char *base,
+ const char *relpath,
+ apr_pool_t *pool);
+
/** Gets the name of the specified canonicalized @a dirent as it is known
* within its parent directory. If the @a dirent is root, return "". The
* returned value will not have slashes in it.
Modified: subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c?rev=1061361&r1=1061360&r2=1061361&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c Thu Jan 20 16:03:28 2011
@@ -1214,6 +1214,19 @@ svn_relpath_join(const char *base,
}
char *
+svn_url_join_relpath(const char *base,
+ const char *relpath,
+ apr_pool_t *pool)
+{
+ assert(svn_url_is_canonical(base, pool));
+ assert(relpath_is_canonical(relpath));
+
+ if (SVN_PATH_IS_EMPTY(relpath))
+ return apr_pstrdup(pool, base);
+ return apr_pstrcat(pool, base, "/", relpath, NULL);
+}
+
+char *
svn_dirent_dirname(const char *dirent, apr_pool_t *pool)
{
apr_size_t len = strlen(dirent);