You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/10/08 19:12:05 UTC
svn commit: r1395675 - /subversion/trunk/subversion/libsvn_wc/wc_db.c
Author: rhuijben
Date: Mon Oct 8 17:12:04 2012
New Revision: 1395675
URL: http://svn.apache.org/viewvc?rev=1395675&view=rev
Log:
When adding a node to wc.db, resolve the wcroot using its parent path instead
of using the path itself to avoid resolving obstructing working copies via
a link.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_op_add_directory,
svn_wc__db_op_add_file,
svn_wc__db_op_add_symlink): Resolve parent path to add child.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1395675&r1=1395674&r2=1395675&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Oct 8 17:12:04 2012
@@ -4894,16 +4894,21 @@ svn_wc__db_op_add_directory(svn_wc__db_t
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
+ const char *dir_abspath;
+ const char *name;
insert_working_baton_t iwb;
+ /* Resolve wcroot via parent directory to avoid obstruction handling */
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ svn_dirent_split(&dir_abspath, &name, local_abspath, scratch_pool);
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ dir_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
blank_iwb(&iwb);
+ local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
iwb.kind = svn_kind_dir;
iwb.op_depth = relpath_depth(local_relpath);
@@ -4930,15 +4935,20 @@ svn_wc__db_op_add_file(svn_wc__db_t *db,
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
insert_working_baton_t iwb;
+ const char *dir_abspath;
+ const char *name;
+ /* Resolve wcroot via parent directory to avoid obstruction handling */
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ svn_dirent_split(&dir_abspath, &name, local_abspath, scratch_pool);
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ dir_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
blank_iwb(&iwb);
+ local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
iwb.kind = svn_kind_file;
iwb.op_depth = relpath_depth(local_relpath);
@@ -4963,16 +4973,23 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
insert_working_baton_t iwb;
+ const char *dir_abspath;
+ const char *name;
+ /* Resolve wcroot via parent directory to avoid obstruction handling */
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR_ASSERT(target != NULL);
+ svn_dirent_split(&dir_abspath, &name, local_abspath, scratch_pool);
+
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
- local_abspath, scratch_pool, scratch_pool));
+ dir_abspath, scratch_pool, scratch_pool));
+
VERIFY_USABLE_WCROOT(wcroot);
blank_iwb(&iwb);
+ local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
iwb.kind = svn_kind_symlink;
iwb.op_depth = relpath_depth(local_relpath);