svn-3636

Version:

1.6.x

Bug Link:

http://subversion.tigris.org/issues/show_bug.cgi?id=3636

Patch Link:

source code patch:

http://svn.apache.org/viewvc?view=revision&revision=935996

Symptom:

In ‘svn delete’ command on a URL containing spaces, the URL gets URI-encoded twice. (only happens in Windows platform)

 

E.g. "http://svn/foo/2009-07 Rotten Monthend.csv" becomes:

"http://localhost/svn/foo/2009-07%20Rotten%20Monthend.csv" ->

"http://localhost/svn/foo/2009-07%2520Rotten%2520Monthend.csv"

How it is diagnosed:

reproduced & source code analysis

 

How to reproduce:

Step1) add “2009-07 Rotten Monthend.csv” to the repository

Step2) delete that file from the repository using ‘svn delete’

svn delete svn://127.0.0.1/alpha/t1/2009-07 Rotten Monthend.csv -m "hi"

 

Error msg:

svn: URL 'svn://127.0.0.1/alpha/t1/2009-07' does not exist

 

Root Cause:

Brief:

URI was not decoded when using it as a relative path.

Detail:

Just add the function, ‘svn_path_uri_decode’

   for (i = 0; i < targets->nelts; i++)

        {

          const char *path = APR_ARRAY_IDX(targets, i, const char *);

          svn_pool_clear(subpool);

          path = svn_path_uri_decode(path, pool);

          APR_ARRAY_IDX(targets, i, const char *) = path;

          SVN_ERR(svn_ra_check_path(ra_session, path, SVN_INVALID_REVNUM,

                                    &kind, subpool));

           /* This is where the error message is printed: function return value: checked!*/

          if (kind == svn_node_none)

            return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,

                                     "URL '%s' does not exist",

                                 svn_path_local_style(path, pool));

        }

--- subversion/trunk/subversion/libsvn_client/delete.c           2010/04/20 17:06:28            935995

+++ subversion/trunk/subversion/libsvn_client/delete.c         2010/04/20 17:09:18            935996

@@ -160,7 +160,7 @@ delete_urls(svn_commit_info_t **commit_i

         {

           const char *bname;

           svn_uri_split(common, &common, &bname, pool);

-          APR_ARRAY_PUSH(targets, const char *) = bname;

+      APR_ARRAY_PUSH(targets, const char *) = svn_path_uri_decode(bname, pool);

         }

 

   /* Create new commit items and add them to the array. */

Failure symptom category

refuse valid input, wrong result

Is there any log message?

Yes

How can it be automatically inserted?

Return value check