Author: rhuijben
Date: Mon Jun 28 20:42:51 2010
New Revision: 958716
URL: http://svn.apache.org/viewvc?rev=958716&view=rev
Log:
Switch the create a new copied directory code in svn_wc_add4() to
using a db operation instead of using entry modifications. The only
remaining use case of entries is now 'svn cp URL PATH' which
transforms a separate checkout into an added subdirectory.
* subversion/libsvn_wc/adm_ops.c
(svn_wc_add4): Always remove the base node from a newly created
subdir-wcroot, and use svn_wc__db_op_copy_dir() for adding new
copied directories. (Current users of this function use the merge
code to fix up the missing properties).
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_op_copy_dir): Allow attaching a new subdir to a parent stub,
just like 958698 fixed svn_wc__db_add_directory().
Modified:
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=958716&r1=958715&r2=958716&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Jun 28 20:42:51 2010
@@ -1331,18 +1331,15 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
created inside of it.
This creates a BASE_NODE for an added directory, really
- it should create a WORKING_NODE. It gets removed by the
- next modify2 call. That is why we don't have to provide a
- valid url */
+ it should create a WORKING_NODE. We just remove the
+ node directly (without touching a possible not-present
+ node in the parent stub) */
SVN_ERR(svn_wc__internal_ensure_adm(db, local_abspath,
repos_root_url, repos_root_url,
repos_uuid, 0,
depth, scratch_pool));
- /* ### The entries based code still needs the incomplete base record,
- ### remove it for the direct db code. */
- if (!copyfrom_url)
- SVN_ERR(svn_wc__db_base_remove(db, local_abspath, scratch_pool));
+ SVN_ERR(svn_wc__db_base_remove(db, local_abspath, scratch_pool));
}
#endif
@@ -1400,10 +1397,27 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
}
}
else if (!copyfrom_url)
- {
- SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, NULL,
- scratch_pool));
- }
+ SVN_ERR(svn_wc__db_op_add_directory(db, local_abspath, NULL,
+ scratch_pool));
+ else if (!is_wc_root)
+ SVN_ERR(svn_wc__db_op_copy_dir(db,
+ local_abspath,
+ apr_hash_make(scratch_pool),
+ copyfrom_rev,
+ 0,
+ NULL,
+ svn_path_uri_decode(
+ svn_uri_skip_ancestor(repos_root_url,
+ copyfrom_url),
+ scratch_pool),
+ repos_root_url,
+ repos_uuid,
+ copyfrom_rev,
+ NULL,
+ depth,
+ NULL,
+ NULL,
+ scratch_pool));
else
{
svn_wc_entry_t tmp_entry;
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=958716&r1=958715&r2=958716&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jun 28 20:42:51 2010
@@ -2872,12 +2872,20 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
err = navigate_to_parent(&pdh, db, pdh, svn_sqlite__mode_readwrite,
scratch_pool);
- if (err)
+ if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
{
- /* Prolly fell off the top of the wcroot. Just call it a day. */
+ /* Not registered in the parent; register as addition */
svn_error_clear(err);
- return SVN_NO_ERROR;
+
+ SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
+ svn_dirent_dirname(local_abspath, scratch_pool),
+ svn_sqlite__mode_readwrite, scratch_pool,
+ scratch_pool));
+
+ VERIFY_USABLE_PDH(pdh);
}
+ else
+ SVN_ERR(err);
blank_iwb(&iwb);