[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: r1064138 - in /subversion/branches/uris-as-urls: ./ subversion/include/ subversion/libsvn_client/ subversion/libsvn_subr/ subversion/svn/ subversion/tests/libsvn_subr/

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 27 Jan 2011 15:56:45 +0100

> -----Original Message-----
> From: cmpilato_at_apache.org [mailto:cmpilato_at_apache.org]
> Sent: donderdag 27 januari 2011 15:45
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1064138 - in /subversion/branches/uris-as-urls:
> ./ subversion/include/ subversion/libsvn_client/
> subversion/libsvn_subr/ subversion/svn/ subversion/tests/libsvn_subr/
>
> Author: cmpilato
> Date: Thu Jan 27 14:45:18 2011
> New Revision: 1064138
>
> URL: http://svn.apache.org/viewvc?rev=1064138&view=rev
> Log:
> On the 'uris-as-urls' branch: Begin ensuring that the relpaths
> returned from svn_url_* functions are URI-decoded.
>
> * BRANCH-README
> Update status.
>
> * subversion/include/svn_dirent_uri.h
> (svn_dir_split): Change promise -- basename will be URI-decoded now.
> (svn_url_basename): Change promise -- basename will be URI-decoded
> now, and pool is no longer optional.
>
> * subversion/tests/libsvn_subr/dirent_uri-test.c
> (test_uri_split, test_uri_basename): Add test data to check that the
> returned basename was URI-decoded.
>
> * subversion/libsvn_subr/dirent_uri.c
> (svn_url_basename): URI-decode the returned basename.
>
> * subversion/libsvn_client/diff.c
> (diff_prepare_repos_repos): Updated code to expect decoded basenames
> from svn_url_split() and svn_url_basename().
>
> * subversion/libsvn_client/info.c
> (svn_client_info3): Same as above.
>
> * subversion/libsvn_client/list.c
> (svn_client_list2): Same as above.
>
> * subversion/libsvn_client/locking_commands.c
> (organize_lock_targets): Same as above.
>
> * subversion/libsvn_client/add.c
> (mkdir_urls): Same as above.
>
> * subversion/libsvn_client/commit.c
> (svn_client_import4): Same as above.
>
> * subversion/libsvn_subr/subst.c
> (keyword_printf): Same as above.
>
> * subversion/svn/merge-cmd.c
> (svn_cl__merge): Same as above.
>
> * subversion/svn/checkout-cmd.c
> (svn_cl__checkout): Same as above.
>
> * subversion/svn/export-cmd.c
> (svn_cl__export): Same as above.
>
> * subversion/libsvn_client/copy.c
> (try_copy, svn_client_copy6, svn_client_move6): Same as above.
>
> * subversion/libsvn_client/export.c
> (append_basename_if_dir, svn_client_export5): Same as above.
>
> * subversion/libsvn_client/delete.c
> (delete_urls): Same as above.
>
> Modified:
> subversion/branches/uris-as-urls/BRANCH-README
> subversion/branches/uris-as-
> urls/subversion/include/svn_dirent_uri.h
> subversion/branches/uris-as-urls/subversion/libsvn_client/add.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/commit.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/copy.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/delete.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/diff.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/export.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/info.c
> subversion/branches/uris-as-urls/subversion/libsvn_client/list.c
> subversion/branches/uris-as-
> urls/subversion/libsvn_client/locking_commands.c
> subversion/branches/uris-as-
> urls/subversion/libsvn_subr/dirent_uri.c
> subversion/branches/uris-as-urls/subversion/libsvn_subr/subst.c
> subversion/branches/uris-as-urls/subversion/svn/checkout-cmd.c
> subversion/branches/uris-as-urls/subversion/svn/export-cmd.c
> subversion/branches/uris-as-urls/subversion/svn/merge-cmd.c
> subversion/branches/uris-as-
> urls/subversion/tests/libsvn_subr/dirent_uri-test.c
>
> Modified: subversion/branches/uris-as-
> urls/subversion/libsvn_client/locking_commands.c
> URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-
> urls/subversion/libsvn_client/locking_commands.c?rev=1064138&r1=1064137
> &r2=1064138&view=diff
> =======================================================================
> =======
> --- subversion/branches/uris-as-
> urls/subversion/libsvn_client/locking_commands.c (original)
> +++ subversion/branches/uris-as-
> urls/subversion/libsvn_client/locking_commands.c Thu Jan 27 14:45:18
> 2011
> @@ -206,9 +206,16 @@ organize_lock_targets(const char **commo
> {
> const char *parent, *base;
> if (url_mode)
> - svn_url_split(&parent, &base, *common_parent_url,
> result_pool);
> + {
> + svn_url_split(&parent, &base, *common_parent_url,
> + result_pool);
> + svn_path_uri_encode(base, result_pool);

I think you tried to store the result in base?

Or should the encode be removed?

> + }
> else
> - svn_dirent_split(&parent, &base, *common_parent_url,
> result_pool);
> + {
> + svn_dirent_split(&parent, &base, *common_parent_url,
> + result_pool);
> + }
>
> *common_parent_url = parent;
> APR_ARRAY_PUSH(rel_targets, const char *) = base;
> @@ -278,9 +285,12 @@ organize_lock_targets(const char **commo
> had 1 member, so we special case that (again). */
> if (apr_is_empty_array(rel_urls))
> {
> - const char *base_name = svn_url_basename(common_url,
> scratch_pool);
> + const char *base_name;
> +
> + base_name = svn_url_basename(common_url, scratch_pool);
> + APR_ARRAY_PUSH(rel_urls, const char *) =
> + svn_path_uri_encode(base_name, result_pool);
> common_url = svn_url_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) */
>
> 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=1064138&r1=1064137&r2=1064
> 138&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 27 14:45:18 2011
> @@ -1365,8 +1365,7 @@ svn_url_basename(const char *uri, apr_po
> else
> base_name = uri + start;
>
> - /* ### TODO: URI decode a non-NULL base_name? */
> - return base_name;
> + return svn_path_uri_decode(base_name, pool);
> }

I wouldn't be surprised if there is a static function in this file which would avoid the copying if possible. (If not, that would be a nice addition for a future enhancement)

 
        Bert
Received on 2011-01-27 15:57:25 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.