You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/05/06 13:44:19 UTC

svn commit: r1100177 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

Author: rhuijben
Date: Fri May  6 11:44:19 2011
New Revision: 1100177

URL: http://svn.apache.org/viewvc?rev=1100177&view=rev
Log:
* subversion/libsvn_wc/adm_ops.c
  (svn_wc_delete4): Provide an understandable error message when trying to
    delete the root of a working copy.

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

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1100177&r1=1100176&r2=1100177&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Fri May  6 11:44:19 2011
@@ -738,6 +738,19 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
         break;
     }
 
+  if (status == svn_wc__db_status_normal
+      && kind == svn_wc__db_kind_dir)
+    {
+      svn_boolean_t is_wcroot;
+      SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath, pool));
+
+      if (is_wcroot)
+        return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                 _("'%s' is the root of a working copy and "
+                                   "cannot be deleted"),
+                                 svn_dirent_local_style(local_abspath, pool));
+    }
+
   /* Verify if we have a write lock on the parent of this node as we might
      be changing the childlist of that directory. */
   SVN_ERR(svn_wc__write_check(db, svn_dirent_dirname(local_abspath, pool),