subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r980671 [2/5] - in /subversion/branches/atomic-revprop: ./ notes/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/src/org/apache/subversion/javahl/callback/ subversion/include/ subversion/include/priv...
Date Fri, 30 Jul 2010 07:58:23 GMT
Modified: subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/lock.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/lock.c Fri Jul 30 07:58:20 2010
@@ -462,7 +462,7 @@ get_lock(svn_lock_t **lock_p,
 
   SVN_ERR(read_digest_file(NULL, &lock, fs, digest_path, pool));
   if (! lock)
-    return SVN_FS__ERR_NO_SUCH_LOCK(fs, path);
+    return SVN_FS__ERR_NO_SUCH_LOCK(fs, path, pool);
 
   /* Don't return an expired lock. */
   if (lock->expiration_date && (apr_time_now() > lock->expiration_date))
@@ -472,7 +472,7 @@ get_lock(svn_lock_t **lock_p,
       if (have_write_lock)
         SVN_ERR(delete_lock(fs, lock, pool));
       *lock_p = NULL;
-      return SVN_FS__ERR_LOCK_EXPIRED(fs, lock->token);
+      return SVN_FS__ERR_LOCK_EXPIRED(fs, lock->token, pool);
     }
 
   *lock_p = lock;
@@ -676,7 +676,7 @@ lock_body(void *baton, apr_pool_t *pool)
   SVN_ERR(lb->fs->vtable->revision_root(&root, lb->fs, youngest, pool));
   SVN_ERR(svn_fs_fs__check_path(&kind, root, lb->path, pool));
   if (kind == svn_node_dir)
-    return SVN_FS__ERR_NOT_FILE(lb->fs, lb->path);
+    return SVN_FS__ERR_NOT_FILE(lb->fs, lb->path, pool);
 
   /* While our locking implementation easily supports the locking of
      nonexistent paths, we deliberately choose not to allow such madness. */
@@ -696,7 +696,7 @@ lock_body(void *baton, apr_pool_t *pool)
 
   /* We need to have a username attached to the fs. */
   if (!lb->fs->access_ctx || !lb->fs->access_ctx->username)
-    return SVN_FS__ERR_NO_USER(lb->fs);
+    return SVN_FS__ERR_NO_USER(lb->fs, pool);
 
   /* Is the caller attempting to lock an out-of-date working file? */
   if (SVN_IS_VALID_REVNUM(lb->current_rev))
@@ -742,7 +742,7 @@ lock_body(void *baton, apr_pool_t *pool)
       if (! lb->steal_lock)
         {
           /* Sorry, the path is already locked. */
-          return SVN_FS__ERR_PATH_ALREADY_LOCKED(lb->fs, existing_lock);
+          return SVN_FS__ERR_PATH_ALREADY_LOCKED(lb->fs, existing_lock, pool);
         }
       else
         {
@@ -797,16 +797,16 @@ unlock_body(void *baton, apr_pool_t *poo
     {
       /* Sanity check:  the incoming token should match lock->token. */
       if (strcmp(ub->token, lock->token) != 0)
-        return SVN_FS__ERR_NO_SUCH_LOCK(ub->fs, lock->path);
+        return SVN_FS__ERR_NO_SUCH_LOCK(ub->fs, lock->path, pool);
 
       /* There better be a username attached to the fs. */
       if (! (ub->fs->access_ctx && ub->fs->access_ctx->username))
-        return SVN_FS__ERR_NO_USER(ub->fs);
+        return SVN_FS__ERR_NO_USER(ub->fs, pool);
 
       /* And that username better be the same as the lock's owner. */
       if (strcmp(ub->fs->access_ctx->username, lock->owner) != 0)
-        return SVN_FS__ERR_LOCK_OWNER_MISMATCH
-          (ub->fs, ub->fs->access_ctx->username, lock->owner);
+        return SVN_FS__ERR_LOCK_OWNER_MISMATCH(
+           ub->fs, ub->fs->access_ctx->username, lock->owner, pool);
     }
 
   /* Remove lock and lock token files. */

Modified: subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/tree.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/tree.c Fri Jul 30 07:58:20 2010
@@ -358,7 +358,7 @@ mutable_root_node(dag_node_t **node_p,
     return svn_fs_fs__dag_clone_root(node_p, root->fs, root->txn, pool);
   else
     /* If it's not a transaction root, we can't change its contents.  */
-    return SVN_FS__ERR_NOT_MUTABLE(root->fs, root->rev, error_path);
+    return SVN_FS__ERR_NOT_MUTABLE(root->fs, root->rev, error_path, pool);
 }
 
 
@@ -692,7 +692,7 @@ open_path(parent_path_t **parent_path_p,
 
       /* The path isn't finished yet; we'd better be in a directory.  */
       if (svn_fs_fs__dag_node_kind(child) != svn_node_dir)
-        SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far),
+        SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far, pool),
                   apr_psprintf(pool, _("Failure opening '%s'"), path));
 
       rest = next;

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_neon/fetch.c Fri Jul 30 07:58:20 2010
@@ -1717,8 +1717,10 @@ start_element(int *elem, void *userdata,
       if (! rb->receiving_all)
         break;
 
+      base_checksum = svn_xml_get_attr_value("base-checksum", atts);
+
       SVN_ERR((*rb->editor->apply_textdelta)(rb->file_baton,
-                                             NULL, /* ### base_checksum */
+                                             base_checksum,
                                              rb->file_pool,
                                              &(rb->whandler),
                                              &(rb->whandler_baton)));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c Fri Jul 30 07:58:20 2010
@@ -218,6 +218,9 @@ typedef struct report_info_t
   svn_txdelta_window_handler_t textdelta;
   void *textdelta_baton;
 
+  /* Checksum for close_file */
+  const char *final_checksum;
+
   /* temporary property for this file which is currently being parsed
    * It will eventually be stored in our parent directory's property hash.
    */
@@ -445,6 +448,12 @@ set_file_props(void *baton,
   report_info_t *info = baton;
   const svn_delta_editor_t *editor = info->dir->update_editor;
 
+  if (name_len == 12
+      && ns_len == 39
+      && strcmp(name, "md5-checksum") == 0
+      && strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0)
+    info->final_checksum = apr_pstrdup(info->pool, val->data);
+
   return svn_ra_serf__set_baton_props(editor->change_file_prop,
                                       info->file_baton,
                                       ns, ns_len, name, name_len, val, pool);
@@ -947,7 +956,8 @@ handle_fetch(serf_request_t *request,
                                           info, info->editor_pool);
             }
 
-          err = info->dir->update_editor->close_file(info->file_baton, NULL,
+          err = info->dir->update_editor->close_file(info->file_baton,
+                                                     info->final_checksum,
                                                      info->editor_pool);
 
           if (err)
@@ -1120,7 +1130,8 @@ handle_propchange_only(report_info_t *in
                                   set_file_props, info, info->editor_pool);
     }
 
-  SVN_ERR(info->dir->update_editor->close_file(info->file_baton, NULL,
+  SVN_ERR(info->dir->update_editor->close_file(info->file_baton,
+                                               info->final_checksum,
                                                info->editor_pool));
 
   /* We're done with our pools. */

Modified: subversion/branches/atomic-revprop/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_repos/dump.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_repos/dump.c Fri Jul 30 07:58:20 2010
@@ -210,53 +210,6 @@ make_dir_baton(const char *path,
 }
 
 
-/* For each property in PROPHASH, write headers containing MD5 and SHA1
- * checksums of property content to STREAM.
- * Do temporary allocations in SCRATCH_POOL. */
-static svn_error_t *
-write_prop_content_checksums(svn_stream_t *stream,
-                             apr_hash_t *prophash,
-                             apr_pool_t *scratch_pool)
-{
-  apr_hash_index_t *hi;
-  apr_pool_t *iterpool;
-
-  iterpool = svn_pool_create(scratch_pool);
-  for (hi = apr_hash_first(scratch_pool, prophash);
-       hi;
-       hi = apr_hash_next(hi))
-    {
-      svn_checksum_t *checksum;
-      const char *hex_digest;
-      const char *propname;
-      svn_string_t *propval;
-
-      svn_pool_clear(iterpool);
-
-      propname = svn__apr_hash_index_key(hi);
-      propval = svn__apr_hash_index_val(hi);
-
-      SVN_ERR(svn_checksum(&checksum, svn_checksum_md5,
-                           propval->data, propval->len, iterpool));
-      hex_digest = svn_checksum_to_cstring(checksum, iterpool);
-      if (hex_digest)
-        SVN_ERR(svn_stream_printf(stream, iterpool,
-                                  SVN_REPOS_DUMPFILE_PROP_CONTENT_MD5
-                                  ": (%s) %s\n", propname, hex_digest));
-      SVN_ERR(svn_checksum(&checksum, svn_checksum_sha1,
-                           propval->data, propval->len, iterpool));
-      hex_digest = svn_checksum_to_cstring(checksum, iterpool);
-      if (hex_digest)
-        SVN_ERR(svn_stream_printf(stream, iterpool,
-                                  SVN_REPOS_DUMPFILE_PROP_CONTENT_SHA1
-                                  ": (%s) %s\n", propname, hex_digest));
-    }
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-
 /* This helper is the main "meat" of the editor -- it does all the
    work of writing a node record.
 
@@ -534,7 +487,6 @@ dump_node(struct edit_baton *eb,
       SVN_ERR(svn_stream_printf(eb->stream, pool,
                                 SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH
                                 ": %" APR_SIZE_T_FMT "\n", proplen));
-      SVN_ERR(write_prop_content_checksums(eb->stream, prophash, pool));
     }
 
   /* If we are supposed to dump text, write out a text length header
@@ -966,7 +918,6 @@ write_revision_record(svn_stream_t *stre
                             SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH
                             ": %" APR_SIZE_T_FMT "\n",
                             encoded_prophash->len));
-  SVN_ERR(write_prop_content_checksums(stream, props, pool));
 
   /* Write out a regular Content-length header for the benefit of
      non-Subversion RFC-822 parsers. */

Modified: subversion/branches/atomic-revprop/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_subr/dirent_uri.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_subr/dirent_uri.c Fri Jul 30 07:58:20 2010
@@ -1482,119 +1482,119 @@ svn_uri_get_longest_ancestor(const char 
 }
 
 const char *
-svn_dirent_is_child(const char *dirent1,
-                    const char *dirent2,
+svn_dirent_is_child(const char *parent_dirent,
+                    const char *child_dirent,
                     apr_pool_t *pool)
 {
-  return is_child(type_dirent, dirent1, dirent2, pool);
+  return is_child(type_dirent, parent_dirent, child_dirent, pool);
 }
 
 const char *
-svn_relpath_is_child(const char *relpath1,
-                     const char *relpath2,
+svn_relpath_is_child(const char *parent_relpath,
+                     const char *child_relpath,
                      apr_pool_t *pool)
 {
-  return is_child(type_relpath, relpath1, relpath2, pool);
+  return is_child(type_relpath, parent_relpath, child_relpath, pool);
 }
 
 const char *
-svn_uri_is_child(const char *uri1,
-                 const char *uri2,
+svn_uri_is_child(const char *parent_uri,
+                 const char *child_uri,
                  apr_pool_t *pool)
 {
-  return is_child(type_uri, uri1, uri2, pool);
+  return is_child(type_uri, parent_uri, child_uri, pool);
 }
 
 svn_boolean_t
-svn_dirent_is_ancestor(const char *dirent1, const char *dirent2)
+svn_dirent_is_ancestor(const char *parent_dirent, const char *child_dirent)
 {
-  return is_ancestor(type_dirent, dirent1, dirent2);
+  return is_ancestor(type_dirent, parent_dirent, child_dirent);
 }
 
 svn_boolean_t
-svn_relpath_is_ancestor(const char *relpath1, const char *relpath2)
+svn_relpath_is_ancestor(const char *parent_relpath, const char *child_relpath)
 {
-  return is_ancestor(type_relpath, relpath1, relpath2);
+  return is_ancestor(type_relpath, parent_relpath, child_relpath);
 }
 
 svn_boolean_t
-svn_uri_is_ancestor(const char *uri1, const char *uri2)
+svn_uri_is_ancestor(const char *parent_uri, const char *child_uri)
 {
-  return is_ancestor(type_uri, uri1, uri2);
+  return is_ancestor(type_uri, parent_uri, child_uri);
 }
 
 const char *
-svn_dirent_skip_ancestor(const char *dirent1,
-                         const char *dirent2)
+svn_dirent_skip_ancestor(const char *parent_dirent,
+                         const char *child_dirent)
 {
-  apr_size_t len = strlen(dirent1);
+  apr_size_t len = strlen(parent_dirent);
   apr_size_t root_len;
 
-  if (0 != memcmp(dirent1, dirent2, len))
-    return dirent2; /* dirent1 is no ancestor of dirent2 */
+  if (0 != memcmp(parent_dirent, child_dirent, len))
+    return child_dirent; /* parent_dirent is no ancestor of child_dirent */
 
-  if (dirent2[len] == 0)
-    return ""; /* dirent1 == dirent2 */
+  if (child_dirent[len] == 0)
+    return ""; /* parent_dirent == child_dirent */
 
-  root_len = dirent_root_length(dirent2, strlen(dirent2));
+  root_len = dirent_root_length(child_dirent, strlen(child_dirent));
   if (root_len > len)
-    return dirent2; /* Different root */
+    return child_dirent; /* Different root */
 
-  if (len == 1 && dirent2[0] == '/')
-    return dirent2 + 1;
+  if (len == 1 && child_dirent[0] == '/')
+    return child_dirent + 1;
 
-  if (dirent2[len] == '/')
-    return dirent2 + len + 1;
+  if (child_dirent[len] == '/')
+    return child_dirent + len + 1;
 
 #ifdef SVN_USE_DOS_PATHS
-  if (root_len == len && len > 0 && dirent2[len-1])
-    return dirent2 + len;
+  if (root_len == len && len > 0 && child_dirent[len-1])
+    return child_dirent + len;
 #endif
 
-  return dirent2;
+  return child_dirent;
 }
 
 const char *
-svn_relpath_skip_ancestor(const char *relpath1,
-                         const char *relpath2)
+svn_relpath_skip_ancestor(const char *parent_relpath,
+                          const char *child_relpath)
 {
-  apr_size_t len = strlen(relpath1);
+  apr_size_t len = strlen(parent_relpath);
 
-  if (0 != memcmp(relpath1, relpath2, len))
-    return relpath2; /* relpath1 is no ancestor of relpath2 */
+  if (0 != memcmp(parent_relpath, child_relpath, len))
+    return child_relpath; /* parent_relpath is no ancestor of child_relpath */
 
-  if (relpath2[len] == 0)
-    return ""; /* relpath1 == relpath2 */
+  if (child_relpath[len] == 0)
+    return ""; /* parent_relpath == child_relpath */
 
-  if (len == 1 && relpath2[0] == '/')
-    return relpath2 + 1;
+  if (len == 1 && child_relpath[0] == '/')
+    return child_relpath + 1;
 
-  if (relpath2[len] == '/')
-    return relpath2 + len + 1;
+  if (child_relpath[len] == '/')
+    return child_relpath + len + 1;
 
-  return relpath2;
+  return child_relpath;
 }
 
 
 const char *
-svn_uri_skip_ancestor(const char *uri1,
-                      const char *uri2)
+svn_uri_skip_ancestor(const char *parent_uri,
+                      const char *child_uri)
 {
-  apr_size_t len = strlen(uri1);
+  apr_size_t len = strlen(parent_uri);
 
-  if (0 != memcmp(uri1, uri2, len))
-    return uri2; /* dirent1 is no ancestor of dirent2 */
+  if (0 != memcmp(parent_uri, child_uri, len))
+    return child_uri; /* parent_uri is no ancestor of child_uri */
 
-  if (uri2[len] == 0)
-    return ""; /* dirent1 == dirent2 */
+  if (child_uri[len] == 0)
+    return ""; /* parent_uri == child_uri */
 
-  if (len == 1 && uri2[0] == '/')
-    return uri2 + 1;
+  if (len == 1 && child_uri[0] == '/')
+    return child_uri + 1;
 
-  if (len > 0 && uri2[len] == '/')
-    return uri2 + len + 1;
+  if (len > 0 && child_uri[len] == '/')
+    return child_uri + len + 1;
 
-  return uri2;
+  return child_uri;
 }
 
 svn_boolean_t

Modified: subversion/branches/atomic-revprop/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_subr/io.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_subr/io.c Fri Jul 30 07:58:20 2010
@@ -222,14 +222,7 @@ io_check_path(const char *path,
 
   if (APR_STATUS_IS_ENOENT(apr_err))
     *kind = svn_node_none;
-  else if (APR_STATUS_IS_ENOTDIR(apr_err)
-#ifdef WIN32
-           /* On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of
-            * invalid-pathname error but not this one, so we include it. */
-           /* ### This fix should go into APR. */
-           || (APR_TO_OS_ERROR(apr_err) == ERROR_INVALID_NAME)
-#endif
-           )
+  else if (SVN__APR_STATUS_IS_ENOTDIR(apr_err))
     *kind = svn_node_none;
   else if (apr_err)
     return svn_error_wrap_apr(apr_err, _("Can't check path '%s'"),
@@ -2083,14 +2076,7 @@ svn_io_stat_dirent(const svn_io_dirent2_
 
   if (err && ignore_enoent && 
       (APR_STATUS_IS_ENOENT(err->apr_err)
-       || APR_STATUS_IS_ENOTDIR(err->apr_err)
-#ifdef WIN32
-           /* On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of
-            * invalid-pathname error but not this one, so we include it. */
-           /* ### This fix should go into APR. */
-           || (APR_TO_OS_ERROR(err->apr_err) == ERROR_INVALID_NAME)
-#endif
-      ))
+       || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)))
     {
       svn_error_clear(err);
       dirent = svn_io_dirent2_create(result_pool);

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c Fri Jul 30 07:58:20 2010
@@ -113,15 +113,25 @@ restore_node(svn_boolean_t *restored,
 {
   *restored = FALSE;
 
-  /* Currently we can only restore files, but we will be able to restore
-     directories after we move to a single database and pristine store. */
   if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
     {
-      /* ... recreate file from text-base, and ... */
+      /* Recreate file from text-base */
       SVN_ERR(restore_file(db, local_abspath, use_commit_times,
                            scratch_pool));
 
       *restored = TRUE;
+    }
+#ifdef SVN_WC__SINGLE_DB
+  else if (kind == svn_wc__db_kind_dir)
+    {
+      /* Recreating a directory is just a mkdir */
+      SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
+      *restored = TRUE;
+    }
+#endif
+
+  if (*restored)
+    {
       /* ... report the restoration to the caller.  */
       if (notify_func != NULL)
         {
@@ -233,6 +243,7 @@ report_revisions_and_depths(svn_wc__db_t
   int i;
   const char *dir_repos_root, *dir_repos_relpath;
   svn_depth_t dir_depth;
+  svn_error_t *err;
 
 
   /* Get both the SVN Entries and the actual on-disk entries.   Also
@@ -241,8 +252,18 @@ report_revisions_and_depths(svn_wc__db_t
   dir_abspath = svn_dirent_join(anchor_abspath, dir_path, scratch_pool);
   SVN_ERR(svn_wc__db_base_get_children(&base_children, db, dir_abspath,
                                        scratch_pool, iterpool));
-  SVN_ERR(svn_io_get_dirents3(&dirents, dir_abspath, TRUE,
-                              scratch_pool, scratch_pool));
+
+  err = svn_io_get_dirents3(&dirents, dir_abspath, TRUE,
+                            scratch_pool, scratch_pool);
+
+  if (err && (APR_STATUS_IS_ENOENT(err->apr_err)
+              || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)))
+    {
+      svn_error_clear(err);
+      dirents = apr_hash_make(scratch_pool);
+    }
+  else
+    SVN_ERR(err);
 
   /*** Do the real reporting and recursing. ***/
 
@@ -279,7 +300,6 @@ report_revisions_and_depths(svn_wc__db_t
       svn_depth_t this_depth;
       svn_wc__db_lock_t *this_lock;
       svn_boolean_t this_switched;
-      svn_error_t *err;
 
       /* Clear the iteration subpool here because the loop has a bunch
          of 'continue' jump statements. */
@@ -393,10 +413,25 @@ report_revisions_and_depths(svn_wc__db_t
                                        NULL, NULL,
                                        db, this_abspath, iterpool, iterpool));
 
-          if (restore_files && wrk_status != svn_wc__db_status_added
+          if (wrk_status == svn_wc__db_status_added)
+            SVN_ERR(svn_wc__db_scan_addition(&wrk_status, NULL, NULL, NULL,
+                                             NULL, NULL, NULL, NULL, NULL,
+                                             db, this_abspath,
+                                             iterpool, iterpool));
+
+#ifndef SVN_WC__SINGLE_DB
+          if (wrk_status == svn_wc__db_status_obstructed
+              || wrk_status == svn_wc__db_status_obstructed_add
+              || wrk_status == svn_wc__db_status_obstructed_delete)
+            missing = TRUE;
+          else
+#endif
+          if (restore_files
+              && wrk_status != svn_wc__db_status_added
               && wrk_status != svn_wc__db_status_deleted
-              && wrk_status != svn_wc__db_status_obstructed_add
-              && wrk_status != svn_wc__db_status_obstructed_delete)
+              && wrk_status != svn_wc__db_status_excluded
+              && wrk_status != svn_wc__db_status_not_present
+              && wrk_status != svn_wc__db_status_absent)
             {
               svn_node_kind_t dirent_kind;
 
@@ -417,9 +452,7 @@ report_revisions_and_depths(svn_wc__db_t
                     missing = TRUE;
                 }
             }
-          else
-            missing = TRUE;
-
+#ifndef SVN_WC__SINGLE_DB
           /* If a node is still missing from disk here, we have no way to
              recreate it locally, so report as missing and move along.
              Again, don't bother if we're reporting everything, because the
@@ -432,6 +465,11 @@ report_revisions_and_depths(svn_wc__db_t
                                               iterpool));
               continue;
             }
+#else
+          /* With single-db, we always know about all children, so
+             never tell the server that we don't know, but want to know
+             about the missing child. */
+#endif
         }
 
       /* And finally prepare for reporting */
@@ -725,6 +763,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   const char *repos_relpath=NULL, *repos_root=NULL;
   svn_depth_t target_depth = svn_depth_unknown;
   svn_wc__db_lock_t *target_lock = NULL;
+  svn_node_kind_t disk_kind;
   svn_boolean_t explicit_rev;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -852,45 +891,69 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   if (target_depth == svn_depth_unknown)
     target_depth = svn_depth_infinity;
 
-  /* The first call to the reporter merely informs it that the
-     top-level directory being updated is at BASE_REV.  Its PATH
-     argument is ignored. */
-  SVN_ERR(reporter->set_path(report_baton, "", target_rev, target_depth,
-                             start_empty, NULL, scratch_pool));
+  SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
 
-  /* ### status can NEVER be deleted. should examine why this was
-     ### ever here. we may have remapped into wc-ng incorrectly.  */
-  if (status != svn_wc__db_status_deleted)
+  /* Determine if there is a missing node that should be restored */
+  if (disk_kind == svn_node_none)
     {
-      apr_finfo_t info;
-      err = svn_io_stat(&info, local_abspath, APR_FINFO_MIN, scratch_pool);
-      if (err)
+      svn_wc__db_status_t wrk_status;
+      err = svn_wc__db_read_info(&wrk_status, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL,
+                                 db, local_abspath,
+                                 scratch_pool, scratch_pool);
+
+
+      if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
         {
-          if (APR_STATUS_IS_ENOENT(err->apr_err))
-            missing = TRUE;
           svn_error_clear(err);
-          err = NULL;
+          wrk_status = svn_wc__db_status_not_present;
         }
-    }
+      else
+        SVN_ERR(err);
 
-  if (missing && restore_files)
-    {
-      svn_boolean_t restored;
+      if (wrk_status == svn_wc__db_status_added)
+        SVN_ERR(svn_wc__db_scan_addition(&wrk_status, NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL,
+                                         db, local_abspath,
+                                         scratch_pool, scratch_pool));
 
-      err = restore_node(&restored, wc_ctx->db, local_abspath,
-                         target_kind, use_commit_times,
-                         notify_func, notify_baton,
-                         scratch_pool);
+#ifndef SVN_WC__SINGLE_DB
+      if (wrk_status == svn_wc__db_status_obstructed
+          || wrk_status == svn_wc__db_status_obstructed_add
+          || wrk_status == svn_wc__db_status_obstructed_delete)
+        missing = TRUE;
+      else
+#endif
+      if (restore_files
+          && wrk_status != svn_wc__db_status_added
+          && wrk_status != svn_wc__db_status_deleted
+          && wrk_status != svn_wc__db_status_excluded
+          && wrk_status != svn_wc__db_status_not_present
+          && wrk_status != svn_wc__db_status_absent)
+        {
+          svn_boolean_t restored;
 
-      if (err)
-          goto abort_report;
+          SVN_ERR(restore_node(&restored, wc_ctx->db, local_abspath,
+                               target_kind, use_commit_times,
+                               notify_func, notify_baton,
+                               scratch_pool));
 
-      if (restored)
-        missing = FALSE;
+          if (!restored)
+            missing = TRUE;
+        }
     }
 
+  /* The first call to the reporter merely informs it that the
+     top-level directory being updated is at BASE_REV.  Its PATH
+     argument is ignored. */
+  SVN_ERR(reporter->set_path(report_baton, "", target_rev, target_depth,
+                             start_empty, NULL, scratch_pool));
+
   if (target_kind == svn_wc__db_kind_dir)
     {
+#ifndef SVN_WC__SINGLE_DB
       if (missing)
         {
           /* Report missing directories as deleted to retrieve them
@@ -899,7 +962,9 @@ svn_wc_crawl_revisions5(svn_wc_context_t
           if (err)
             goto abort_report;
         }
-      else if (depth != svn_depth_empty)
+      else
+#endif
+      if (depth != svn_depth_empty)
         {
           /* Recursively crawl ROOT_DIRECTORY and report differing
              revisions. */

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.c Fri Jul 30 07:58:20 2010
@@ -483,49 +483,6 @@ svn_wc__get_pristine_text_status(apr_fin
 }
 
 
-svn_error_t *
-svn_wc__prop_path(const char **prop_path,
-                  const char *path,
-                  svn_wc__db_kind_t node_kind,
-                  svn_wc__props_kind_t props_kind,
-                  apr_pool_t *pool)
-{
-  if (node_kind == svn_wc__db_kind_dir)
-    {
-      static const char * names[] = {
-        SVN_WC__ADM_DIR_PROP_BASE,    /* svn_wc__props_base */
-        SVN_WC__ADM_DIR_PROP_REVERT,  /* svn_wc__props_revert */
-        SVN_WC__ADM_DIR_PROPS         /* svn_wc__props_working */
-      };
-
-      *prop_path = simple_extend(path, FALSE, NULL, names[props_kind], NULL,
-                                 pool);
-    }
-  else  /* It's a file */
-    {
-      static const char * extensions[] = {
-        SVN_WC__BASE_EXT,     /* svn_wc__props_base */
-        SVN_WC__REVERT_EXT,   /* svn_wc__props_revert */
-        SVN_WC__WORK_EXT      /* svn_wc__props_working */
-      };
-
-      static const char * dirs[] = {
-        SVN_WC__ADM_PROP_BASE,  /* svn_wc__props_base */
-        SVN_WC__ADM_PROP_BASE,  /* svn_wc__props_revert */
-        SVN_WC__ADM_PROPS       /* svn_wc__props_working */
-      };
-
-      const char *base_name;
-
-      svn_dirent_split(prop_path, &base_name, path, pool);
-      *prop_path = simple_extend(*prop_path, FALSE, dirs[props_kind],
-                                 base_name, extensions[props_kind], pool);
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
 /*** Opening and closing files in the adm area. ***/
 
 svn_error_t *
@@ -587,14 +544,6 @@ init_adm_tmp_area(const char *path, apr_
   /* SVN_WC__ADM_TMP */
   SVN_ERR(make_adm_subdir(path, SVN_WC__ADM_TMP, FALSE, pool));
 
-#if (SVN_WC__VERSION < 18)
-  /* SVN_WC__ADM_TMP/SVN_WC__ADM_PROP_BASE */
-  SVN_ERR(make_adm_subdir(path, SVN_WC__ADM_PROP_BASE, TRUE, pool));
-
-  /* SVN_WC__ADM_TMP/SVN_WC__ADM_PROPS */
-  SVN_ERR(make_adm_subdir(path, SVN_WC__ADM_PROPS, TRUE, pool));
-#endif
-
   return SVN_NO_ERROR;
 }
 
@@ -619,14 +568,6 @@ init_adm(svn_wc__db_t *db,
 
   /** Make subdirectories. ***/
 
-#if (SVN_WC__VERSION < 18)
-  /* SVN_WC__ADM_PROP_BASE */
-  SVN_ERR(make_adm_subdir(local_abspath, SVN_WC__ADM_PROP_BASE, FALSE, pool));
-
-  /* SVN_WC__ADM_PROPS */
-  SVN_ERR(make_adm_subdir(local_abspath, SVN_WC__ADM_PROPS, FALSE, pool));
-#endif
-
   /* SVN_WC__ADM_PRISTINE */
   SVN_ERR(make_adm_subdir(local_abspath, SVN_WC__ADM_PRISTINE, FALSE, pool));
 
@@ -739,23 +680,38 @@ svn_wc_ensure_adm4(svn_wc_context_t *wc_
 svn_error_t *
 svn_wc__adm_destroy(svn_wc__db_t *db,
                     const char *dir_abspath,
+                    svn_cancel_func_t cancel_func,
+                    void *cancel_baton,
                     apr_pool_t *scratch_pool)
 {
-#ifndef SINGLE_DB
   const char *adm_abspath;
-#endif
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
   SVN_ERR(svn_wc__write_check(db, dir_abspath, scratch_pool));
 
+#ifdef SVN_WC__SINGLE_DB
+  SVN_ERR(svn_wc__db_get_wcroot(&adm_abspath, db, dir_abspath,
+                                scratch_pool, scratch_pool));
+#endif
+
+
   /* Well, the coast is clear for blowing away the administrative
      directory, which also removes the lock */
   SVN_ERR(svn_wc__db_temp_forget_directory(db, dir_abspath, scratch_pool));
 
-#ifndef SINGLE_DB
+#ifndef SVN_WC__SINGLE_DB
   adm_abspath = svn_wc__adm_child(dir_abspath, NULL, scratch_pool);
   SVN_ERR(svn_io_remove_dir2(adm_abspath, FALSE, NULL, NULL, scratch_pool));
+#else
+  /* ### We should check if we are the only user of this DB!!! */
+
+  if (strcmp(adm_abspath, dir_abspath) == 0)
+    SVN_ERR(svn_io_remove_dir2(svn_wc__adm_child(adm_abspath, NULL,
+                                                 scratch_pool),
+                               FALSE,
+                               cancel_func, cancel_baton,
+                               scratch_pool));
 #endif
 
   return SVN_NO_ERROR;

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.h?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_files.h Fri Jul 30 07:58:20 2010
@@ -90,16 +90,6 @@ svn_wc__get_ultimate_base_contents(svn_s
                                    apr_pool_t *scratch_pool);
 
 
-/* Set *PROP_PATH to PATH's PROPS_KIND properties file.
-   PATH can be a directory or file, and even have changed w.r.t. the
-   working copy's adm knowledge. Valid values for NODE_KIND are svn_node_dir
-   and svn_node_file. */
-svn_error_t *svn_wc__prop_path(const char **prop_path,
-                               const char *path,
-                               svn_wc__db_kind_t node_kind,
-                               svn_wc__props_kind_t props_kind,
-                               apr_pool_t *pool);
-
 /* Set *RESULT_ABSPATH to the absolute path to a readable file containing
    the WC-1 "normal text-base" of LOCAL_ABSPATH in DB.
 
@@ -224,9 +214,13 @@ svn_wc__open_writable_base(svn_stream_t 
                            apr_pool_t *scratch_pool);
 
 
-/* Blow away the admistrative directory associated with DIR_ABSPATH */
+/* Blow away the admistrative directory associated with DIR_ABSPATH.
+   For single-db this doesn't perform actual work unless the wcroot is passed.
+ */
 svn_error_t *svn_wc__adm_destroy(svn_wc__db_t *db,
                                  const char *dir_abspath,
+                                 svn_cancel_func_t cancel_func,
+                                 void *cancel_baton,
                                  apr_pool_t *scratch_pool);
 
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c Fri Jul 30 07:58:20 2010
@@ -160,30 +160,6 @@ process_committed_leaf(svn_wc__db_t *db,
                                 scratch_pool));
     }
 
-#if (SVN_WC__VERSION < SVN_WC__PROPS_IN_DB)
-  /* Queue a removal of any "revert" properties now. These correspond to
-     the BASE properties, but hidden by new pristine props in WORKING.
-     Regardless, the commit will be installing new BASE props.  */
-  /* ### this goes away once props are fully in the database  */
-  {
-    const char *revert_props_abspath;
-    svn_skel_t *work_item;
-
-    /* ### this breaks the abstraction of svn_wc__props_delete, but
-       ### screw it. this is transitional code.  */
-    /* ### what happens if the node changes its KIND? should be okay
-       ### since we disallow that today, and props should be in the DB
-       ### by the time that we DO allow that.  */
-    SVN_ERR(svn_wc__prop_path(&revert_props_abspath, local_abspath, kind,
-                              svn_wc__props_revert, scratch_pool));
-
-    SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
-                                         db, revert_props_abspath,
-                                         scratch_pool, scratch_pool));
-    SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
-  }
-#endif
-
   /* ### this picks up file and symlink  */
   if (kind != svn_wc__db_kind_dir)
     {
@@ -551,25 +527,29 @@ svn_wc_process_committed_queue2(svn_wc_c
  * from the physical filesystem. PATH is assumed to be an unversioned file
  * or directory.
  *
+ * If ignore_enoent is TRUE, ignore missing targets.
+ *
  * If CANCEL_FUNC is non-null, invoke it with CANCEL_BATON at various
  * points, return any error immediately.
  */
 static svn_error_t *
 erase_unversioned_from_wc(const char *path,
+                          svn_boolean_t ignore_enoent,
                           svn_cancel_func_t cancel_func,
                           void *cancel_baton,
-                          apr_pool_t *pool)
+                          apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
 
   /* Optimize the common case: try to delete the file */
-  err = svn_io_remove_file2(path, FALSE, pool);
+  err = svn_io_remove_file2(path, ignore_enoent, scratch_pool);
   if (err)
     {
       /* Then maybe it was a directory? */
       svn_error_clear(err);
 
-      err = svn_io_remove_dir2(path, FALSE, cancel_func, cancel_baton, pool);
+      err = svn_io_remove_dir2(path, ignore_enoent, cancel_func, cancel_baton,
+                               scratch_pool);
 
       if (err)
         {
@@ -579,20 +559,22 @@ erase_unversioned_from_wc(const char *pa
           svn_node_kind_t kind;
 
           svn_error_clear(err);
-          SVN_ERR(svn_io_check_path(path, &kind, pool));
+          SVN_ERR(svn_io_check_path(path, &kind, scratch_pool));
           if (kind == svn_node_file)
-            SVN_ERR(svn_io_remove_file2(path, FALSE, pool));
+            SVN_ERR(svn_io_remove_file2(path, ignore_enoent, scratch_pool));
           else if (kind == svn_node_dir)
-            SVN_ERR(svn_io_remove_dir2(path, FALSE,
-                                       cancel_func, cancel_baton, pool));
+            SVN_ERR(svn_io_remove_dir2(path, ignore_enoent,
+                                       cancel_func, cancel_baton,
+                                       scratch_pool));
           else if (kind == svn_node_none)
             return svn_error_createf(SVN_ERR_BAD_FILENAME, NULL,
                                      _("'%s' does not exist"),
-                                     svn_dirent_local_style(path, pool));
+                                     svn_dirent_local_style(path,
+                                                            scratch_pool));
           else
             return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                      _("Unsupported node kind for path '%s'"),
-                                     svn_dirent_local_style(path, pool));
+                                     svn_dirent_local_style(path, scratch_pool));
 
         }
     }
@@ -600,6 +582,7 @@ erase_unversioned_from_wc(const char *pa
   return SVN_NO_ERROR;
 }
 
+#ifndef SVN_WC__SINGLE_DB
 /* Remove/erase LOCAL_ABSPATH from the working copy. For files this involves
  * deletion from the physical filesystem.  For directories it involves the
  * deletion from the filesystem of all unversioned children, and all
@@ -692,8 +675,8 @@ erase_from_wc(svn_wc__db_t *db,
         {
           svn_pool_destroy(iterpool);
 
-          if (APR_STATUS_IS_ENOTDIR(err->apr_err) ||
-              APR_STATUS_IS_ENOENT(err->apr_err))
+          if (APR_STATUS_IS_ENOENT(err->apr_err) ||
+              SVN__APR_STATUS_IS_ENOTDIR(err->apr_err))
             {
               svn_error_clear(err);
               return SVN_NO_ERROR;
@@ -720,6 +703,7 @@ erase_from_wc(svn_wc__db_t *db,
 
           SVN_ERR(erase_unversioned_from_wc(svn_dirent_join(local_abspath,
                                                             name, iterpool),
+                                            FALSE,
                                             cancel_func, cancel_baton,
                                             iterpool));
         }
@@ -729,7 +713,7 @@ erase_from_wc(svn_wc__db_t *db,
 
   return SVN_NO_ERROR;
 }
-
+#endif
 
 svn_error_t *
 svn_wc_delete4(svn_wc_context_t *wc_ctx,
@@ -743,8 +727,7 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
                apr_pool_t *pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
-  svn_boolean_t was_add = FALSE, was_replace = FALSE;
-  svn_boolean_t was_copied = FALSE;
+  svn_boolean_t was_add = FALSE;
   svn_error_t *err;
   svn_wc__db_status_t status;
   svn_wc__db_kind_t kind;
@@ -762,7 +745,7 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
       svn_error_clear(err);
 
       if (!keep_local)
-        SVN_ERR(erase_unversioned_from_wc(local_abspath,
+        SVN_ERR(erase_unversioned_from_wc(local_abspath, FALSE,
                                           cancel_func, cancel_baton,
                                           pool));
       return SVN_NO_ERROR;
@@ -791,9 +774,6 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
                                        NULL, NULL, NULL, NULL,  NULL,
                                        db, local_abspath, pool, pool));
 
-      was_copied = (status == svn_wc__db_status_copied ||
-                    status == svn_wc__db_status_moved_here);
-
       if (!have_base)
         was_add = strcmp(op_root_abspath, local_abspath) == 0;
       else
@@ -804,9 +784,7 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
                                            NULL, NULL, NULL, NULL, NULL,
                                            db, local_abspath, pool, pool));
 
-          if (base_status != svn_wc__db_status_not_present)
-            was_replace = TRUE;
-          else
+          if (base_status == svn_wc__db_status_not_present)
             was_add = TRUE;
         }
     }
@@ -848,22 +826,16 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
   /* ### Maybe we should disallow deleting switched nodes here? */
 
     {
-      const char *parent_abspath = svn_dirent_dirname(local_abspath, pool);
-
       /* ### The following two operations should be inside one SqLite
              transaction. For even better behavior the tree operation
              before this block needs the same handling.
              Luckily most of this is for free once properties and pristine
              are handled in the WC-NG way. */
       SVN_ERR(svn_wc__db_temp_op_delete(wc_ctx->db, local_abspath, pool));
+#ifndef SVN_WC__SINGLE_DB
       if (keep_local)
         SVN_ERR(svn_wc__db_temp_set_keep_local(db, local_abspath, TRUE, pool));
-      SVN_ERR(svn_wc__wq_add_delete(wc_ctx->db, parent_abspath, local_abspath,
-                                    kind, was_add, was_copied, was_replace,
-                                    pool));
-
-      SVN_ERR(svn_wc__wq_run(db, parent_abspath, cancel_func, cancel_baton,
-                             pool));
+#endif
     }
 
   /* Report the deletion to the caller. */
@@ -890,13 +862,15 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
      become unversioned */
   if (!keep_local)
     {
-      if (was_add)
-        SVN_ERR(erase_unversioned_from_wc(local_abspath,
-                                          cancel_func, cancel_baton,
-                                          pool));
-      else
+#ifndef SVN_WC__SINGLE_DB
+      if (!was_add)
         SVN_ERR(erase_from_wc(wc_ctx->db, local_abspath, kind,
                               cancel_func, cancel_baton, pool));
+      else
+#endif
+        SVN_ERR(erase_unversioned_from_wc(local_abspath, TRUE,
+                                          cancel_func, cancel_baton,
+                                          pool));
     }
 
   return SVN_NO_ERROR;
@@ -1198,30 +1172,6 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
     }
 #endif
 
-#if (SVN_WC__VERSION < SVN_WC__PROPS_IN_DB)
-  /* ### this is totally bogus. we clear these cuz turds might have been
-     ### left around. Thankfully, this will gone soon... */
-  if (!is_wc_root && (node_exists || is_replace))
-    SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_working,
-                                 scratch_pool));
-#endif
-
-#if SVN_WC__VERSION < SVN_WC__PROPS_IN_DB
-    if (is_replace)
-      {
-        /* We don't want the old base text (if any) and base props to be
-           mistakenly used as the bases for the new, replacement object.
-           So, move them out of the way. */
-
-        /* ### TODO: In an ideal world, this whole function would be loggy.
-           ### Thankfully this code will be gone soon. */
-        SVN_ERR(svn_wc__wq_prepare_revert_files(db, local_abspath,
-                                                scratch_pool));
-        SVN_ERR(svn_wc__wq_run(db, local_abspath,
-                               cancel_func, cancel_baton, scratch_pool));
-      }
-#endif
-
   if (kind == svn_node_file)
     {
       if (!copyfrom_url)
@@ -1256,10 +1206,10 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
 
              ### Perhaps the lock should be created in the same
              transaction that adds the node? */
-          svn_boolean_t locked;
-          SVN_ERR(svn_wc_locked2(&locked, NULL, wc_ctx, local_abspath,
-                                 scratch_pool));
-          if (!locked)
+          svn_boolean_t owns_lock;
+          SVN_ERR(svn_wc__db_wclock_owns_lock(&owns_lock, db, local_abspath,
+                                              FALSE, scratch_pool));
+          if (!owns_lock)
             SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE,
                                              scratch_pool));
         }
@@ -1286,12 +1236,13 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                    scratch_pool));
   else
     {
+      svn_boolean_t owns_lock;
+#ifndef SVN_WC__SINGLE_DB
       svn_wc__db_status_t absent_status;
       svn_wc__db_kind_t absent_kind;
       const char *absent_repos_relpath, *absent_repos_root_url;
       const char *absent_repos_uuid;
       svn_revnum_t absent_revision;
-      svn_boolean_t owns_lock;
 
       /* Read the not present status from the parent working copy,
          to reinsert it after hooking up the child working copy */
@@ -1335,6 +1286,35 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
                                                 scratch_pool));
       else
         SVN_ERR(svn_wc__db_base_remove(db, local_abspath, scratch_pool));
+#else
+      const char *tmpdir_abspath, *moved_abspath, *moved_adm_abspath;
+      const char *adm_abspath = svn_wc__adm_child(local_abspath, "",
+                                                  scratch_pool);
+
+      /* Drop any references to the wc that is to be rewritten */
+      SVN_ERR(svn_wc__db_drop_root(db, local_abspath, scratch_pool));
+
+      /* Move the admin dir from the wc to a temporary location */
+      SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
+                                             parent_abspath,
+                                             scratch_pool, scratch_pool));
+      SVN_ERR(svn_io_open_unique_file3(NULL, &moved_abspath, tmpdir_abspath,
+                                       svn_io_file_del_on_close,
+                                       scratch_pool, scratch_pool));
+      SVN_ERR(svn_io_dir_make(moved_abspath, APR_OS_DEFAULT, scratch_pool));
+      moved_adm_abspath = svn_wc__adm_child(moved_abspath, "", scratch_pool);
+      SVN_ERR(svn_io_file_move(adm_abspath, moved_adm_abspath, scratch_pool));
+
+      /* Copy entries from temporary location into the main db */
+      SVN_ERR(svn_wc_copy3(wc_ctx, moved_abspath, local_abspath,
+                           TRUE /* metadata_only */,
+                           NULL, NULL, NULL, NULL, scratch_pool));
+
+      /* Cleanup the temporary admin dir */
+      SVN_ERR(svn_wc__db_drop_root(db, moved_abspath, scratch_pool));
+      SVN_ERR(svn_io_remove_dir2(moved_abspath, FALSE, NULL, NULL,
+                                 scratch_pool));
+#endif
 
       /* The subdir is now part of our parent working copy. Our caller assumes
          that we return the new node locked, so obtain a lock if we didn't
@@ -2016,14 +1996,6 @@ svn_wc__internal_remove_from_revision_co
       else
         SVN_ERR(err);
 
-#if (SVN_WC__VERSION < SVN_WC__PROPS_IN_DB)
-      /* Remove prop/NAME, prop-base/NAME.svn-base. */
-      SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_working,
-                                   scratch_pool));
-      SVN_ERR(svn_wc__props_delete(db, local_abspath, svn_wc__props_base,
-                                   scratch_pool));
-#endif
-
       /* Remove NAME from PATH's entries file: */
       SVN_ERR(svn_wc__db_temp_op_remove_entry(db, local_abspath,
                                               scratch_pool));
@@ -2142,7 +2114,8 @@ svn_wc__internal_remove_from_revision_co
 
       /* Remove the entire administrative .svn area, thereby removing
          _this_ dir from revision control too.  */
-      SVN_ERR(svn_wc__adm_destroy(db, local_abspath, iterpool));
+      SVN_ERR(svn_wc__adm_destroy(db, local_abspath,
+                                  cancel_func, cancel_baton, iterpool));
 
       /* If caller wants us to recursively nuke everything on disk, go
          ahead, provided that there are no dangling local-mod files

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/copy.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/copy.c Fri Jul 30 07:58:20 2010
@@ -127,6 +127,7 @@ static svn_error_t *
 copy_versioned_file(svn_wc__db_t *db,
                     const char *src_abspath,
                     const char *dst_abspath,
+                    svn_boolean_t metadata_only,
                     svn_cancel_func_t cancel_func,
                     void *cancel_baton,
                     svn_wc_notify_func2_t notify_func,
@@ -140,33 +141,9 @@ copy_versioned_file(svn_wc__db_t *db,
   const char *tmp_dst_abspath;
   svn_node_kind_t kind;
 
-  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
-                                         dst_abspath,
+  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db, dst_abspath,
                                          scratch_pool, scratch_pool));
 
-  
-  /* This goes away when we stop using revert bases. */
-  {
-    svn_wc__db_status_t dst_status; 
-    svn_boolean_t will_replace;
-    svn_error_t *err;
-
-    err = svn_wc__db_read_info(&dst_status,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL,
-                               db, dst_abspath,
-                               scratch_pool, scratch_pool);
-    if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-      return svn_error_return(err);
-    will_replace = (!err && dst_status == svn_wc__db_status_deleted);
-    svn_error_clear(err);
-    if (will_replace)
-      SVN_ERR(svn_wc__wq_prepare_revert_files(db, dst_abspath,
-                                              scratch_pool));
-  }
-
   /* This goes away when we centralise, but until then we might need
      to do a cross-db pristine copy. */
   if (strcmp(svn_dirent_dirname(src_abspath, scratch_pool),
@@ -208,61 +185,29 @@ copy_versioned_file(svn_wc__db_t *db,
                                          tmpdir_abspath, svn_io_file_del_none,
                                          scratch_pool, scratch_pool));
           SVN_ERR(svn_stream_copy3(src_pristine, tmp_pristine,
-                                   cancel_func, cancel_baton, scratch_pool));
+                                   cancel_func, cancel_baton,
+                                   scratch_pool));
           SVN_ERR(svn_wc__db_pristine_install(db, tmp_pristine_abspath,
                                               sha1_checksum, md5_checksum,
                                               scratch_pool));
         }
     }
 
-#if (SVN_WC__VERSION < SVN_WC__PROPS_IN_DB)
-  /* This goes away when we move to in-db-props. */
-  {
-    apr_hash_t *src_props;
-
-    SVN_ERR(svn_wc__get_pristine_props(&src_props, db, src_abspath,
-                                       scratch_pool, scratch_pool));
-    if (src_props && apr_hash_count(src_props))
-      {
-        svn_skel_t *work_item;
-        const char *props_abspath;
-
-        SVN_ERR(svn_wc__prop_path(&props_abspath, dst_abspath, 
-                                  svn_wc__db_kind_file, svn_wc__props_base,
-                                  scratch_pool));
-        SVN_ERR(svn_wc__wq_build_write_old_props(&work_item, props_abspath,
-                                                 src_props, scratch_pool));
-        work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-      }
-
-    SVN_ERR(svn_wc__get_actual_props(&src_props, db, src_abspath,
-                                     scratch_pool, scratch_pool));
-    if (src_props && apr_hash_count(src_props))
-      {
-        svn_skel_t *work_item;
-        const char *props_abspath;
-
-        SVN_ERR(svn_wc__prop_path(&props_abspath, dst_abspath, 
-                                  svn_wc__db_kind_file, svn_wc__props_working,
-                                  scratch_pool));
-        SVN_ERR(svn_wc__wq_build_write_old_props(&work_item, props_abspath,
-                                                 src_props, scratch_pool));
-        work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-      }
-  }
-#endif
-
-  SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &kind, src_abspath, tmpdir_abspath,
-                         TRUE, /* recursive */
-                         cancel_func, cancel_baton, scratch_pool));
-  if (tmp_dst_abspath)
+  if (!metadata_only)
     {
-      svn_skel_t *work_item;
+      SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &kind, src_abspath,
+                             tmpdir_abspath,
+                             TRUE, /* recursive */
+                             cancel_func, cancel_baton, scratch_pool));
+      if (tmp_dst_abspath)
+        {
+          svn_skel_t *work_item;
 
-      SVN_ERR(svn_wc__wq_build_file_move(&work_item, db,
-                                         tmp_dst_abspath, dst_abspath,
-                                         scratch_pool, scratch_pool));
-      work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+          SVN_ERR(svn_wc__wq_build_file_move(&work_item, db,
+                                             tmp_dst_abspath, dst_abspath,
+                                             scratch_pool, scratch_pool));
+          work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+        }
     }
 
   SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
@@ -285,6 +230,7 @@ static svn_error_t *
 copy_versioned_dir(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
+                   svn_boolean_t metadata_only,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    svn_wc_notify_func2_t notify_func,
@@ -301,89 +247,111 @@ copy_versioned_dir(svn_wc__db_t *db,
   apr_pool_t *iterpool;
   int i;
 
-  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
-                                         dst_abspath,
-                                         scratch_pool, scratch_pool));
-
-  SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &kind, src_abspath, tmpdir_abspath,
-                         FALSE, /* recursive */
-                         cancel_func, cancel_baton, scratch_pool));
-  if (tmp_dst_abspath)
+  if (!metadata_only)
     {
-      svn_skel_t *work_item;
-
-      SVN_ERR(svn_wc__wq_build_file_move(&work_item, db,
-                                         tmp_dst_abspath, dst_abspath,
-                                         scratch_pool, scratch_pool));
-      work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+      SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
+                                             dst_abspath,
+                                             scratch_pool, scratch_pool));
 
-#ifndef SVN_WC__SINGLE_DB
-      if (kind == svn_node_dir)
+      SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &kind, src_abspath,
+                             tmpdir_abspath, FALSE, /* recursive */
+                             cancel_func, cancel_baton, scratch_pool));
+      if (tmp_dst_abspath)
         {
-          /* Create the per-directory db in the copied directory.  The
-             copy is not yet connected to the parent so we don't need
-             to use a workqueue.  This will be removed when we
-             centralise. */
-          const char *dst_parent_abspath, *name;
-          const char *repos_root_url, *repos_uuid;
-          svn_revnum_t revision;
-          svn_depth_t depth;
-          svn_wc__db_status_t status;
-          svn_boolean_t have_base;
-
-          svn_dirent_split(&dst_parent_abspath, &name, dst_abspath,
-                           scratch_pool);
-
-          SVN_ERR(svn_wc__db_read_info(&status,
-                                       NULL, /* kind */
-                                       &revision,
-                                       NULL, /* repos_relpath */
-                                       &repos_root_url,
-                                       &repos_uuid,
-                                       NULL, /* changed_rev */
-                                       NULL, /* changed_date */
-                                       NULL, /* changed_author */
-                                       NULL, /* last_mod_time */
-                                       &depth,
-                                       NULL, /* checksum */
-                                       NULL, /* translated_size */
-                                       NULL, /* target */
-                                       NULL, /* changelist */
-                                       NULL, /* original_repos_relpath */
-                                       NULL, /* original_root_url */
-                                       NULL, /* original_uuid */
-                                       NULL, /* original_revision */
-                                       NULL, /* props_mod */
-                                       &have_base,
-                                       NULL, /* have_work */
-                                       NULL, /* conflicted */
-                                       NULL, /* lock */
-                                       db, src_abspath,
-                                       scratch_pool, scratch_pool));
+          svn_skel_t *work_item;
+
+          SVN_ERR(svn_wc__wq_build_file_move(&work_item, db,
+                                             tmp_dst_abspath, dst_abspath,
+                                             scratch_pool, scratch_pool));
+          work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
 
-          if (!repos_root_url)
+#ifndef SVN_WC__SINGLE_DB
+          if (kind == svn_node_dir)
             {
-              if (status == svn_wc__db_status_deleted)
-                {
-                  const char *work_del_abspath;
+              /* Create the per-directory db in the copied directory.  The
+                 copy is not yet connected to the parent so we don't need
+                 to use a workqueue.  This will be removed when we
+                 centralise. */
+              const char *dst_parent_abspath, *name;
+              const char *repos_root_url, *repos_uuid;
+              svn_revnum_t revision;
+              svn_depth_t depth;
+              svn_wc__db_status_t status;
+              svn_boolean_t have_base;
 
-                  SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, NULL,
-                                                   &work_del_abspath,
-                                                   db, src_abspath,
-                                                   scratch_pool, scratch_pool));
-                  if (work_del_abspath)
+              svn_dirent_split(&dst_parent_abspath, &name, dst_abspath,
+                               scratch_pool);
+
+              SVN_ERR(svn_wc__db_read_info(&status,
+                                           NULL, /* kind */
+                                           &revision,
+                                           NULL, /* repos_relpath */
+                                           &repos_root_url,
+                                           &repos_uuid,
+                                           NULL, /* changed_rev */
+                                           NULL, /* changed_date */
+                                           NULL, /* changed_author */
+                                           NULL, /* last_mod_time */
+                                           &depth,
+                                           NULL, /* checksum */
+                                           NULL, /* translated_size */
+                                           NULL, /* target */
+                                           NULL, /* changelist */
+                                           NULL, /* original_repos_relpath */
+                                           NULL, /* original_root_url */
+                                           NULL, /* original_uuid */
+                                           NULL, /* original_revision */
+                                           NULL, /* props_mod */
+                                           &have_base,
+                                           NULL, /* have_work */
+                                           NULL, /* conflicted */
+                                           NULL, /* lock */
+                                           db, src_abspath,
+                                           scratch_pool, scratch_pool));
+
+              if (!repos_root_url)
+                {
+                  if (status == svn_wc__db_status_deleted)
                     {
-                      const char *parent_del_abspath
-                        = svn_dirent_dirname(work_del_abspath, scratch_pool);
+                      const char *work_del_abspath;
 
-                      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
-                                                       &repos_root_url,
-                                                       &repos_uuid,
-                                                       NULL, NULL, NULL, NULL,
-                                                       db, parent_del_abspath,
+                      SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, NULL,
+                                                       &work_del_abspath,
+                                                       db, src_abspath,
                                                        scratch_pool,
                                                        scratch_pool));
+                      if (work_del_abspath)
+                        {
+                          const char *parent_del_abspath
+                            = svn_dirent_dirname(work_del_abspath,
+                                                 scratch_pool);
+
+                          SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
+                                                           &repos_root_url,
+                                                           &repos_uuid,
+                                                           NULL, NULL, NULL,
+                                                           NULL,
+                                                           db,
+                                                           parent_del_abspath,
+                                                           scratch_pool,
+                                                           scratch_pool));
+                        }
+                      else
+                        SVN_ERR(svn_wc__db_scan_base_repos(NULL,
+                                                           &repos_root_url,
+                                                           &repos_uuid,
+                                                           db, src_abspath,
+                                                           scratch_pool,
+                                                           scratch_pool));
                     }
+                  else if (status == svn_wc__db_status_added || !have_base)
+                    SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
+                                                     &repos_root_url,
+                                                     &repos_uuid,
+                                                     NULL, NULL, NULL, NULL,
+                                                     db, src_abspath,
+                                                     scratch_pool,
+                                                     scratch_pool));
                   else
                     SVN_ERR(svn_wc__db_scan_base_repos(NULL, &repos_root_url,
                                                        &repos_uuid,
@@ -391,88 +359,43 @@ copy_versioned_dir(svn_wc__db_t *db,
                                                        scratch_pool,
                                                        scratch_pool));
                 }
-              else if (status == svn_wc__db_status_added || !have_base)
-                SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
-                                                 &repos_root_url, &repos_uuid,
-                                                 NULL, NULL, NULL, NULL,
-                                                 db, src_abspath,
-                                                 scratch_pool, scratch_pool));
-              else
-                 SVN_ERR(svn_wc__db_scan_base_repos(NULL, &repos_root_url,
-                                                    &repos_uuid,
-                                                    db, src_abspath,
-                                                    scratch_pool, scratch_pool));
-            }
 
-          /* Use the repos_root as root node url, because we are going to
-             remove the node directly anyway. */
-          SVN_ERR(svn_wc__internal_ensure_adm(db, tmp_dst_abspath,
-                                              repos_root_url, repos_root_url,
-                                              repos_uuid, revision, depth,
-                                              scratch_pool));
-
-          /* That creates a base node which we do not want so delete it. */
-          SVN_ERR(svn_wc__db_base_remove(db, tmp_dst_abspath,
-                                         scratch_pool));
-
-          /* ### Need to close the database so that Windows can move
-             ### the directory. */
-          SVN_ERR(svn_wc__db_temp_forget_directory(db, tmp_dst_abspath,
-                                                   scratch_pool));
-        }
+              /* Use the repos_root as root node url, because we are going to
+                 remove the node directly anyway. */
+              SVN_ERR(svn_wc__internal_ensure_adm(db, tmp_dst_abspath,
+                                                  repos_root_url,
+                                                  repos_root_url,
+                                                  repos_uuid, revision, depth,
+                                                  scratch_pool));
+
+              /* That creates a base node which we do not want so delete it. */
+              SVN_ERR(svn_wc__db_base_remove(db, tmp_dst_abspath,
+                                             scratch_pool));
+
+              /* ### Need to close the database so that Windows can move
+                 ### the directory. */
+              SVN_ERR(svn_wc__db_temp_forget_directory(db, tmp_dst_abspath,
+                                                       scratch_pool));
+            }
 #endif
+        }
     }
 
-#if (SVN_WC__VERSION < SVN_WC__PROPS_IN_DB)
-  /* This goes away when we move to in-db-props. */
-  {
-    apr_hash_t *src_props;
-
-    SVN_ERR(svn_wc__get_pristine_props(&src_props, db, src_abspath,
-                                       scratch_pool, scratch_pool));
-    if (src_props && apr_hash_count(src_props))
-      {
-        svn_skel_t *work_item;
-        const char *props_abspath;
-
-        SVN_ERR(svn_wc__prop_path(&props_abspath, dst_abspath, 
-                                  svn_wc__db_kind_dir, svn_wc__props_base,
-                                  scratch_pool));
-        SVN_ERR(svn_wc__wq_build_write_old_props(&work_item, props_abspath,
-                                                 src_props, scratch_pool));
-        work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-      }
-
-    SVN_ERR(svn_wc__get_actual_props(&src_props, db, src_abspath,
-                                     scratch_pool, scratch_pool));
-    if (src_props && apr_hash_count(src_props))
-      {
-        svn_skel_t *work_item;
-        const char *props_abspath;
-
-        SVN_ERR(svn_wc__prop_path(&props_abspath, dst_abspath, 
-                                  svn_wc__db_kind_dir, svn_wc__props_working,
-                                  scratch_pool));
-        SVN_ERR(svn_wc__wq_build_write_old_props(&work_item, props_abspath,
-                                                 src_props, scratch_pool));
-        work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-      }
-  }
-#endif
-
   SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
                              work_items, scratch_pool));
   SVN_ERR(svn_wc__wq_run(db, dir_abspath,
                          cancel_func, cancel_baton, scratch_pool));
 
+#ifndef SVN_WC__SINGLE_DB
   if (kind == svn_node_dir)
     {
       /* The first copy only does the parent stub, this second copy
          does the full node but can only happen after the workqueue
-         has move the destination into place. */
+         has moved the destination into place. */
       SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
                                  NULL, scratch_pool));
     }
+#endif
 
   if (notify_func)
     {
@@ -483,7 +406,7 @@ copy_versioned_dir(svn_wc__db_t *db,
       (*notify_func)(notify_baton, notify, scratch_pool);
     }
 
-  if (kind == svn_node_dir)
+  if (!metadata_only && kind == svn_node_dir)
     /* All children, versioned and unversioned.  We're only interested in the
        names of the children, so we can pass TRUE as the only_check_type
        param. */
@@ -513,11 +436,13 @@ copy_versioned_dir(svn_wc__db_t *db,
       if (child_kind == svn_wc__db_kind_file)
         SVN_ERR(copy_versioned_file(db,
                                     child_src_abspath, child_dst_abspath,
+                                    metadata_only,
                                     cancel_func, cancel_baton, NULL, NULL,
                                     iterpool));
       else if (child_kind == svn_wc__db_kind_dir)
         SVN_ERR(copy_versioned_dir(db,
                                    child_src_abspath, child_dst_abspath,
+                                   metadata_only,
                                    cancel_func, cancel_baton, NULL, NULL,
                                    iterpool));
       else
@@ -526,12 +451,12 @@ copy_versioned_dir(svn_wc__db_t *db,
                                  svn_dirent_local_style(child_src_abspath,
                                                         scratch_pool));
 
-      if (kind == svn_node_dir)
+      if (!metadata_only && kind == svn_node_dir)
         /* Remove versioned child as it has been handled */
         apr_hash_set(children, child_name, APR_HASH_KEY_STRING, NULL);
     }
 
-  if (kind == svn_node_dir)
+  if (!metadata_only && kind == svn_node_dir)
     {
       /* All the remaining children are unversioned. */
       apr_hash_index_t *hi;
@@ -585,6 +510,7 @@ svn_error_t *
 svn_wc_copy3(svn_wc_context_t *wc_ctx,
              const char *src_abspath,
              const char *dst_abspath,
+             svn_boolean_t metadata_only,
              svn_cancel_func_t cancel_func,
              void *cancel_baton,
              svn_wc_notify_func2_t notify_func,
@@ -736,6 +662,8 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
       (src_kind == svn_node_none
         && (src_db_kind == svn_wc__db_kind_file
             || src_db_kind == svn_wc__db_kind_symlink)))
+#else
+  if (!metadata_only)
 #endif
     {
       svn_node_kind_t dst_kind;
@@ -755,14 +683,14 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
   if (src_db_kind == svn_wc__db_kind_file
       || src_db_kind == svn_wc__db_kind_symlink)
     {
-      SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath,
+      SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath, metadata_only,
                                   cancel_func, cancel_baton,
                                   notify_func, notify_baton,
                                   scratch_pool));
     }
   else
     {
-      SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath,
+      SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath, metadata_only,
                                  cancel_func, cancel_baton,
                                  notify_func, notify_baton,
                                  scratch_pool));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/crop.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/crop.c Fri Jul 30 07:58:20 2010
@@ -85,12 +85,13 @@ crop_children(svn_wc__db_t *db,
                                NULL,
                                db, local_abspath, pool, iterpool));
 
+  if (dir_depth == svn_depth_unknown)
+    dir_depth = svn_depth_infinity;
+
   /* Update the depth of target first, if needed. */
   if (dir_depth > depth)
-    {
-      SVN_ERR(svn_wc__db_temp_op_set_dir_depth(db, local_abspath, depth,
-                                               iterpool));
-    }
+    SVN_ERR(svn_wc__db_temp_op_set_dir_depth(db, local_abspath, depth,
+                                             iterpool));
 
   /* Looping over current directory's SVN entries: */
   SVN_ERR(svn_wc__db_read_children(&children, db, local_abspath, pool,

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c Fri Jul 30 07:58:20 2010
@@ -3625,6 +3625,7 @@ svn_wc_copy2(const char *src,
   SVN_ERR(svn_wc_copy3(wc_ctx,
                        src_abspath,
                        dst_abspath,
+                       FALSE /* metadata_only */, 
                        cancel_func, cancel_baton,
                        notify_func, notify_baton,
                        pool));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/diff.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/diff.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/diff.c Fri Jul 30 07:58:20 2010
@@ -736,9 +736,9 @@ file_diff(struct dir_baton *db,
           /* We don't want the normal pristine properties (which are
              from the WORKING tree). We want the pristines associated
              with the BASE tree, which are saved as "revert" props.  */
-          SVN_ERR(svn_wc__get_revert_props(&baseprops,
-                                           eb->db, local_abspath,
-                                           pool, pool));
+          SVN_ERR(svn_wc__db_base_get_props(&baseprops,
+                                            eb->db, local_abspath,
+                                            pool, pool));
         }
       else
         {
@@ -750,6 +750,10 @@ file_diff(struct dir_baton *db,
 
           SVN_ERR(svn_wc__get_pristine_props(&baseprops, eb->db, local_abspath,
                                              pool, pool));
+
+          /* baseprops will be NULL for added nodes */
+          if (!baseprops)
+            baseprops = apr_hash_make(pool);
         }
       base_mimetype = get_prop_mimetype(baseprops);
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c Fri Jul 30 07:58:20 2010
@@ -651,6 +651,9 @@ read_one_entry(const svn_wc_entry_t **ne
   else if (status == svn_wc__db_status_deleted
            || status == svn_wc__db_status_obstructed_delete)
     {
+#ifdef SVN_WC__SINGLE_DB
+      svn_node_kind_t path_kind;
+#endif
       /* ### we don't have to worry about moves, so this is a delete. */
       entry->schedule = svn_wc_schedule_delete;
 
@@ -668,10 +671,23 @@ read_one_entry(const svn_wc_entry_t **ne
          remove working copy directories directly. So any left over
          directories after the delete operation are always kept locally.
       */
+#ifndef SVN_WC__SINGLE_DB
       if (*entry->name == '\0')
         SVN_ERR(svn_wc__db_temp_determine_keep_local(&entry->keep_local,
                                                      db, entry_abspath,
                                                      scratch_pool));
+#else
+      /* If there is still a directory on-disk we keep it, if not it is
+         already deleted. Simple, isn't it? 
+         
+         Before single-db we had to keep the administative area alive until
+         after the commit really deletes it. Setting keep alive stopped the
+         commit processing from deleting the directory. We don't delete it
+         any more, so all we have to do is provide some 'sane' value.
+       */
+      SVN_ERR(svn_io_check_path(entry_abspath, &path_kind, scratch_pool));
+      entry->keep_local = (path_kind == svn_node_dir);
+#endif
     }
   else if (status == svn_wc__db_status_added
            || status == svn_wc__db_status_obstructed_add)

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/log.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/log.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/log.c Fri Jul 30 07:58:20 2010
@@ -496,8 +496,12 @@ cleanup_internal(svn_wc__db_t *db,
                  apr_pool_t *scratch_pool)
 {
   int wc_format;
+#ifdef SVN_WC__SINGLE_DB
+  const char *cleanup_abspath;
+#else
   const apr_array_header_t *children;
   int i;
+#endif
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   /* Check cancellation; note that this catches recursive calls too. */
@@ -507,8 +511,14 @@ cleanup_internal(svn_wc__db_t *db,
   /* Can we even work with this directory?  */
   SVN_ERR(can_be_cleaned(&wc_format, db, adm_abspath, iterpool));
 
+#ifdef SVN_WC__SINGLE_DB
+  /* ### This fails if ADM_ABSPATH is locked indirectly via a
+     ### recursive lock on an ancestor. */
+  SVN_ERR(svn_wc__db_wclock_obtain(db, adm_abspath, -1, TRUE, iterpool));
+#else
   /* Lock this working copy directory, or steal an existing lock */
   SVN_ERR(svn_wc__db_wclock_obtain(db, adm_abspath, 0, TRUE, iterpool));
+#endif
 
   /* Run our changes before the subdirectories. We may not have to recurse
      if we blow away a subdir.  */
@@ -516,6 +526,7 @@ cleanup_internal(svn_wc__db_t *db,
     SVN_ERR(svn_wc__wq_run(db, adm_abspath, cancel_func, cancel_baton,
                            iterpool));
 
+#ifndef SVN_WC__SINGLE_DB
   /* Recurse on versioned, existing subdirectories.  */
   SVN_ERR(svn_wc__db_read_children(&children, db, adm_abspath,
                                    scratch_pool, iterpool));
@@ -541,20 +552,35 @@ cleanup_internal(svn_wc__db_t *db,
                                      iterpool));
         }
     }
+#endif
 
-#ifndef SINGLE_DB
+#ifndef SVN_WC__SINGLE_DB
   /* Purge the DAV props at and under ADM_ABSPATH. */
   /* ### in single-db mode, we need do this purge at the top-level only. */
   SVN_ERR(svn_wc__db_base_clear_dav_cache_recursive(db, adm_abspath, iterpool));
+#else
+  SVN_ERR(svn_wc__db_get_wcroot(&cleanup_abspath, db, adm_abspath,
+                                iterpool, iterpool));
+
+  /* Perform these operations if we lock the entire working copy.
+     Note that we really need to check a wcroot value and not
+     svn_wc__check_wcroot() as that function, will just return true
+     once we start sharing databases with externals.
+   */
+  if (strcmp(cleanup_abspath, adm_abspath) == 0)
+    {
 #endif
 
-  /* Cleanup the tmp area of the admin subdir, if running the log has not
-     removed it!  The logs have been run, so anything left here has no hope
-     of being useful. */
-  SVN_ERR(svn_wc__adm_cleanup_tmp_area(db, adm_abspath, iterpool));
-
-  /* Remove unreferenced pristine texts */
-  SVN_ERR(svn_wc__db_pristine_cleanup(db, adm_abspath, iterpool));
+    /* Cleanup the tmp area of the admin subdir, if running the log has not
+       removed it!  The logs have been run, so anything left here has no hope
+       of being useful. */
+      SVN_ERR(svn_wc__adm_cleanup_tmp_area(db, adm_abspath, iterpool));
+
+      /* Remove unreferenced pristine texts */
+      SVN_ERR(svn_wc__db_pristine_cleanup(db, adm_abspath, iterpool));
+#ifdef SVN_WC__SINGLE_DB
+    }
+#endif
 
   /* All done, toss the lock */
   SVN_ERR(svn_wc__db_wclock_release(db, adm_abspath, iterpool));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c?rev=980671&r1=980670&r2=980671&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c Fri Jul 30 07:58:20 2010
@@ -1210,12 +1210,14 @@ svn_wc__temp_get_keep_local(svn_boolean_
 {
   svn_boolean_t is_deleted;
 
+#ifndef SVN_WC__SINGLE_DB
   SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, wc_ctx, local_abspath,
                                          scratch_pool));
   if (is_deleted)
     SVN_ERR(svn_wc__db_temp_determine_keep_local(keep_local, wc_ctx->db,
                                                  local_abspath, scratch_pool));
   else
+#endif
     *keep_local = FALSE;
 
   return SVN_NO_ERROR;



Mime
View raw message