Bug Link:

Patch Link:


When using ‘svn export’, and giving the current directory (“.”) a target, instead of copying the exported files into the current directory, SVN creates a directory with name of the last element of URL and then copy it to that directory.

How it is diagnosed:


How to reproduce:

$ svn export --force .
A    schema
A    schema\blame.rnc
A    schema\log.rnc
A    schema\props.rnc
A    schema\status.rnc
A    schema\common.rnc
A    schema\diff.rnc
A    schema\info.rnc
A    schema\list.rnc
Exported revision 1021349.

Expected result:

$svn export --force .
A    .
A    blame.rnc
A    log.rnc
A    props.rnc
A    status.rnc
A    common.rnc
A    diff.rnc
A    info.rnc
A    list.rnc
Exported revision 1021349.

Root Cause:


They have a special case for handling empty path, which is undesirable. The patch is simply to delete that code.


svn_error_t *
        … …

         /* ‘to’ contains the target directory input by users. */
                   to = APR_ARRAY_IDX(targets, 1, const char *);

     /* If given the cwd, pretend we weren't given anything. */

     /* Here, compare the target directory “to” to empty string. And

         if the ‘to’ is essentially empty, then they are trying to do

         something smart: try to guess the target directory as the

         last field of the URL -- essentially is “schema”. In the patch,

         they simply deleted this logic! */
-                      if (strcmp("", to) == 0)

                  /* Input check! ‘to’ is empty here!!! */
-                        to = svn_path_uri_decode(svn_path_basename(truefrom, pool),


-                else
   /* svn_cl__eat_peg_revisions() but only on one target */
-                SVN_ERR(svn_opt__split_arg_at_peg_revision(&to, NULL, to, pool));

         return err;

Failure symptom category

wrong result

Is there any log message?


Can ErrLog insert a log message?

Yes -- input check(strcmp).