subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1406649 - /subversion/trunk/subversion/libsvn_wc/copy.c
Date Wed, 07 Nov 2012 14:14:21 GMT
Author: stsp
Date: Wed Nov  7 14:14:21 2012
New Revision: 1406649

URL: http://svn.apache.org/viewvc?rev=1406649&view=rev
Log:
Print a better error message when the user tries to move something into
an unversioned directory.

* subversion/libsvn_wc/copy.c
  (copy_or_move): If the destination directory X is unversioned, return an
   error saying "X is not under version control", rather than saying
   "node X not found". I believe this is a better user-facing error message
   since "node" is an internal libsvn_wc concept.

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

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1406649&r1=1406648&r2=1406649&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Wed Nov  7 14:14:21 2012
@@ -618,14 +618,26 @@ copy_or_move(svn_wc_context_t *wc_ctx,
           break;
       }
 
-    SVN_ERR(svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
-                                 &dst_repos_root_url, &dst_repos_uuid, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL,
-                                 db, dstdir_abspath,
-                                 scratch_pool, scratch_pool));
+    err = svn_wc__db_read_info(&dstdir_status, NULL, NULL, NULL,
+                               &dst_repos_root_url, &dst_repos_uuid, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL,
+                               db, dstdir_abspath,
+                               scratch_pool, scratch_pool);
+
+    if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+      {
+        /* An unversioned destination directory exists on disk. */
+        svn_error_clear(err);
+        return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
+                                 _("'%s' is not under version control"),
+                                 svn_dirent_local_style(dstdir_abspath,
+                                                        scratch_pool));
+      }
+    else
+      SVN_ERR(err);
 
     /* Do this now, as we know the right data is cached */
     SVN_ERR(svn_wc__db_get_wcroot(&dst_wcroot_abspath, db, dstdir_abspath,



Mime
View raw message