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 2015/12/08 16:53:37 UTC
svn commit: r1718639 - /subversion/trunk/subversion/libsvn_repos/commit.c
Author: rhuijben
Date: Tue Dec 8 15:53:37 2015
New Revision: 1718639
URL: http://svn.apache.org/viewvc?rev=1718639&view=rev
Log:
Revert r1718566 until I investigated the ruby/Windows problem.
Modified:
subversion/trunk/subversion/libsvn_repos/commit.c
Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1718639&r1=1718638&r2=1718639&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Tue Dec 8 15:53:37 2015
@@ -73,7 +73,7 @@ struct edit_baton
svn_repos_t *repos;
/* URL to the root of the open repository. */
- const char *repos_root_url;
+ const char *repos_url_decoded;
/* The name of the repository (here for convenience). */
const char *repos_name;
@@ -324,6 +324,7 @@ add_file_or_directory(const char *path,
const char *fs_path;
svn_fs_root_t *copy_root;
svn_node_kind_t kind;
+ size_t repos_url_len;
svn_repos_authz_access_t required;
/* Copy requires recursive write access to the destination path
@@ -344,15 +345,14 @@ add_file_or_directory(const char *path,
/* For now, require that the url come from the same repository
that this commit is operating on. */
- copy_path = svn_uri_canonicalize(copy_path, subpool);
- copy_path = svn_uri_skip_ancestor(eb->repos_root_url, copy_path,
- subpool);
- if (!copy_path)
+ copy_path = svn_path_uri_decode(copy_path, subpool);
+ repos_url_len = strlen(eb->repos_url_decoded);
+ if (strncmp(copy_path, eb->repos_url_decoded, repos_url_len) != 0)
return svn_error_createf
(SVN_ERR_FS_GENERAL, NULL,
_("Source url '%s' is from different repository"), copy_path);
- fs_path = svn_fspath__canonicalize(copy_path, pool);
+ fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);
/* Now use the "fs_path" as an absolute path within the
repository to make the copy from. */
@@ -1009,9 +1009,7 @@ svn_repos_get_commit_editor5(const svn_d
struct edit_baton *eb;
svn_delta_shim_callbacks_t *shim_callbacks =
svn_delta_shim_callbacks_default(pool);
- /* Our api contract explicitly requires a not canonical url here.
- ### Should fix that when revving this api */
- const char *repos_url = svn_uri_canonicalize(repos_url_decoded, pool);
+ const char *repos_url = svn_path_uri_encode(repos_url_decoded, pool);
/* Do a global authz access lookup. Users with no write access
whatsoever to the repository don't get a commit editor. */
@@ -1053,7 +1051,7 @@ svn_repos_get_commit_editor5(const svn_d
eb->authz_baton = authz_baton;
eb->base_path = svn_fspath__canonicalize(base_path, subpool);
eb->repos = repos;
- eb->repos_root_url = repos_url;
+ eb->repos_url_decoded = repos_url_decoded;
eb->repos_name = svn_dirent_basename(svn_repos_path(repos, subpool),
subpool);
eb->fs = svn_repos_fs(repos);