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/24 23:39:44 UTC
svn commit: r1063040 - in
/subversion/branches/uris-as-urls/subversion/mod_dav_svn: authz.c mirror.c
mod_dav_svn.c reports/update.c repos.c version.c
Author: cmpilato
Date: Mon Jan 24 22:39:44 2011
New Revision: 1063040
URL: http://svn.apache.org/viewvc?rev=1063040&view=rev
Log:
On the 'uris-as-urls' branch, review and correct some use of the
svn_uri_* APIs. (One step of many similar ones.)
* subversion/mod_dav_svn/authz.c
(authz_read): Review/correct/rename uses of the svn_uri_* APIs.
* subversion/mod_dav_svn/mirror.c
(dav_svn__location_in_filter, dav_svn__location_body_filter): Same as above.
* subversion/mod_dav_svn/mod_dav_svn.c
(create_dir_config): Same as above.
* subversion/mod_dav_svn/reports/update.c
(make_child_baton): Same as above.
* subversion/mod_dav_svn/version.c
(dav_svn__build_lock_hash): Same as above.
* subversion/mod_dav_svn/repos.c
(get_parent_path): Revert to using svn_path_* APIs for now.
Modified:
subversion/branches/uris-as-urls/subversion/mod_dav_svn/authz.c
subversion/branches/uris-as-urls/subversion/mod_dav_svn/mirror.c
subversion/branches/uris-as-urls/subversion/mod_dav_svn/mod_dav_svn.c
subversion/branches/uris-as-urls/subversion/mod_dav_svn/reports/update.c
subversion/branches/uris-as-urls/subversion/mod_dav_svn/repos.c
subversion/branches/uris-as-urls/subversion/mod_dav_svn/version.c
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/authz.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/authz.c Mon Jan 24 22:39:44 2011
@@ -28,6 +28,8 @@
#include "svn_dirent_uri.h"
#include "svn_path.h"
+#include "private/svn_fspath.h"
+
#include "mod_authz_svn.h"
#include "dav_svn.h"
@@ -139,20 +141,21 @@ authz_read(svn_boolean_t *allowed,
copied tree. So we start at path and walk up its parents
asking if anyone was copied, and if so where from. */
while (! (svn_path_is_empty(path_s->data)
- || ((path_s->len == 1) && (path_s->data[0] == '/'))))
+ || svn_fspath__is_root(path_s->data, path_s->len)))
{
SVN_ERR(svn_fs_copied_from(&rev, &revpath, root,
path_s->data, pool));
if (SVN_IS_VALID_REVNUM(rev) && revpath)
{
- revpath = svn_path_join(revpath, lopped_path, pool);
+ revpath = svn_fspath__join(revpath, lopped_path, pool);
break;
}
/* Lop off the basename and try again. */
- lopped_path = svn_path_join(svn_uri_basename
- (path_s->data, pool), lopped_path, pool);
+ lopped_path = svn_relpath_join(svn_fspath__basename(path_s->data,
+ pool),
+ lopped_path, pool);
svn_path_remove_component(path_s);
}
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/mirror.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/mirror.c Mon Jan 24 22:39:44 2011
@@ -28,6 +28,8 @@
#include <httpd.h>
#include <http_core.h>
+#include "private/svn_fspath.h"
+
#include "dav_svn.h"
@@ -148,7 +150,7 @@ apr_status_t dav_svn__location_in_filter
apr_uri_parse(r->pool, master_uri, &uri);
root_dir = dav_svn__get_root_dir(r);
if (uri.path)
- canonicalized_uri = svn_uri_canonicalize(uri.path, r->pool);
+ canonicalized_uri = svn_urlpath__canonicalize(uri.path, r->pool);
else
canonicalized_uri = uri.path;
if (strcmp(canonicalized_uri, root_dir) == 0) {
@@ -270,7 +272,7 @@ apr_status_t dav_svn__location_body_filt
apr_uri_parse(r->pool, master_uri, &uri);
root_dir = dav_svn__get_root_dir(r);
if (uri.path)
- canonicalized_uri = svn_uri_canonicalize(uri.path, r->pool);
+ canonicalized_uri = svn_urlpath__canonicalize(uri.path, r->pool);
else
canonicalized_uri = uri.path;
if (strcmp(canonicalized_uri, root_dir) == 0) {
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/mod_dav_svn.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/mod_dav_svn.c Mon Jan 24 22:39:44 2011
@@ -37,6 +37,8 @@
#include "svn_dso.h"
#include "mod_dav_svn.h"
+#include "private/svn_fspath.h"
+
#include "dav_svn.h"
#include "mod_authz_svn.h"
@@ -172,10 +174,10 @@ create_dir_config(apr_pool_t *p, char *d
/* NOTE: dir==NULL creates the default per-dir config */
dir_conf_t *conf = apr_pcalloc(p, sizeof(*conf));
- /*In subversion context dir is always considered to be coming from
- <Location /blah> directive. So we treat it as URI. */
+ /* In subversion context dir is always considered to be coming from
+ <Location /blah> directive. So we treat it as a urlpath. */
if (dir)
- conf->root_dir = svn_uri_canonicalize(dir, p);
+ conf->root_dir = svn_urlpath__canonicalize(dir, p);
conf->bulk_updates = CONF_FLAG_ON;
conf->v2_protocol = CONF_FLAG_ON;
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/reports/update.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/reports/update.c Mon Jan 24 22:39:44 2011
@@ -39,6 +39,7 @@
#include "svn_dav.h"
#include "svn_props.h"
#include "private/svn_log.h"
+#include "private/svn_fspath.h"
#include "../dav_svn.h"
@@ -184,19 +185,19 @@ make_child_baton(item_baton_t *parent, c
baton->parent = parent;
/* Telescope the path based on uc->anchor. */
- baton->path = svn_uri_join(parent->path, baton->name, pool);
+ baton->path = svn_fspath__join(parent->path, baton->name, pool);
/* Telescope the path based on uc->dst_path in the exact same way. */
- baton->path2 = svn_uri_join(parent->path2, baton->name, pool);
+ baton->path2 = svn_fspath__join(parent->path2, baton->name, pool);
/* Telescope the third path: it's relative, not absolute, to
dst_path. Now, we gotta be careful here, because if this
operation had a target, and we're it, then we have to use the
basename of our source reflection instead of our own. */
if ((*baton->uc->target) && (! parent->parent))
- baton->path3 = svn_path_join(parent->path3, baton->uc->target, pool);
+ baton->path3 = svn_relpath_join(parent->path3, baton->uc->target, pool);
else
- baton->path3 = svn_path_join(parent->path3, baton->name, pool);
+ baton->path3 = svn_relpath_join(parent->path3, baton->name, pool);
return baton;
}
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/repos.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/repos.c Mon Jan 24 22:39:44 2011
@@ -49,6 +49,7 @@
#include "svn_ra.h" /* for SVN_RA_CAPABILITY_* */
#include "svn_dirent_uri.h"
#include "private/svn_log.h"
+#include "private/svn_fspath.h"
#include "dav_svn.h"
@@ -1937,7 +1938,7 @@ get_resource(request_rec *r,
{
/* ...then the URL to the repository is actually one implicit
component longer... */
- root_path = svn_uri_join(root_path, repo_basename, r->pool);
+ root_path = svn_urlpath__join(root_path, repo_basename, r->pool);
/* ...and we need to specify exactly what repository to open. */
fs_path = svn_dirent_join(fs_parent_path, repo_basename, r->pool);
}
@@ -2299,11 +2300,11 @@ get_parent_path(const char *path, apr_po
if (len > 0)
{
- /* Remove any trailing slash; else svn_uri_dirname() asserts. */
+ /* Remove any trailing slash; else svn_path_dirname() asserts. */
if (tmp[len-1] == '/')
tmp[len-1] = '\0';
- return svn_uri_dirname(tmp, pool);
+ return svn_path_dirname(tmp, pool);
}
return path;
Modified: subversion/branches/uris-as-urls/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/mod_dav_svn/version.c?rev=1063040&r1=1063039&r2=1063040&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/uris-as-urls/subversion/mod_dav_svn/version.c Mon Jan 24 22:39:44 2011
@@ -40,6 +40,7 @@
#include "private/svn_repos_private.h"
#include "private/svn_dav_protocol.h"
#include "private/svn_log.h"
+#include "private/svn_fspath.h"
#include "dav_svn.h"
@@ -1234,7 +1235,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
return derr;
/* Create an absolute fs-path */
- lockpath = svn_uri_join(path_prefix, cdata, pool);
+ lockpath = svn_fspath__join(path_prefix, cdata, pool);
if (lockpath && locktoken)
{
apr_hash_set(hash, lockpath, APR_HASH_KEY_STRING, locktoken);