You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/03/18 10:35:29 UTC

svn commit: r1457684 [9/22] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subve...

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/delete.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/delete.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/delete.c Mon Mar 18 09:35:24 2013
@@ -110,7 +110,7 @@ static svn_error_t *
 create_delete_wq_items(svn_skel_t **work_items,
                        svn_wc__db_t *db,
                        const char *local_abspath,
-                       svn_kind_t kind,
+                       svn_node_kind_t kind,
                        svn_boolean_t conflicted,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
@@ -118,7 +118,7 @@ create_delete_wq_items(svn_skel_t **work
   *work_items = NULL;
 
   /* Schedule the on-disk delete */
-  if (kind == svn_kind_dir)
+  if (kind == svn_node_dir)
     SVN_ERR(svn_wc__wq_build_dir_remove(work_items, db, local_abspath,
                                         local_abspath,
                                         TRUE /* recursive */,
@@ -185,7 +185,7 @@ svn_wc__delete_many(svn_wc_context_t *wc
   svn_wc__db_t *db = wc_ctx->db;
   svn_error_t *err;
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_skel_t *work_items = NULL;
   apr_array_header_t *versioned_targets;
   const char *local_abspath;
@@ -198,13 +198,15 @@ svn_wc__delete_many(svn_wc_context_t *wc
   for (i = 0; i < targets->nelts; i++)
     {
       svn_boolean_t conflicted = FALSE;
+      const char *repos_relpath;
 
       svn_pool_clear(iterpool);
 
       local_abspath = APR_ARRAY_IDX(targets, i, const char *);
-      err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, &conflicted,
+      err = svn_wc__db_read_info(&status, &kind, NULL, &repos_relpath, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, &conflicted,
                                  NULL, NULL, NULL, NULL, NULL, NULL,
                                  db, local_abspath, iterpool, iterpool);
 
@@ -242,7 +244,7 @@ svn_wc__delete_many(svn_wc_context_t *wc
         }
 
       if (status == svn_wc__db_status_normal
-          && kind == svn_kind_dir)
+          && kind == svn_node_dir)
         {
           svn_boolean_t is_wcroot;
           SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath,
@@ -255,6 +257,12 @@ svn_wc__delete_many(svn_wc_context_t *wc
                                      svn_dirent_local_style(local_abspath,
                                                             iterpool));
         }
+      if (repos_relpath && !repos_relpath[0])
+        return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                     _("'%s' represents the repository root "
+                                       "and cannot be deleted"),
+                                     svn_dirent_local_style(local_abspath,
+                                                            iterpool));
 
       /* Verify if we have a write lock on the parent of this node as we might
          be changing the childlist of that directory. */
@@ -301,28 +309,28 @@ svn_wc__delete_many(svn_wc_context_t *wc
 }
 
 svn_error_t *
-svn_wc__delete_internal(svn_wc_context_t *wc_ctx,
-                        const char *local_abspath,
-                        svn_boolean_t keep_local,
-                        svn_boolean_t delete_unversioned_target,
-                        const char *moved_to_abspath,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        svn_wc_notify_func2_t notify_func,
-                        void *notify_baton,
-                        apr_pool_t *scratch_pool)
+svn_wc_delete4(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_boolean_t keep_local,
+               svn_boolean_t delete_unversioned_target,
+               svn_cancel_func_t cancel_func,
+               void *cancel_baton,
+               svn_wc_notify_func2_t notify_func,
+               void *notify_baton,
+               apr_pool_t *scratch_pool)
 {
   apr_pool_t *pool = scratch_pool;
   svn_wc__db_t *db = wc_ctx->db;
   svn_error_t *err;
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_boolean_t conflicted;
   svn_skel_t *work_items = NULL;
+  const char *repos_relpath;
 
-  err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+  err = svn_wc__db_read_info(&status, &kind, NULL, &repos_relpath, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, &conflicted,
+                             NULL, NULL, NULL, NULL, NULL, NULL, &conflicted,
                              NULL, NULL, NULL, NULL, NULL, NULL,
                              db, local_abspath, pool, pool);
 
@@ -355,7 +363,7 @@ svn_wc__delete_internal(svn_wc_context_t
     }
 
   if (status == svn_wc__db_status_normal
-      && kind == svn_kind_dir)
+      && kind == svn_node_dir)
     {
       svn_boolean_t is_wcroot;
       SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, db, local_abspath, pool));
@@ -366,6 +374,11 @@ svn_wc__delete_internal(svn_wc_context_t
                                    "cannot be deleted"),
                                  svn_dirent_local_style(local_abspath, pool));
     }
+  if (repos_relpath && !repos_relpath[0])
+    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                             _("'%s' represents the repository root "
+                               "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. */
@@ -380,7 +393,8 @@ svn_wc__delete_internal(svn_wc_context_t
                                          scratch_pool, scratch_pool));
         }
 
-  SVN_ERR(svn_wc__db_op_delete(db, local_abspath, moved_to_abspath,
+  SVN_ERR(svn_wc__db_op_delete(db, local_abspath,
+                               NULL /*moved_to_abspath */,
                                !keep_local /* delete_dir_externals */,
                                NULL, work_items,
                                cancel_func, cancel_baton,
@@ -395,26 +409,6 @@ svn_wc__delete_internal(svn_wc_context_t
 }
 
 svn_error_t *
-svn_wc_delete4(svn_wc_context_t *wc_ctx,
-               const char *local_abspath,
-               svn_boolean_t keep_local,
-               svn_boolean_t delete_unversioned_target,
-               svn_cancel_func_t cancel_func,
-               void *cancel_baton,
-               svn_wc_notify_func2_t notify_func,
-               void *notify_baton,
-               apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_wc__delete_internal(wc_ctx, local_abspath,
-                                                 keep_local,
-                                                 delete_unversioned_target,
-                                                 NULL,
-                                                 cancel_func, cancel_baton,
-                                                 notify_func, notify_baton,
-                                                 scratch_pool));
-}
-
-svn_error_t *
 svn_wc__internal_remove_from_revision_control(svn_wc__db_t *db,
                                               const char *local_abspath,
                                               svn_boolean_t destroy_wf,
@@ -439,7 +433,7 @@ svn_wc__internal_remove_from_revision_co
                                     destroy_wf /* destroy_changes */,
                                     SVN_INVALID_REVNUM,
                                     svn_wc__db_status_not_present,
-                                    svn_kind_none,
+                                    svn_node_none,
                                     NULL, NULL,
                                     cancel_func, cancel_baton,
                                     scratch_pool));

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c Mon Mar 18 09:35:24 2013
@@ -970,12 +970,13 @@ svn_wc_add3(const char *path,
   /* Make sure the caller gets the new access baton in the set. */
   if (svn_wc__adm_retrieve_internal2(wc_db, local_abspath, pool) == NULL)
     {
-      svn_kind_t kind;
+      svn_node_kind_t kind;
 
       SVN_ERR(svn_wc__db_read_kind(&kind, wc_db, local_abspath,
                                    FALSE /* allow_missing */,
+                                   TRUE /* show_deleted */,
                                    FALSE /* show_hidden */, pool));
-      if (kind == svn_kind_dir)
+      if (kind == svn_node_dir)
         {
           svn_wc_adm_access_t *adm_access;
 
@@ -3258,7 +3259,7 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
 {
   svn_boolean_t is_root;
   svn_boolean_t is_switched;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_error_t *err;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -3274,7 +3275,7 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
       return svn_error_create(SVN_ERR_ENTRY_NOT_FOUND, err, err->message);
     }
 
-  *wc_root = is_root || (kind == svn_kind_dir && is_switched);
+  *wc_root = is_root || (kind == svn_node_dir && is_switched);
 
   return SVN_NO_ERROR;
 }
@@ -4565,3 +4566,27 @@ svn_wc_move(svn_wc_context_t *wc_ctx,
                                        notify_func, notify_baton,
                                        scratch_pool));
 }
+
+svn_error_t *
+svn_wc_read_kind(svn_node_kind_t *kind,
+                 svn_wc_context_t *wc_ctx,
+                 const char *abspath,
+                 svn_boolean_t show_hidden,
+                 apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+          svn_wc_read_kind2(kind,
+                            wc_ctx, abspath,
+                            TRUE /* show_deleted */,
+                            show_hidden,
+                            scratch_pool));
+
+  /*if (db_kind == svn_node_dir)
+    *kind = svn_node_dir;
+  else if (db_kind == svn_node_file || db_kind == svn_node_symlink)
+    *kind = svn_node_file;
+  else
+    *kind = svn_node_none;*/
+
+  return SVN_NO_ERROR;
+}