subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1779948 - /subversion/trunk/subversion/libsvn_client/copy.c
Date Mon, 23 Jan 2017 15:54:37 GMT
Author: stsp
Date: Mon Jan 23 15:54:37 2017
New Revision: 1779948

URL: http://svn.apache.org/viewvc?rev=1779948&view=rev
Log:
* subversion/libsvn_client/copy.c
  (verify_wc_dsts): Provide a better error message when a copy/move operation
   attempts to use an existing, but unversioned, target directory.

Found by: benny-innofaith (in #svn IRC)

Modified:
    subversion/trunk/subversion/libsvn_client/copy.c

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1779948&r1=1779947&r2=1779948&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Mon Jan 23 15:54:37 2017
@@ -1057,10 +1057,24 @@ verify_wc_dsts(const apr_array_header_t
                                 ctx->wc_ctx, pair->dst_parent_abspath,
                                 FALSE, TRUE,
                                 iterpool));
-      if (make_parents && dst_parent_kind == svn_node_none)
+      if (dst_parent_kind == svn_node_none)
         {
-          SVN_ERR(svn_client__make_local_parents(pair->dst_parent_abspath,
-                                                 TRUE, ctx, iterpool));
+          if (make_parents)
+            SVN_ERR(svn_client__make_local_parents(pair->dst_parent_abspath,
+                                                   TRUE, ctx, iterpool));
+          else
+            {
+              SVN_ERR(svn_io_check_path(pair->dst_parent_abspath,
+                                        &dst_parent_kind, scratch_pool));
+              return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                       (dst_parent_kind == svn_node_dir)
+                                         ? _("Directory '%s' is not under "
+                                             "version control")
+                                         : _("Path '%s' is not a directory"),
+                                       svn_dirent_local_style(
+                                         pair->dst_parent_abspath,
+                                         scratch_pool));
+            }
         }
       else if (dst_parent_kind != svn_node_dir)
         {



Mime
View raw message