You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/01/28 16:48:57 UTC
svn commit: r1064743 [2/5] - in /subversion/branches/ignore-mergeinfo-log:
./ subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_diff/ subversion/li...
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/add.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/add.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/add.c Fri Jan 28 15:48:53 2011
@@ -681,7 +681,6 @@ add_url_parents(svn_ra_session_t *ra_ses
svn_node_kind_t kind;
const char *parent_url = svn_uri_dirname(url, pool);
-
SVN_ERR(svn_ra_reparent(ra_session, parent_url, temppool));
SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
temppool));
@@ -775,6 +774,7 @@ mkdir_urls(const apr_array_header_t *url
{
const char *bname;
svn_uri_split(&common, &bname, common, pool);
+ bname = svn_path_uri_encode(bname, pool);
for (i = 0; i < targets->nelts; i++)
{
const char *path = APR_ARRAY_IDX(targets, i, const char *);
@@ -804,7 +804,7 @@ mkdir_urls(const apr_array_header_t *url
const char *path = APR_ARRAY_IDX(targets, i, const char *);
item = svn_client_commit_item3_create(pool);
- item->url = svn_uri_join(common, path, pool);
+ item->url = svn_path_url_add_component2(common, path, pool);
item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
}
@@ -828,14 +828,6 @@ mkdir_urls(const apr_array_header_t *url
NULL, NULL, FALSE, TRUE,
ctx, pool));
- /* URI-decode each target. */
- for (i = 0; i < targets->nelts; i++)
- {
- const char *path = APR_ARRAY_IDX(targets, i, const char *);
- path = svn_path_uri_decode(path, pool);
- APR_ARRAY_IDX(targets, i, const char *) = path;
- }
-
/* Fetch RA commit editor */
SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
commit_revprops,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/client.h?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/client.h Fri Jan 28 15:48:53 2011
@@ -860,6 +860,8 @@ int svn_client__sort_commit_item_urls(co
a common *BASE_URL for the items in the array, and rewrite those
items' URLs to be relative to that *BASE_URL.
+ COMMIT_ITEMS is an array of (svn_client_commit_item3_t *) items.
+
Afterwards, some of the items in COMMIT_ITEMS may contain data
allocated in POOL. */
svn_error_t *
@@ -871,7 +873,9 @@ svn_client__condense_commit_items(const
/* Commit the items in the COMMIT_ITEMS array using EDITOR/EDIT_BATON
to describe the committed local mods. Prior to this call,
COMMIT_ITEMS should have been run through (and BASE_URL generated
- by) svn_client__condense_commit_items.
+ by) svn_client__condense_commit_items().
+
+ COMMIT_ITEMS is an array of (svn_client_commit_item3_t *) items.
CTX->NOTIFY_FUNC/CTX->BATON will be called as the commit progresses, as
a way of describing actions to the application layer (if non NULL).
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/commit.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/commit.c Fri Jan 28 15:48:53 2011
@@ -758,8 +758,7 @@ svn_client_import4(const char *path,
svn_error_clear(err);
svn_uri_split(&temp, &dir, url, pool);
- APR_ARRAY_PUSH(new_entries, const char *) =
- svn_path_uri_decode(dir, pool);
+ APR_ARRAY_PUSH(new_entries, const char *) = dir;
url = temp;
}
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/copy.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/copy.c Fri Jan 28 15:48:53 2011
@@ -917,9 +917,7 @@ repos_to_repos_copy(const apr_array_head
svn_uri_dirname(first_pair->dst_abspath_or_url, pool),
pool);
if (dir)
- SVN_ERR(find_absent_parents1(ra_session,
- svn_path_uri_decode(dir, pool),
- new_dirs, pool));
+ SVN_ERR(find_absent_parents1(ra_session, dir, new_dirs, pool));
}
/* If, however, this is *not* a move, TOP_URL only points to the
common ancestor of our destination path(s), or possibly one
@@ -933,7 +931,7 @@ repos_to_repos_copy(const apr_array_head
apr_array_make(pool, 0, sizeof(const char *));
SVN_ERR(find_absent_parents2(ra_session, &top_url, new_urls, pool));
- /* Convert absolute URLs into URLs relative to TOP_URL. */
+ /* Convert absolute URLs into relpaths relative to TOP_URL. */
for (i = 0; i < new_urls->nelts; i++)
{
const char *new_url = APR_ARRAY_IDX(new_urls, i, const char *);
@@ -984,7 +982,6 @@ repos_to_repos_copy(const apr_array_head
src_rel = svn_uri_is_child(top_url, pair->src_abspath_or_url, pool);
if (src_rel)
{
- src_rel = svn_path_uri_decode(src_rel, pool);
SVN_ERR(svn_ra_check_path(ra_session, src_rel, pair->src_revnum,
&info->src_kind, pool));
}
@@ -1016,9 +1013,7 @@ repos_to_repos_copy(const apr_array_head
/* Figure out the basename that will result from this operation,
and ensure that we aren't trying to overwrite existing paths. */
dst_rel = svn_uri_is_child(top_url, pair->dst_abspath_or_url, pool);
- if (dst_rel)
- dst_rel = svn_path_uri_decode(dst_rel, pool);
- else
+ if (! dst_rel)
dst_rel = "";
SVN_ERR(svn_ra_check_path(ra_session, dst_rel, youngest,
&dst_kind, pool));
@@ -1030,8 +1025,7 @@ repos_to_repos_copy(const apr_array_head
info->src_path = src_rel;
info->dst_path = dst_rel;
- apr_hash_set(action_hash, info->dst_path, APR_HASH_KEY_STRING,
- info);
+ apr_hash_set(action_hash, info->dst_path, APR_HASH_KEY_STRING, info);
if (is_move && (! info->resurrection))
apr_hash_set(action_hash, info->src_path, APR_HASH_KEY_STRING, info);
}
@@ -1050,10 +1044,10 @@ repos_to_repos_copy(const apr_array_head
{
for (i = 0; i < new_dirs->nelts; i++)
{
- const char *url = APR_ARRAY_IDX(new_dirs, i, const char *);
+ const char *relpath = APR_ARRAY_IDX(new_dirs, i, const char *);
item = svn_client_commit_item3_create(pool);
- item->url = svn_uri_join(top_url, url, pool);
+ item->url = svn_path_url_add_component2(top_url, relpath, pool);
item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
}
@@ -1065,14 +1059,14 @@ repos_to_repos_copy(const apr_array_head
path_driver_info_t *);
item = svn_client_commit_item3_create(pool);
- item->url = svn_uri_join(top_url, info->dst_path, pool);
+ item->url = svn_path_url_add_component2(top_url, info->dst_path, pool);
item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
if (is_move && (! info->resurrection))
{
item = apr_pcalloc(pool, sizeof(*item));
- item->url = svn_uri_join(top_url, info->src_path, pool);
+ item->url = svn_path_url_add_component2(top_url, info->src_path, pool);
item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
}
@@ -1092,14 +1086,14 @@ repos_to_repos_copy(const apr_array_head
{
for (i = 0; i < new_dirs->nelts; i++)
{
- const char *url = APR_ARRAY_IDX(new_dirs, i, const char *);
+ const char *relpath = APR_ARRAY_IDX(new_dirs, i, const char *);
path_driver_info_t *info = apr_pcalloc(pool, sizeof(*info));
- info->dst_path = url;
+ info->dst_path = relpath;
info->dir_add = TRUE;
- APR_ARRAY_PUSH(paths, const char *) = url;
- apr_hash_set(action_hash, url, APR_HASH_KEY_STRING, info);
+ APR_ARRAY_PUSH(paths, const char *) = relpath;
+ apr_hash_set(action_hash, relpath, APR_HASH_KEY_STRING, info);
}
}
@@ -1240,10 +1234,9 @@ wc_to_repos_copy(const apr_array_header_
APR_ARRAY_IDX(copy_pairs, i, svn_client__copy_pair_t *);
svn_pool_clear(iterpool);
- dst_rel = svn_path_uri_decode(svn_uri_is_child(top_dst_url,
- pair->dst_abspath_or_url,
- iterpool),
- iterpool);
+ dst_rel = svn_uri_is_child(top_dst_url,
+ pair->dst_abspath_or_url,
+ iterpool);
SVN_ERR(svn_ra_check_path(ra_session, dst_rel, SVN_INVALID_REVNUM,
&dst_kind, iterpool));
if (dst_kind != svn_node_none)
@@ -1970,9 +1963,6 @@ try_copy(const apr_array_header_t *sourc
TRUE,
iterpool));
- if (srcs_are_urls && ! dst_is_url)
- src_basename = svn_path_uri_decode(src_basename, iterpool);
-
/* Check to see if all the sources are urls or all working copy
* paths. */
if (src_is_url != srcs_are_urls)
@@ -1981,8 +1971,8 @@ try_copy(const apr_array_header_t *sourc
_("Cannot mix repository and working copy sources"));
if (dst_is_url)
- pair->dst_abspath_or_url = svn_uri_join(dst_path_in,
- src_basename, pool);
+ pair->dst_abspath_or_url =
+ svn_path_url_add_component2(dst_path_in, src_basename, pool);
else
pair->dst_abspath_or_url = svn_dirent_join(dst_path_in,
src_basename, pool);
@@ -2266,20 +2256,19 @@ svn_client_copy6(const apr_array_header_
const char *src_path = APR_ARRAY_IDX(sources, 0,
svn_client_copy_source_t *)->path;
const char *src_basename;
- svn_boolean_t src_is_uri = svn_path_is_url(src_path);
- svn_boolean_t dst_is_uri = svn_path_is_url(dst_path);
+ svn_boolean_t src_is_url = svn_path_is_url(src_path);
+ svn_boolean_t dst_is_url = svn_path_is_url(dst_path);
svn_error_clear(err);
svn_pool_clear(subpool);
- src_basename = src_is_uri ? svn_uri_basename(src_path, subpool)
+ src_basename = src_is_url ? svn_uri_basename(src_path, subpool)
: svn_dirent_basename(src_path, subpool);
- if (svn_path_is_url(src_path) && ! svn_path_is_url(dst_path))
- src_basename = svn_path_uri_decode(src_basename, subpool);
err = try_copy(sources,
- dst_is_uri
- ? svn_uri_join(dst_path, src_basename, subpool)
+ dst_is_url
+ ? svn_path_url_add_component2(dst_path, src_basename,
+ subpool)
: svn_dirent_join(dst_path, src_basename, subpool),
FALSE /* is_move */,
make_parents,
@@ -2348,18 +2337,19 @@ svn_client_move6(const apr_array_header_
{
const char *src_path = APR_ARRAY_IDX(src_paths, 0, const char *);
const char *src_basename;
- svn_boolean_t src_is_uri = svn_path_is_url(src_path);
- svn_boolean_t dst_is_uri = svn_path_is_url(dst_path);
+ svn_boolean_t src_is_url = svn_path_is_url(src_path);
+ svn_boolean_t dst_is_url = svn_path_is_url(dst_path);
svn_error_clear(err);
svn_pool_clear(subpool);
- src_basename = src_is_uri ? svn_uri_basename(src_path, pool)
+ src_basename = src_is_url ? svn_uri_basename(src_path, pool)
: svn_dirent_basename(src_path, pool);
err = try_copy(sources,
- dst_is_uri
- ? svn_uri_join(dst_path, src_basename, pool)
+ dst_is_url
+ ? svn_path_url_add_component2(dst_path,
+ src_basename, pool)
: svn_dirent_join(dst_path, src_basename, pool),
TRUE /* is_move */,
make_parents,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/delete.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/delete.c Fri Jan 28 15:48:53 2011
@@ -176,10 +176,10 @@ delete_urls(const apr_array_header_t *pa
for (i = 0; i < targets->nelts; i++)
{
- const char *path = APR_ARRAY_IDX(targets, i, const char *);
+ const char *relpath = APR_ARRAY_IDX(targets, i, const char *);
item = svn_client_commit_item3_create(pool);
- item->url = svn_uri_join(common, path, pool);
+ item->url = svn_path_url_add_component2(common, relpath, pool);
item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE;
APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
}
@@ -199,17 +199,14 @@ delete_urls(const apr_array_header_t *pa
/* Verify that each thing to be deleted actually exists (to prevent
the creation of a revision that has no changes, since the
- filesystem allows for no-op deletes). While here, we'll
- URI-decode our targets. */
+ filesystem allows for no-op deletes). */
for (i = 0; i < targets->nelts; i++)
{
- const char *path = APR_ARRAY_IDX(targets, i, const char *);
+ const char *relpath = APR_ARRAY_IDX(targets, i, const char *);
const char *item_url;
svn_pool_clear(subpool);
- item_url = svn_uri_join(common, path, subpool);
- path = svn_path_uri_decode(path, pool);
- APR_ARRAY_IDX(targets, i, const char *) = path;
+ item_url = svn_path_url_add_component2(common, relpath, subpool);
/* If we've not yet done so, open an RA session for the
URL. Note that we don't have a local directory, nor a place
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/diff.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/diff.c Fri Jan 28 15:48:53 2011
@@ -1533,9 +1533,7 @@ diff_prepare_repos_repos(const char **ur
if ((kind1 == svn_node_file) || (kind2 == svn_node_file))
{
svn_uri_split(anchor1, target1, *url1, pool);
- *target1 = svn_path_uri_decode(*target1, pool);
svn_uri_split(anchor2, target2, *url2, pool);
- *target2 = svn_path_uri_decode(*target2, pool);
if (*base_path)
*base_path = svn_dirent_dirname(*base_path, pool);
SVN_ERR(svn_ra_reparent(*ra_session, *anchor1, pool));
@@ -1830,11 +1828,13 @@ diff_repos_wc(const char *path1,
if (!reverse)
{
callback_baton->orig_path_1 = url1;
- callback_baton->orig_path_2 = svn_uri_join(anchor_url, target, pool);
+ callback_baton->orig_path_2 =
+ svn_path_url_add_component2(anchor_url, target, pool);
}
else
{
- callback_baton->orig_path_1 = svn_uri_join(anchor_url, target, pool);
+ callback_baton->orig_path_1 =
+ svn_path_url_add_component2(anchor_url, target, pool);
callback_baton->orig_path_2 = url1;
}
}
@@ -1876,7 +1876,7 @@ diff_repos_wc(const char *path1,
SVN_ERR(svn_ra_do_diff3(ra_session,
&reporter, &reporter_baton,
rev,
- target ? svn_path_uri_decode(target, pool) : NULL,
+ target,
depth,
ignore_ancestry,
TRUE, /* text_deltas */
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/export.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/export.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/export.c Fri Jan 28 15:48:53 2011
@@ -110,16 +110,15 @@ append_basename_if_dir(const char **appe
SVN_ERR(svn_io_check_resolved_path(*appendable_dirent_p, &local_kind, pool));
if (local_kind == svn_node_dir)
{
- const char *basename2; /* _2 because it shadows basename() */
+ const char *base_name;
if (is_uri)
- basename2 = svn_path_uri_decode(svn_uri_basename(basename_of, NULL), pool);
+ base_name = svn_uri_basename(basename_of, pool);
else
- basename2 = svn_dirent_basename(basename_of, NULL);
+ base_name = svn_dirent_basename(basename_of, NULL);
*appendable_dirent_p = svn_dirent_join(*appendable_dirent_p,
- basename2,
- pool);
+ base_name, pool);
}
return SVN_NO_ERROR;
@@ -984,6 +983,7 @@ svn_client_export5(svn_revnum_t *result_
{
svn_revnum_t edit_revision = SVN_INVALID_REVNUM;
const char *url;
+ svn_boolean_t from_is_url = svn_path_is_url(from_path_or_url);
SVN_ERR_ASSERT(peg_revision != NULL);
SVN_ERR_ASSERT(revision != NULL);
@@ -996,8 +996,7 @@ svn_client_export5(svn_revnum_t *result_
from_path_or_url);
revision = svn_cl__rev_default_to_peg(revision, peg_revision);
- if (svn_path_is_url(from_path_or_url) ||
- ! SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(revision->kind))
+ if (from_is_url || ! SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(revision->kind))
{
svn_revnum_t revnum;
svn_ra_session_t *ra_session;
@@ -1036,14 +1035,16 @@ svn_client_export5(svn_revnum_t *result_
if (svn_path_is_empty(to_path))
{
- to_path = svn_path_uri_decode(svn_uri_basename(from_path_or_url,
- NULL), pool);
+ if (from_is_url)
+ to_path = svn_uri_basename(from_path_or_url, pool);
+ else
+ to_path = svn_dirent_basename(from_path_or_url, NULL);
eb->root_path = to_path;
}
else
{
SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url,
- TRUE, pool));
+ from_is_url, pool));
eb->root_path = to_path;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/externals.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/externals.c Fri Jan 28 15:48:53 2011
@@ -565,23 +565,35 @@ resolve_relative_external_url(svn_wc_ext
apr_pool_t *pool)
{
const char *url = item->url;
- apr_uri_t parent_dir_parsed_uri;
+ apr_uri_t parent_dir_uri;
apr_status_t status;
- if ((url[0] == '/') && (url[1] == '/'))
+ /* If the URL is already absolute, there is nothing to do. */
+ if (svn_path_is_url(url))
{
- /* "//schema-relative" and in some cases "///schema-relative".
- This last format is supported on file:// schema relative. */
- url = apr_pstrcat(
- pool,
- url[2] == '/' ? "///" : "//",
- svn_relpath_canonicalize(url+2, pool),
- (char *)NULL);
+ /* "http://server/path" */
+ item->url = svn_uri_canonicalize(url, pool);
+ return SVN_NO_ERROR;
}
- else if (svn_path_is_url(url) || *url == '/')
+
+ if (url[0] == '/')
{
- /* "http://server/path" and "/path" */
- url = svn_uri_canonicalize(url, pool);
+ /* "/path", "//path", and "///path" */
+ int num_leading_slashes = 1;
+ if (url[1] == '/')
+ {
+ num_leading_slashes++;
+ if (url[2] == '/')
+ num_leading_slashes++;
+ }
+
+ /* "//schema-relative" and in some cases "///schema-relative".
+ This last format is supported on file:// schema relative. */
+ url = apr_pstrcat(pool,
+ apr_pstrndup(pool, url, num_leading_slashes),
+ svn_relpath_canonicalize(url + num_leading_slashes,
+ pool),
+ NULL);
}
else
{
@@ -589,15 +601,8 @@ resolve_relative_external_url(svn_wc_ext
url = svn_relpath_canonicalize(url, pool);
}
- /* If the URL is already absolute, there is nothing to do. */
- if (svn_path_is_url(url))
- {
- item->url = url;
- return SVN_NO_ERROR;
- }
-
/* Parse the parent directory URL into its parts. */
- status = apr_uri_parse(pool, parent_dir_url, &parent_dir_parsed_uri);
+ status = apr_uri_parse(pool, parent_dir_url, &parent_dir_uri);
if (status)
return svn_error_createf(SVN_ERR_BAD_URL, 0,
_("Illegal parent directory URL '%s'"),
@@ -606,8 +611,10 @@ resolve_relative_external_url(svn_wc_ext
/* If the parent directory URL is at the server root, then the URL
may have no / after the hostname so apr_uri_parse() will leave
the URL's path as NULL. */
- if (! parent_dir_parsed_uri.path)
- parent_dir_parsed_uri.path = apr_pstrmemdup(pool, "/", 1);
+ if (! parent_dir_uri.path)
+ parent_dir_uri.path = apr_pstrmemdup(pool, "/", 1);
+ parent_dir_uri.query = NULL;
+ parent_dir_uri.fragment = NULL;
/* Handle URLs relative to the current directory or to the
repository root. The backpaths may only remove path elements,
@@ -625,15 +632,14 @@ resolve_relative_external_url(svn_wc_ext
repository root's URL path into components. */
if (0 == strncmp("../", url, 3))
{
- base_components = svn_path_decompose(parent_dir_parsed_uri.path,
- pool);
+ base_components = svn_path_decompose(parent_dir_uri.path, pool);
relative_components = svn_path_decompose(url, pool);
}
else
{
- apr_uri_t repos_root_parsed_uri;
+ apr_uri_t repos_root_uri;
- status = apr_uri_parse(pool, repos_root_url, &repos_root_parsed_uri);
+ status = apr_uri_parse(pool, repos_root_url, &repos_root_uri);
if (status)
return svn_error_createf(SVN_ERR_BAD_URL, 0,
_("Illegal repository root URL '%s'"),
@@ -642,10 +648,10 @@ resolve_relative_external_url(svn_wc_ext
/* If the repository root URL is at the server root, then
the URL may have no / after the hostname so
apr_uri_parse() will leave the URL's path as NULL. */
- if (! repos_root_parsed_uri.path)
- repos_root_parsed_uri.path = apr_pstrmemdup(pool, "/", 1);
+ if (! repos_root_uri.path)
+ repos_root_uri.path = apr_pstrmemdup(pool, "/", 1);
- base_components = svn_path_decompose(repos_root_parsed_uri.path,
+ base_components = svn_path_decompose(repos_root_uri.path,
pool);
relative_components = svn_path_decompose(url + 2, pool);
}
@@ -668,13 +674,9 @@ resolve_relative_external_url(svn_wc_ext
APR_ARRAY_PUSH(base_components, const char *) = component;
}
- parent_dir_parsed_uri.path = (char *)svn_path_compose(base_components,
- pool);
- parent_dir_parsed_uri.query = NULL;
- parent_dir_parsed_uri.fragment = NULL;
-
- item->url = apr_uri_unparse(pool, &parent_dir_parsed_uri, 0);
-
+ parent_dir_uri.path = (char *)svn_path_compose(base_components, pool);
+ item->url = svn_uri_canonicalize(apr_uri_unparse(pool, &parent_dir_uri,
+ 0), pool);
return SVN_NO_ERROR;
}
@@ -687,26 +689,24 @@ resolve_relative_external_url(svn_wc_ext
"backpaths, i.e. '..'"),
item->url);
- /* Relative to the scheme. */
+ /* Relative to the scheme: Build a new URL from the parts we know. */
if (0 == strncmp("//", url, 2))
{
const char *scheme;
SVN_ERR(uri_scheme(&scheme, repos_root_url, pool));
- item->url = svn_uri_canonicalize(apr_pstrcat(pool,
- scheme,
- ":",
- url,
- (char *)NULL),
- pool);
+ item->url = svn_uri_canonicalize(apr_pstrcat(pool, scheme, ":",
+ url, NULL), pool);
return SVN_NO_ERROR;
}
- /* Relative to the server root. */
+ /* Relative to the server root: Just replace the path portion of the
+ parent's URL. */
if (url[0] == '/')
{
- item->url = svn_uri_join(parent_dir_url, url, pool);
-
+ parent_dir_uri.path = (char *)url;
+ item->url = svn_uri_canonicalize(apr_uri_unparse(pool, &parent_dir_uri,
+ 0), pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/info.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/info.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/info.c Fri Jan 28 15:48:53 2011
@@ -34,6 +34,7 @@
#include "svn_wc.h"
#include "svn_private_config.h"
+#include "private/svn_fspath.h"
#include "private/svn_wc_private.h"
@@ -289,11 +290,9 @@ push_dir_info(svn_ra_session_t *ra_sessi
SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
path = svn_relpath_join(dir, name, subpool);
- URL = svn_path_url_add_component2(session_URL, name, subpool);
-
- fs_path = svn_uri_is_child(repos_root, URL, subpool);
- fs_path = apr_pstrcat(subpool, "/", fs_path, (char *)NULL);
- fs_path = svn_path_uri_decode(fs_path, subpool);
+ URL = svn_path_url_add_component2(session_URL, name, subpool);
+ fs_path = svn_fspath__canonicalize(svn_uri_is_child(repos_root, URL,
+ subpool), subpool);
lock = apr_hash_get(locks, fs_path, APR_HASH_KEY_STRING);
@@ -537,7 +536,6 @@ svn_client_info3(const char *abspath_or_
SVN_ERR(svn_ra_get_uuid2(ra_session, &repos_UUID, pool));
svn_uri_split(&parent_url, &base_name, url, pool);
- base_name = svn_path_uri_decode(base_name, pool);
/* Get the dirent for the URL itself. */
err = svn_ra_stat(ra_session, "", rev, &the_ent, pool);
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/list.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/list.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/list.c Fri Jan 28 15:48:53 2011
@@ -182,11 +182,6 @@ svn_client_list2(const char *path_or_url
doesn't support svn_ra_reparent anyway, so don't try it. */
svn_uri_split(&parent_url, &base_name, url, pool);
- /* 'base_name' is now the last component of an URL, but we want
- to use it as a plain file name. Therefore, we must URI-decode
- it. */
- base_name = svn_path_uri_decode(base_name, pool);
-
SVN_ERR(svn_client__open_ra_session_internal(&parent_session,
NULL, parent_url,
NULL, NULL, FALSE,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/locking_commands.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/locking_commands.c Fri Jan 28 15:48:53 2011
@@ -138,6 +138,58 @@ store_locks_callback(void *baton,
}
+/* This is a wrapper around svn_uri_condense_targets() and
+ * svn_dirent_condense_targets() (the choice of which is made based on
+ * the value of TARGETS_ARE_URIS) which takes care of the
+ * single-target special case.
+ *
+ * Callers are expected to check for an empty *COMMON_PARENT (which
+ * means, "there was nothing common") for themselves.
+ */
+static svn_error_t *
+condense_targets(const char **common_parent,
+ apr_array_header_t **target_relpaths,
+ const apr_array_header_t *targets,
+ svn_boolean_t targets_are_uris,
+ svn_boolean_t remove_redundancies,
+ apr_pool_t *scratch_pool,
+ apr_pool_t *result_pool)
+{
+ if (targets_are_uris)
+ {
+ SVN_ERR(svn_uri_condense_targets(common_parent, target_relpaths,
+ targets, remove_redundancies,
+ result_pool, scratch_pool));
+ }
+ else
+ {
+ SVN_ERR(svn_dirent_condense_targets(common_parent, target_relpaths,
+ targets, remove_redundancies,
+ result_pool, scratch_pool));
+ }
+
+ /* svn_*_condense_targets leaves *TARGET_RELPATHS empty if TARGETS only
+ had 1 member, so we special case that. */
+ if (apr_is_empty_array(*target_relpaths))
+ {
+ const char *base_name;
+
+ if (targets_are_uris)
+ {
+ svn_uri_split(common_parent, &base_name,
+ *common_parent, result_pool);
+ }
+ else
+ {
+ svn_dirent_split(common_parent, &base_name,
+ *common_parent, result_pool);
+ }
+ APR_ARRAY_PUSH(*target_relpaths, const char *) = base_name;
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* Set *COMMON_PARENT_URL to the nearest common parent URL of all TARGETS.
* If TARGETS are local paths, then the entry for each path is examined
* and *COMMON_PARENT is set to the common parent URL for all the
@@ -178,133 +230,114 @@ organize_lock_targets(const char **commo
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- int i;
- apr_array_header_t *rel_targets = apr_array_make(result_pool, 1,
- sizeof(const char *));
+ const char *common_url = NULL;
+ const char *common_dirent = NULL;
apr_hash_t *rel_targets_ret = apr_hash_make(result_pool);
+ apr_hash_t *rel_fs_paths = NULL;
+ apr_array_header_t *rel_targets;
svn_boolean_t url_mode;
+ int i;
+ SVN_ERR_ASSERT(targets->nelts);
SVN_ERR(svn_client__assert_homogeneous_target_type(targets));
- url_mode = ((targets->nelts >= 1) &&
- svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *)));
+ url_mode = svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *));
- /* Get the common parent and all paths */
if (url_mode)
- SVN_ERR(svn_uri_condense_targets(common_parent_url, &rel_targets,
- targets, TRUE, result_pool,
- scratch_pool));
- else
- SVN_ERR(svn_dirent_condense_targets(common_parent_url, &rel_targets,
- targets, TRUE, result_pool,
- scratch_pool));
-
- /* svn_uri_condense_targets and svn_dirent_condense_targets leaves
- URLs/paths empty if TARGETS only had 1 member, so we special case
- that. */
- if (apr_is_empty_array(rel_targets))
{
- const char *parent, *base;
- if (url_mode)
- svn_uri_split(&parent, &base, *common_parent_url, result_pool);
- else
- svn_dirent_split(&parent, &base, *common_parent_url, result_pool);
-
- *common_parent_url = parent;
- APR_ARRAY_PUSH(rel_targets, const char *) = base;
- }
+ svn_revnum_t *invalid_revnum =
+ apr_palloc(result_pool, sizeof(*invalid_revnum));
- if (*common_parent_url == NULL || (*common_parent_url)[0] == '\0')
- return svn_error_create
- (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("No common parent found, unable to operate on disjoint arguments"));
-
- if (url_mode)
- {
- svn_revnum_t *invalid_revnum;
- invalid_revnum = apr_palloc(result_pool, sizeof(*invalid_revnum));
*invalid_revnum = SVN_INVALID_REVNUM;
- *base_dir = NULL;
+ /* Get the common parent URL and a bunch of relpaths, one per target. */
+ SVN_ERR(condense_targets(&common_url, &rel_targets, targets,
+ TRUE, TRUE, scratch_pool, result_pool));
+ if (! (common_url && *common_url))
+ return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("No common parent found, unable to operate "
+ "on disjoint arguments"));
+
+ /* Create mapping of the target relpaths to either
+ SVN_INVALID_REVNUM (if our caller is locking) or to an empty
+ lock token string (if the caller is unlocking). */
for (i = 0; i < rel_targets->nelts; i++)
{
- const char *target = APR_ARRAY_IDX(rel_targets, i, const char *);
apr_hash_set(rel_targets_ret,
- svn_path_uri_decode(target, result_pool),
+ APR_ARRAY_IDX(rel_targets, i, const char *),
APR_HASH_KEY_STRING,
- do_lock ? (const void *) invalid_revnum
- : (const void *) "");
+ do_lock ? (const void *)invalid_revnum
+ : (const void *)"");
}
- *rel_fs_paths_p = NULL;
}
- else /* common parent is a local path */
+ else
{
- apr_array_header_t *rel_urls;
- apr_array_header_t *urls = apr_array_make(scratch_pool, 1,
- sizeof(const char *));
- apr_hash_t *urls_hash = apr_hash_make(scratch_pool);
+ apr_array_header_t *rel_urls, *target_urls;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- const char *common_url;
-
- *base_dir = *common_parent_url;
-
- /* Get the url for each target and verify all paths. */
+
+ /* Get the common parent dirent and a bunch of relpaths, one per
+ target. */
+ SVN_ERR(condense_targets(&common_dirent, &rel_targets, targets,
+ FALSE, TRUE, scratch_pool, result_pool));
+ if (! (common_dirent && *common_dirent))
+ return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("No common parent found, unable to operate "
+ "on disjoint arguments"));
+
+ /* Get the URL for each target (which also serves to verify that
+ the dirent targets are sane). */
+ target_urls = apr_array_make(scratch_pool, rel_targets->nelts,
+ sizeof(const char *));
for (i = 0; i < rel_targets->nelts; i++)
{
- const char *target = APR_ARRAY_IDX(rel_targets, i, const char *);
- const char *local_abspath;
- const char *url;
+ const char *rel_target, *local_abspath, *target_url;
svn_pool_clear(iterpool);
- local_abspath = svn_dirent_join(*common_parent_url, target, iterpool);
-
- SVN_ERR(svn_wc__node_get_url(&url, ctx->wc_ctx, local_abspath,
+ rel_target = APR_ARRAY_IDX(rel_targets, i, const char *);
+ local_abspath = svn_dirent_join(common_dirent, rel_target, iterpool);
+ SVN_ERR(svn_wc__node_get_url(&target_url, ctx->wc_ctx, local_abspath,
scratch_pool, iterpool));
-
- if (! url)
+ if (! target_url)
return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
_("'%s' has no URL"),
- svn_dirent_local_style(target, iterpool));
+ svn_dirent_local_style(local_abspath,
+ iterpool));
- APR_ARRAY_PUSH(urls, const char *) = url;
+ APR_ARRAY_PUSH(target_urls, const char *) = target_url;
}
- /* Condense our absolute urls and get the relative urls. */
- SVN_ERR(svn_uri_condense_targets(&common_url, &rel_urls, urls,
- FALSE, result_pool, scratch_pool));
-
- /* svn_uri_condense_targets leaves URLs empty if TARGETS only
- had 1 member, so we special case that (again). */
- if (apr_is_empty_array(rel_urls))
- {
- const char *base_name = svn_uri_basename(common_url, scratch_pool);
- common_url = svn_uri_dirname(common_url, result_pool);
- APR_ARRAY_PUSH(rel_urls, const char *) = base_name;
- }
-
- /* If we have no common URL parent, bail (cross-repos lock attempt) */
- if (common_url == NULL || (common_url)[0] == '\0')
- return svn_error_create
- (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Unable to lock/unlock across multiple repositories"));
+ /* Now that we have a bunch of URLs for our dirent targets,
+ condense those into a single common parent URL and a bunch of
+ paths relative to that. */
+ SVN_ERR(condense_targets(&common_url, &rel_urls, target_urls,
+ TRUE, FALSE, scratch_pool, result_pool));
+ if (! (common_url && *common_url))
+ return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("Unable to lock/unlock across multiple "
+ "repositories"));
- /* Now that we've got the relative URLs, gather our targets and
- store the mapping between relative repository path and WC path. */
+ /* Now we need to create a couple of different hash mappings. */
+ rel_fs_paths = apr_hash_make(result_pool);
for (i = 0; i < rel_targets->nelts; i++)
{
- const char *target = APR_ARRAY_IDX(rel_targets, i, const char *);
- const char *url = APR_ARRAY_IDX(rel_urls, i, const char *);
- const char *abs_path;
- const char *decoded_url = svn_path_uri_decode(url, scratch_pool);
+ const char *rel_target, *rel_url, *abs_path;
svn_pool_clear(iterpool);
- apr_hash_set(urls_hash, decoded_url,
- APR_HASH_KEY_STRING,
- apr_pstrdup(scratch_pool, target));
-
- abs_path = svn_dirent_join(*common_parent_url, target, iterpool);
+ /* First, we need to map our REL_URL (which is relative to
+ COMMON_URL) to our REL_TARGET (which is relative to
+ COMMON_DIRENT). */
+ rel_target = APR_ARRAY_IDX(rel_targets, i, const char *);
+ rel_url = APR_ARRAY_IDX(rel_urls, i, const char *);
+ apr_hash_set(rel_fs_paths, rel_url, APR_HASH_KEY_STRING,
+ apr_pstrdup(result_pool, rel_target));
+
+ /* Then, we map our REL_URL (again) to either the base
+ revision of the dirent target with which it is associated
+ (if our caller is locking) or to a (possible empty) lock
+ token string (if the caller is unlocking). */
+ abs_path = svn_dirent_join(common_dirent, rel_target, iterpool);
if (do_lock) /* Lock. */
{
@@ -312,44 +345,42 @@ organize_lock_targets(const char **commo
revnum = apr_palloc(result_pool, sizeof(* revnum));
SVN_ERR(svn_wc__node_get_base_rev(revnum, ctx->wc_ctx,
abs_path, result_pool));
- apr_hash_set(rel_targets_ret, decoded_url,
+ apr_hash_set(rel_targets_ret, rel_url,
APR_HASH_KEY_STRING, revnum);
}
else /* Unlock. */
{
- /* If not force, get the lock token. */
+ const char *lock_token = NULL;
+
+ /* If not forcing the unlock, get the lock token. */
if (! force)
{
- const char *lock_token;
-
SVN_ERR(svn_wc__node_get_lock_info(&lock_token, NULL, NULL,
NULL, ctx->wc_ctx,
abs_path, result_pool,
iterpool));
if (! lock_token)
- return svn_error_createf
- (SVN_ERR_CLIENT_MISSING_LOCK_TOKEN, NULL,
- _("'%s' is not locked in this working copy"), target);
-
- apr_hash_set(rel_targets_ret, decoded_url,
- APR_HASH_KEY_STRING,
- lock_token);
- }
- else
- {
- /* If breaking a lock, we shouldn't pass any lock token. */
- apr_hash_set(rel_targets_ret, decoded_url,
- APR_HASH_KEY_STRING, "");
+ return svn_error_createf(
+ SVN_ERR_CLIENT_MISSING_LOCK_TOKEN, NULL,
+ _("'%s' is not locked in this working copy"),
+ abs_path);
}
+
+ /* If breaking a lock, we shouldn't pass any lock token. */
+ apr_hash_set(rel_targets_ret, rel_url, APR_HASH_KEY_STRING,
+ lock_token ? lock_token : "");
}
}
- *rel_fs_paths_p = urls_hash;
- *common_parent_url = common_url;
svn_pool_destroy(iterpool);
}
+ /* Set our return variables. */
+ *common_parent_url = common_url;
+ *base_dir = common_dirent;
*rel_targets_p = rel_targets_ret;
+ *rel_fs_paths_p = rel_fs_paths;
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/mergeinfo.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/mergeinfo.c Fri Jan 28 15:48:53 2011
@@ -1668,11 +1668,9 @@ svn_client_mergeinfo_get_merged(apr_hash
{
const char *key = svn__apr_hash_index_key(hi);
void *val = svn__apr_hash_index_val(hi);
- const char *source_url;
-
- source_url = svn_path_uri_encode(key, pool);
- source_url = svn_uri_join(repos_root, source_url + 1, pool);
- apr_hash_set(full_path_mergeinfo, source_url,
+
+ apr_hash_set(full_path_mergeinfo,
+ svn_path_url_add_component2(repos_root, key + 1, pool),
APR_HASH_KEY_STRING, val);
}
*mergeinfo_p = full_path_mergeinfo;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/patch.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/patch.c Fri Jan 28 15:48:53 2011
@@ -2736,6 +2736,7 @@ svn_client_patch(const char *patch_abspa
apr_pool_t *scratch_pool)
{
apply_patches_baton_t baton;
+ svn_node_kind_t kind;
if (strip_count < 0)
return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
@@ -2745,6 +2746,22 @@ svn_client_patch(const char *patch_abspa
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
_("'%s' is not a local path"), local_abspath);
+ SVN_ERR(svn_io_check_path(patch_abspath, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' does not exist"), patch_abspath);
+ if (kind != svn_node_file)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' is not a file"), patch_abspath);
+
+ SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' does not exist"), local_abspath);
+ if (kind != svn_node_dir)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' is not a directory"), local_abspath);
+
baton.patch_abspath = patch_abspath;
baton.abs_wc_path = local_abspath;
baton.dry_run = dry_run;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/prop_commands.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/prop_commands.c Fri Jan 28 15:48:53 2011
@@ -746,6 +746,9 @@ remote_propget(apr_hash_t *props,
{
apr_hash_t *dirents;
apr_hash_t *prop_hash;
+ const svn_string_t *val;
+ const char *target_full_url =
+ svn_path_url_add_component2(target_prefix, target_relative, work_pool);
if (kind == svn_node_dir)
{
@@ -761,29 +764,22 @@ remote_propget(apr_hash_t *props,
}
else if (kind == svn_node_none)
{
- return svn_error_createf
- (SVN_ERR_ENTRY_NOT_FOUND, NULL,
- _("'%s' does not exist in revision %ld"),
- svn_uri_join(target_prefix, target_relative, work_pool), revnum);
+ return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
+ _("'%s' does not exist in revision %ld"),
+ target_full_url, revnum);
}
else
{
- return svn_error_createf
- (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
- _("Unknown node kind for '%s'"),
- svn_uri_join(target_prefix, target_relative, work_pool));
- }
-
- {
- svn_string_t *val = apr_hash_get(prop_hash, propname,
- APR_HASH_KEY_STRING);
- if (val)
- {
- apr_hash_set(props,
- svn_uri_join(target_prefix, target_relative, perm_pool),
- APR_HASH_KEY_STRING, svn_string_dup(val, perm_pool));
- }
- }
+ return svn_error_createf(SVN_ERR_NODE_UNKNOWN_KIND, NULL,
+ _("Unknown node kind for '%s'"),
+ target_full_url);
+ }
+
+ if ((val = apr_hash_get(prop_hash, propname, APR_HASH_KEY_STRING)))
+ {
+ apr_hash_set(props, apr_pstrdup(perm_pool, target_full_url),
+ APR_HASH_KEY_STRING, svn_string_dup(val, perm_pool));
+ }
if (depth >= svn_depth_files
&& kind == svn_node_dir
@@ -1071,6 +1067,8 @@ remote_proplist(const char *target_prefi
apr_hash_t *dirents;
apr_hash_t *prop_hash, *final_hash;
apr_hash_index_t *hi;
+ const char *target_full_url =
+ svn_path_url_add_component2(target_prefix, target_relative, scratchpool);
if (kind == svn_node_dir)
{
@@ -1086,10 +1084,9 @@ remote_proplist(const char *target_prefi
}
else
{
- return svn_error_createf
- (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
- _("Unknown node kind for '%s'"),
- svn_uri_join(target_prefix, target_relative, pool));
+ return svn_error_createf(SVN_ERR_NODE_UNKNOWN_KIND, NULL,
+ _("Unknown node kind for '%s'"),
+ target_full_url);
}
/* Filter out non-regular properties, since the RA layer returns all
@@ -1115,9 +1112,7 @@ remote_proplist(const char *target_prefi
}
}
- call_receiver(svn_uri_join(target_prefix, target_relative, scratchpool),
- final_hash, receiver, receiver_baton,
- pool);
+ call_receiver(target_full_url, final_hash, receiver, receiver_baton, pool);
if (depth > svn_depth_empty
&& (kind == svn_node_dir) && (apr_hash_count(dirents) > 0))
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/ra.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/ra.c Fri Jan 28 15:48:53 2011
@@ -759,20 +759,10 @@ svn_client__repos_locations(const char *
"repository or refers to an unrelated object"),
path_or_url_local_style(path, pool), end_revnum);
- /* Repository paths might be absolute, but we want to treat them as
- relative.
- ### Aren't they always absolute? */
- if (start_path[0] == '/')
- start_path = start_path + 1;
- if (end_path[0] == '/')
- end_path = end_path + 1;
-
/* Set our return variables */
- *start_url = svn_uri_join(repos_url, svn_path_uri_encode(start_path,
- pool), pool);
+ *start_url = svn_path_url_add_component2(repos_url, start_path + 1, pool);
if (end->kind != svn_opt_revision_unspecified)
- *end_url = svn_uri_join(repos_url, svn_path_uri_encode(end_path,
- pool), pool);
+ *end_url = svn_path_url_add_component2(repos_url, end_path + 1, pool);
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/status.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/status.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/status.c Fri Jan 28 15:48:53 2011
@@ -585,6 +585,9 @@ svn_client_status_dup(const svn_client_s
if (status->changelist)
st->changelist = apr_pstrdup(result_pool, status->changelist);
+ if (status->ood_changed_author)
+ st->ood_changed_author = apr_pstrdup(result_pool, status->ood_changed_author);
+
if (status->repos_lock)
st->repos_lock = svn_lock_dup(status->repos_lock, result_pool);
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/switch.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/switch.c Fri Jan 28 15:48:53 2011
@@ -170,11 +170,9 @@ switch_internal(svn_revnum_t *result_rev
/* Disallow a switch operation to change the repository root of the
target. */
if (! svn_uri_is_ancestor(source_root, url))
- return svn_error_createf
- (SVN_ERR_WC_INVALID_SWITCH, NULL,
- _("'%s'\n"
- "is not the same repository as\n"
- "'%s'"), url, source_root);
+ return svn_error_createf(SVN_ERR_WC_INVALID_SWITCH, NULL,
+ _("'%s'\nis not the same repository as\n'%s'"),
+ url, source_root);
SVN_ERR(svn_ra_reparent(ra_session, url, pool));
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/update.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/update.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/update.c Fri Jan 28 15:48:53 2011
@@ -298,7 +298,7 @@ svn_client__update_internal(svn_revnum_t
{
const char *anchor_abspath, *lockroot_abspath;
svn_error_t *err;
- svn_opt_revision_t peg_revision = *((svn_opt_revision_t *)revision);
+ svn_opt_revision_t peg_revision = *revision;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR_ASSERT(! (innerupdate && make_parents));
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/util.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/util.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_client/util.c Fri Jan 28 15:48:53 2011
@@ -36,6 +36,7 @@
#include "private/svn_client_private.h"
#include "private/svn_wc_private.h"
+#include "private/svn_fspath.h"
#include "client.h"
@@ -217,11 +218,10 @@ svn_client__path_relative_to_root(const
"root URL '%s'"),
abspath_or_url, repos_root);
}
- rel_url = svn_path_uri_decode(rel_url, result_pool);
- *rel_path = include_leading_slash
- ? apr_pstrcat(result_pool, "/", rel_url,
- (char *)NULL)
- : rel_url;
+ if (include_leading_slash)
+ *rel_path = svn_fspath__canonicalize(rel_url, result_pool);
+ else
+ *rel_path = apr_pstrdup(result_pool, rel_url);
}
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_diff/token.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_diff/token.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_diff/token.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_diff/token.c Fri Jan 28 15:48:53 2011
@@ -69,10 +69,10 @@ svn_diff__tree_create(svn_diff__tree_t *
static svn_error_t *
-svn_diff__tree_insert_token(svn_diff__node_t **node, svn_diff__tree_t *tree,
- void *diff_baton,
- const svn_diff_fns_t *vtable,
- apr_uint32_t hash, void *token)
+tree_insert_token(svn_diff__node_t **node, svn_diff__tree_t *tree,
+ void *diff_baton,
+ const svn_diff_fns_t *vtable,
+ apr_uint32_t hash, void *token)
{
svn_diff__node_t *new_node;
svn_diff__node_t **node_ref;
@@ -165,9 +165,7 @@ svn_diff__get_tokens(svn_diff__position_
break;
offset++;
- SVN_ERR(svn_diff__tree_insert_token(&node, tree,
- diff_baton, vtable,
- hash, token));
+ SVN_ERR(tree_insert_token(&node, tree, diff_baton, vtable, hash, token));
/* Create a new position */
position = apr_palloc(pool, sizeof(*position));
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/changes-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/changes-table.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/changes-table.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/changes-table.c Fri Jan 28 15:48:53 2011
@@ -39,6 +39,7 @@
#include "changes-table.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
@@ -331,7 +332,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
continue;
/* If we come across a child of our path, remove it. */
- if (svn_uri_is_child(change->path, hashkey, subpool))
+ if (svn_fspath__is_child(change->path, hashkey, subpool))
apr_hash_set(changes, hashkey, klen, NULL);
}
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/locks-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/locks-table.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/locks-table.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_base/bdb/locks-table.c Fri Jan 28 15:48:53 2011
@@ -39,6 +39,7 @@
#include "lock-tokens-table.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
int
@@ -249,8 +250,9 @@ svn_fs_bdb__locks_get(svn_fs_t *fs,
/* As long as the prefix of the returned KEY matches LOOKUP_PATH we
know it is either LOOKUP_PATH or a decendant thereof. */
- if (strcmp(path, "/") != 0)
+ if (!svn_fspath__is_root(path, strlen(path)))
lookup_path = apr_pstrcat(pool, path, "/", (char *)NULL);
+
while ((! db_err)
&& strncmp(lookup_path, key.data, strlen(lookup_path)) == 0)
{
@@ -272,8 +274,8 @@ svn_fs_bdb__locks_get(svn_fs_t *fs,
same set of results. So just see if CHILD_PATH is an
immediate child of PATH. If not, we don't care about
this item. */
- const char *rel_uri = svn_uri_is_child(path, child_path, subpool);
- if (!rel_uri || (svn_path_component_count(rel_uri) != 1))
+ const char *rel_path = svn_fspath__is_child(path, child_path, subpool);
+ if (!rel_path || (svn_path_component_count(rel_path) != 1))
goto loop_it;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/lock.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/lock.c Fri Jan 28 15:48:53 2011
@@ -397,7 +397,7 @@ set_lock(const char *fs_path,
digest_path, perms_reference, subpool));
/* Prep for next iteration, or bail if we're done. */
- if (svn_uri_is_root(this_path->data, this_path->len))
+ if (svn_fspath__is_root(this_path->data, this_path->len))
break;
svn_stringbuf_set(this_path,
svn_fspath__dirname(this_path->data, subpool));
@@ -465,7 +465,7 @@ delete_lock(svn_fs_t *fs,
}
/* Prep for next iteration, or bail if we're done. */
- if (svn_uri_is_root(this_path->data, this_path->len))
+ if (svn_fspath__is_root(this_path->data, this_path->len))
break;
svn_stringbuf_set(this_path,
svn_fspath__dirname(this_path->data, subpool));
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/compat.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/compat.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/compat.c Fri Jan 28 15:48:53 2011
@@ -33,6 +33,7 @@
#include "svn_compat.h"
#include "svn_props.h"
+#include "private/svn_fspath.h"
#include "ra_loader.h"
#include "svn_private_config.h"
@@ -654,8 +655,6 @@ svn_ra__file_revs_from_log(svn_ra_sessio
svn_node_kind_t kind;
const char *repos_url;
const char *session_url;
- const char *tmp;
- char *repos_abs_path;
apr_array_header_t *condensed_targets;
struct fr_log_message_baton lmb;
struct rev *rev;
@@ -673,16 +672,11 @@ svn_ra__file_revs_from_log(svn_ra_sessio
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_url, pool));
SVN_ERR(svn_ra_get_session_url(ra_session, &session_url, pool));
- /* Create the initial path, using the repos_url and session_url */
- tmp = svn_uri_is_child(repos_url, session_url, pool);
- repos_abs_path = apr_palloc(pool, strlen(tmp) + 1);
- repos_abs_path[0] = '/';
- memcpy(repos_abs_path + 1, tmp, strlen(tmp));
-
condensed_targets = apr_array_make(pool, 1, sizeof(const char *));
APR_ARRAY_PUSH(condensed_targets, const char *) = path;
- lmb.path = svn_path_uri_decode(repos_abs_path, pool);
+ lmb.path = svn_fspath__canonicalize(svn_uri_is_child(repos_url, session_url,
+ pool), pool);
lmb.eldest = NULL;
lmb.pool = pool;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/ra_loader.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/ra_loader.c Fri Jan 28 15:48:53 2011
@@ -580,7 +580,6 @@ svn_error_t *svn_ra_get_path_relative_to
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(*rel_path, pool);
}
return SVN_NO_ERROR;
}
@@ -604,7 +603,6 @@ svn_error_t *svn_ra_get_path_relative_to
_("'%s' isn't a child of repository root "
"URL '%s'"),
url, root_url);
- *rel_path = svn_path_uri_decode(*rel_path, pool);
}
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/util.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/util.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra/util.c Fri Jan 28 15:48:53 2011
@@ -38,10 +38,6 @@
#include "svn_private_config.h"
#include "private/svn_ra_private.h"
-/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error
- message referencing PATH_OR_URL, if the "server" pointed to be
- RA_SESSION doesn't support Merge Tracking (e.g. is pre-1.5).
- Perform temporary allocations in POOL. */
svn_error_t *
svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
const char *path_or_url,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c Fri Jan 28 15:48:53 2011
@@ -509,9 +509,8 @@ svn_ra_local__reparent(svn_ra_session_t
/* Update our FS_PATH sess member to point to our new
relative-URL-turned-absolute-filesystem-path. */
- relpath = apr_pstrcat(pool, "/", svn_path_uri_decode(relpath, pool),
- (char *)NULL);
- svn_stringbuf_set(sess->fs_path, relpath);
+ svn_stringbuf_set(sess->fs_path,
+ svn_fspath__canonicalize(relpath, pool));
return SVN_NO_ERROR;
}
@@ -522,9 +521,9 @@ svn_ra_local__get_session_url(svn_ra_ses
apr_pool_t *pool)
{
svn_ra_local__session_baton_t *sess = session->priv;
- *url = svn_uri_join(sess->repos_url,
- svn_path_uri_encode(sess->fs_path->data + 1, pool),
- pool);
+ *url = svn_path_url_add_component2(sess->repos_url,
+ sess->fs_path->data + 1,
+ pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c Fri Jan 28 15:48:53 2011
@@ -945,7 +945,7 @@ svn_error_t *svn_ra_neon__get_dir(svn_ra
svn_dirent_t *entry;
apr_hash_this(hi, &key, NULL, &val);
- childname = key;
+ childname = svn_relpath_canonicalize(key, pool);
resource = val;
/* Skip the effective '.' entry that comes back from
@@ -1052,7 +1052,8 @@ svn_error_t *svn_ra_neon__get_dir(svn_ra
}
apr_hash_set(*dirents,
- svn_path_uri_decode(svn_uri_basename(childname, pool),
+ svn_path_uri_decode(svn_relpath_basename(childname,
+ pool),
pool),
APR_HASH_KEY_STRING, entry);
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/get_locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/get_locks.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/get_locks.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/get_locks.c Fri Jan 28 15:48:53 2011
@@ -44,6 +44,7 @@
#include "svn_time.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
#include "ra_neon.h"
@@ -121,7 +122,7 @@ static const svn_ra_neon__xml_elm_t getl
/* Context for parsing server's response. */
typedef struct get_locks_baton_t {
- const char *path; /* target of the report */
+ const char *path; /* fspath target of the report */
svn_depth_t requested_depth; /* requested depth of the report */
svn_lock_t *current_lock; /* the lock being constructed */
svn_stringbuf_t *cdata_accum; /* a place to accumulate cdata */
@@ -256,9 +257,9 @@ getlocks_end_element(void *userdata, int
else if ((baton->requested_depth == svn_depth_files) ||
(baton->requested_depth == svn_depth_immediates))
{
- const char *rel_uri = svn_uri_is_child(baton->path,
- baton->current_lock->path,
- baton->scratchpool);
+ const char *rel_uri = svn_fspath__is_child(baton->path,
+ baton->current_lock->path,
+ baton->scratchpool);
if (rel_uri && (svn_path_component_count(rel_uri) == 1))
apr_hash_set(baton->lock_hash, baton->current_lock->path,
APR_HASH_KEY_STRING, baton->current_lock);
@@ -268,9 +269,12 @@ getlocks_end_element(void *userdata, int
case ELEM_lock_path:
/* neon has already xml-unescaped the cdata for us. */
- baton->current_lock->path = apr_pstrmemdup(baton->pool,
- baton->cdata_accum->data,
- baton->cdata_accum->len);
+ baton->current_lock->path =
+ svn_fspath__canonicalize(apr_pstrmemdup(baton->scratchpool,
+ baton->cdata_accum->data,
+ baton->cdata_accum->len),
+ baton->pool);
+
/* clean up the accumulator. */
svn_stringbuf_setempty(baton->cdata_accum);
svn_pool_clear(baton->scratchpool);
@@ -379,7 +383,7 @@ svn_ra_neon__get_locks(svn_ra_session_t
url, pool));
baton.lock_hash = apr_hash_make(pool);
- baton.path = apr_pstrcat(pool, "/", rel_path, (char *)NULL);
+ baton.path = svn_fspath__canonicalize(rel_path, pool);
baton.requested_depth = depth;
baton.pool = pool;
baton.scratchpool = svn_pool_create(pool);
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c Fri Jan 28 15:48:53 2011
@@ -29,6 +29,8 @@
#include "svn_private_config.h"
#include "../libsvn_ra/ra_loader.h"
+#include "private/svn_fspath.h"
+
#include "ra_neon.h"
@@ -108,9 +110,9 @@ end_element(void *baton, int state,
options_ctx_t *oc = baton;
if (state == ELEM_href)
- oc->activity_coll = svn_string_create(svn_uri_canonicalize(oc->cdata->data,
- oc->pool),
- oc->pool);
+ oc->activity_coll =
+ svn_string_create(svn_urlpath__canonicalize(oc->cdata->data, oc->pool),
+ oc->pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/props.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/props.c Fri Jan 28 15:48:53 2011
@@ -41,6 +41,7 @@
#include "../libsvn_ra/ra_loader.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
#include "ra_neon.h"
@@ -413,7 +414,8 @@ static svn_error_t * end_element(void *b
case ELEM_href:
/* Special handling for <href> that belongs to the <response> tag. */
if (rsrc->href_parent == ELEM_response)
- return assign_rsrc_url(pc->rsrc, svn_uri_canonicalize(cdata, pc->pool),
+ return assign_rsrc_url(pc->rsrc,
+ svn_urlpath__canonicalize(cdata, pc->pool),
pc->pool);
/* Use the parent element's name, not the href. */
@@ -425,7 +427,7 @@ static svn_error_t * end_element(void *b
/* All other href's we'll treat as property values. */
name = parent_defn->name;
- value = svn_string_create(svn_uri_canonicalize(cdata, pc->pool),
+ value = svn_string_create(svn_urlpath__canonicalize(cdata, pc->pool),
pc->pool);
break;
@@ -723,8 +725,10 @@ svn_ra_neon__search_for_starting_props(s
return err; /* found a _real_ error */
/* else... lop off the basename and try again. */
+ /* ### TODO: path_s is an absolute, schema-less URI, but
+ ### technically not an FS_PATH. */
svn_stringbuf_set(lopped_path,
- svn_path_join(svn_uri_basename(path_s->data, iterpool),
+ svn_path_join(svn_path_basename(path_s->data, iterpool),
lopped_path->data, iterpool));
len = path_s->len;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/ra_neon.h?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/ra_neon.h Fri Jan 28 15:48:53 2011
@@ -1011,6 +1011,16 @@ const char *
svn_ra_neon__request_get_location(svn_ra_neon__request_t *request,
apr_pool_t *pool);
+/* Canonicalize an absolute URI, in the general sense. URI might be a
+ * full, absolute, schema-ful URL. It might be just the path portion
+ * of a URL. Whatever the case, it is a URI-encoded identifier of
+ * *some sort*, as will be the returned form thereof.
+ */
+const char *
+svn_ra_neon__uri_canonicalize(const char *uri,
+ apr_pool_t *scratch_pool,
+ apr_pool_t *result_pool);
+
/*
* Implements the get_locations RA layer function. */
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/session.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/session.c Fri Jan 28 15:48:53 2011
@@ -1155,7 +1155,6 @@ svn_ra_neon__get_path_relative_to_root(s
_("'%s' isn't a child of repository root "
"URL '%s'"),
url, root_url);
- *rel_path = svn_path_uri_decode(*rel_path, pool);
}
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/util.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/util.c Fri Jan 28 15:48:53 2011
@@ -39,6 +39,7 @@
#include "svn_xml.h"
#include "svn_props.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
#include "ra_neon.h"
@@ -1570,8 +1571,5 @@ svn_ra_neon__request_get_location(svn_ra
apr_pool_t *pool)
{
const char *val = ne_get_response_header(request->ne_req, "Location");
- return val ? svn_uri_join(request->url,
- svn_uri_canonicalize(val, pool),
- pool)
- : NULL;
+ return val ? svn_urlpath__canonicalize(val, pool) : NULL;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c Fri Jan 28 15:48:53 2011
@@ -41,6 +41,7 @@
#include "svn_private_config.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_fspath.h"
#include "ra_serf.h"
#include "../libsvn_ra/ra_loader.h"
@@ -311,8 +312,7 @@ handle_checkout(serf_request_t *request,
if (status)
err = svn_error_compose_create(svn_error_wrap_apr(status, NULL), err);
- ctx->resource_url = svn_ra_serf__uri_canonicalize(uri.path, pool,
- ctx->pool);
+ ctx->resource_url = svn_urlpath__canonicalize(uri.path, ctx->pool);
}
return err;
@@ -489,7 +489,7 @@ get_version_url(const char **checked_in_
if (current_version)
{
*checked_in_url =
- svn_ra_serf__uri_canonicalize(current_version->data, pool, pool);
+ svn_urlpath__canonicalize(current_version->data, pool);
return SVN_NO_ERROR;
}
}
@@ -544,7 +544,7 @@ get_version_url(const char **checked_in_
_("Path '%s' not present"),
session->repos_url.path);
- root_checkout = svn_ra_serf__uri_canonicalize(root_checkout, pool, pool);
+ root_checkout = svn_urlpath__canonicalize(root_checkout, pool);
}
*checked_in_url = svn_path_url_add_component2(root_checkout, relpath, pool);
@@ -1116,7 +1116,7 @@ setup_copy_dir_headers(serf_bucket_t *he
{
uri.path = (char *)svn_path_url_add_component2(
dir->parent_dir->checkout->resource_url,
- svn_uri_basename(dir->name, pool),
+ svn_relpath_basename(dir->name, pool),
pool);
}
absolute_uri = apr_uri_unparse(pool, &uri, 0);
@@ -1506,7 +1506,8 @@ delete_entry(const char *path,
/* Ensure our directory has been checked out */
SVN_ERR(checkout_dir(dir));
delete_target = svn_path_url_add_component2(dir->checkout->resource_url,
- svn_uri_basename(path, pool),
+ svn_relpath_basename(path,
+ pool),
pool);
}
@@ -1621,7 +1622,7 @@ add_directory(const char *path,
path, dir->pool);
mkcol_target = svn_path_url_add_component2(
parent->checkout->resource_url,
- svn_uri_basename(path, dir->pool),
+ svn_relpath_basename(path, dir->pool),
dir->pool);
}
@@ -1872,7 +1873,7 @@ add_file(const char *path,
new_file->url =
svn_path_url_add_component2(dir->checkout->resource_url,
- svn_uri_basename(path, new_file->pool),
+ svn_relpath_basename(path, new_file->pool),
new_file->pool);
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/getlocks.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/getlocks.c Fri Jan 28 15:48:53 2011
@@ -41,6 +41,7 @@
#include "svn_time.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
#include "ra_serf.h"
@@ -203,10 +204,10 @@ end_getlocks(svn_ra_serf__xml_parser_t *
else if ((lock_ctx->requested_depth == svn_depth_files) ||
(lock_ctx->requested_depth == svn_depth_immediates))
{
- const char *rel_uri = svn_uri_is_child(lock_ctx->path,
- info->lock->path,
- info->pool);
- if (rel_uri && (svn_path_component_count(rel_uri) == 1))
+ const char *rel_path = svn_fspath__is_child(lock_ctx->path,
+ info->lock->path,
+ info->pool);
+ if (rel_path && (svn_path_component_count(rel_path) == 1))
apr_hash_set(lock_ctx->hash, info->lock->path,
APR_HASH_KEY_STRING, info->lock);
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/merge.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/merge.c Fri Jan 28 15:48:53 2011
@@ -40,6 +40,7 @@
#include "svn_props.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
#include "ra_serf.h"
@@ -297,7 +298,7 @@ end_merge(svn_ra_serf__xml_parser_t *par
const char *href;
href = apr_hash_get(info->props, "href", APR_HASH_KEY_STRING);
- if (! svn_uri_is_ancestor(ctx->merge_url, href))
+ if (! svn_urlpath__is_ancestor(ctx->merge_url, href))
{
/* ### need something better than APR_EGENERAL */
return svn_error_createf(APR_EGENERAL, NULL,
@@ -319,7 +320,7 @@ end_merge(svn_ra_serf__xml_parser_t *par
an ancestor of HREF. All that remains is to
determine of HREF is the same as CTX->MERGE_URL, or --
if not -- is relative value as a child thereof. */
- href = svn_uri_is_child(ctx->merge_url, href, NULL);
+ href = svn_urlpath__is_child(ctx->merge_url, href, NULL);
if (! href)
href = "";
@@ -364,8 +365,8 @@ end_merge(svn_ra_serf__xml_parser_t *par
info->prop_val = apr_pstrmemdup(info->pool, info->prop_val,
info->prop_val_len);
if (strcmp(info->prop_name, "href") == 0)
- info->prop_val = svn_ra_serf__uri_canonicalize(info->prop_val,
- info->pool, info->pool);
+ info->prop_val = svn_urlpath__canonicalize(info->prop_val,
+ info->pool);
/* Set our property. */
apr_hash_set(info->props, info->prop_name, APR_HASH_KEY_STRING,
@@ -453,7 +454,7 @@ svn_ra_serf__merge_lock_token_list(apr_h
path.data = key;
path.len = klen;
- if (parent && !svn_uri_is_ancestor(parent, key))
+ if (parent && !svn_relpath_is_ancestor(parent, key))
continue;
svn_ra_serf__add_open_tag_buckets(body, alloc, "S:lock", NULL);
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c?rev=1064743&r1=1064742&r2=1064743&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c Fri Jan 28 15:48:53 2011
@@ -39,6 +39,7 @@
#include "svn_version.h"
#include "svn_dirent_uri.h"
#include "svn_private_config.h"
+#include "private/svn_fspath.h"
#include "ra_serf.h"
@@ -187,9 +188,7 @@ end_options(svn_ra_serf__xml_parser_t *p
{
options_ctx->collect_cdata = FALSE;
options_ctx->activity_collection =
- svn_ra_serf__uri_canonicalize(options_ctx->attr_val,
- options_ctx->pool,
- options_ctx->pool);
+ svn_urlpath__canonicalize(options_ctx->attr_val, options_ctx->pool);
pop_state(options_ctx);
}
@@ -345,11 +344,10 @@ capabilities_headers_iterator_callback(v
orc->session->repos_root = orc->session->repos_url;
orc->session->repos_root.path = apr_pstrdup(orc->session->pool, val);
orc->session->repos_root_str =
- svn_ra_serf__uri_canonicalize(
+ svn_urlpath__canonicalize(
apr_uri_unparse(orc->session->pool,
&orc->session->repos_root,
0),
- orc->session->pool,
orc->session->pool);
}
else if (svn_cstring_casecmp(key, SVN_DAV_ME_RESOURCE_HEADER) == 0)