Author: philip
Date: Mon Nov  1 17:15:29 2010
New Revision: 1029751

URL: http://svn.apache.org/viewvc?rev=1029751&view=rev
Log:
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): Move logic into subversion/libsvn_client/export.c

* subversion/include/svn_client.h
  (svn_client_export5): Update docstring.

* subversion/libsvn_client/export.c
  (svn_client_export5): If the TO path is empty when exporting an
   single file then use the basename of the URL.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
Tweaked by: me

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/export.c
    subversion/trunk/subversion/svn/export-cmd.c
    subversion/trunk/subversion/tests/cmdline/export_tests.py

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1029751&r1=1029750&r2=1029751&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Mon Nov  1 17:15:29 2010
@@ -4461,8 +4461,10 @@ svn_client_revprop_list(apr_hash_t **pro
  * @a from is either the path the working copy on disk, or a URL to the
  * repository you wish to export.
  *
- * @a to is the path to the directory where you wish to create the exported
- * tree.
+ * When exporting a directory @a to is the path to the directory where
+ * you wish to create the exported tree, when exporting a file it is
+ * the path of the file that will be created.  If @a to is the empty
+ * path the name of the file/directory in the repository will be used.
  *
  * @a peg_revision is the revision where the path is first looked up
  * when exporting from a repository.  If @a peg_revision->kind is

Modified: subversion/trunk/subversion/libsvn_client/export.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1029751&r1=1029750&r2=1029751&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Mon Nov  1 17:15:29 2010
@@ -993,6 +993,12 @@ svn_client_export5(svn_revnum_t *result_
           apr_hash_index_t *hi;
           struct file_baton *fb = apr_pcalloc(pool, sizeof(*fb));
 
+          if (svn_path_is_empty(to))
+            {
+              to = svn_path_uri_decode(svn_uri_basename(from, NULL), pool);
+              eb->root_path = to;
+            }
+          
           /* Since you cannot actually root an editor at a file, we
            * manually drive a few functions of our editor. */
 

Modified: subversion/trunk/subversion/svn/export-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/export-cmd.c?rev=1029751&r1=1029750&r2=1029751&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/export-cmd.c (original)
+++ subversion/trunk/subversion/svn/export-cmd.c Mon Nov  1 17:15:29 2010
@@ -79,10 +79,7 @@ svn_cl__export(apr_getopt_t *os,
     {
       to = APR_ARRAY_IDX(targets, 1, const char *);
 
-      /* If given the cwd, pretend we weren't given anything. */
-      if (strcmp("", to) == 0)
-        to = svn_path_uri_decode(svn_uri_basename(truefrom, pool), pool);
-      else
+      if (strcmp("", to) != 0)
         /* svn_cl__eat_peg_revisions() but only on one target */
         SVN_ERR(svn_opt__split_arg_at_peg_revision(&to, NULL, to, pool));
     }

Modified: subversion/trunk/subversion/tests/cmdline/export_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/export_tests.py?rev=1029751&r1=1029750&r2=1029751&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/export_tests.py Mon Nov  1 
17:15:29 2010
@@ -680,7 +680,7 @@ test_list = [ None,
               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__':


Reply via email to