Philip Martin <philip.mar...@wandisco.com> writes: > Noorul Islam K M <noo...@collab.net> writes: > >> It looks like the issue >> http://subversion.tigris.org/issues/show_bug.cgi?id=3727 is because of >> the commit done in r880559. >> >> Since this is a conscious change, should this issue be ignored? > > From the log message: > > r880559 | hwright | 2009-11-12 18:21:32 +0000 (Thu, 12 Nov 2009) | 11 lines > > Make "svn export $repos/blah '.'" do what you think it would, namely, put a > file named "blah" into the cwd. > > and the regression test it appears this was intended to apply to > files. I don't think it was intended to apply to directories.
Attached is a patch that I think solves this problem. [[[ Fix issue 3727: Fix regression caused by r880559 * subversion/tests/cmdline/export_tests.py (export_to_explicit_cwd): Remove XFail. * subversion/svn/export-cmd.c (svn_cl__export): If the explicit TO path is '.', treat it as if it weren't given only if the source is a file. ]]] Thanks and Regards Noorul
Index: subversion/tests/cmdline/export_tests.py =================================================================== --- subversion/tests/cmdline/export_tests.py (revision 1028789) +++ subversion/tests/cmdline/export_tests.py (working copy) @@ -680,7 +680,7 @@ export_with_url_unsafe_characters, XFail(export_working_copy_with_depths), export_externals_with_native_eol, - XFail(export_to_current_dir), + export_to_current_dir, ] if __name__ == '__main__': Index: subversion/svn/export-cmd.c =================================================================== --- subversion/svn/export-cmd.c (revision 1028789) +++ subversion/svn/export-cmd.c (working copy) @@ -32,6 +32,7 @@ #include "svn_dirent_uri.h" #include "svn_path.h" #include "cl.h" +#include "../libsvn_client/client.h" #include "svn_private_config.h" #include "private/svn_opt_private.h" @@ -52,7 +53,11 @@ svn_error_t *err; svn_opt_revision_t peg_revision; const char *truefrom; - + svn_revnum_t revnum; + svn_ra_session_t *ra_session; + svn_node_kind_t kind; + const char *url; + SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os, opt_state->targets, ctx, pool)); @@ -79,8 +84,17 @@ { to = APR_ARRAY_IDX(targets, 1, const char *); + /* Get the RA connection. */ + SVN_ERR(svn_client__ra_session_from_path(&ra_session, &revnum, + &url, truefrom, NULL, + &peg_revision, + &(opt_state->start_revision), + ctx, pool)); + + SVN_ERR(svn_ra_check_path(ra_session, "", revnum, &kind, pool)); + /* If given the cwd, pretend we weren't given anything. */ - if (strcmp("", to) == 0) + if ((strcmp("", to) == 0) && (kind == svn_node_file)) to = svn_path_uri_decode(svn_uri_basename(truefrom, pool), pool); else /* svn_cl__eat_peg_revisions() but only on one target */