diff options
author | peter <peter@FreeBSD.org> | 2013-07-28 05:04:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2013-07-28 05:04:41 +0000 |
commit | 3b9f7e96381479fb03ae2c36d490a38718f71083 (patch) | |
tree | a851d66ec0c51a7321b30a677a0e55f1655af4d6 /subversion/libsvn_wc/wc_db_wcroot.c | |
parent | 6879a90da0ad9b5e74fc212c899751fe3821ac7b (diff) | |
download | FreeBSD-src-3b9f7e96381479fb03ae2c36d490a38718f71083.zip FreeBSD-src-3b9f7e96381479fb03ae2c36d490a38718f71083.tar.gz |
Import subversion-1.8.1 into vendor staging area.
Diffstat (limited to 'subversion/libsvn_wc/wc_db_wcroot.c')
-rw-r--r-- | subversion/libsvn_wc/wc_db_wcroot.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/subversion/libsvn_wc/wc_db_wcroot.c b/subversion/libsvn_wc/wc_db_wcroot.c index 1091f1b..21173e5 100644 --- a/subversion/libsvn_wc/wc_db_wcroot.c +++ b/subversion/libsvn_wc/wc_db_wcroot.c @@ -434,6 +434,8 @@ svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot, svn_boolean_t always_check = FALSE; int wc_format = 0; const char *adm_relpath; + /* Non-NULL if WCROOT is found through a symlink: */ + const char *symlink_wcroot_abspath = NULL; /* ### we need more logic for finding the database (if it is located ### outside of the wcroot) and then managing all of that within DB. @@ -611,6 +613,7 @@ svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot, if (found_wcroot) break; + symlink_wcroot_abspath = local_abspath; SVN_ERR(read_link_target(&local_abspath, local_abspath, scratch_pool)); try_symlink_as_dir: @@ -632,6 +635,7 @@ try_symlink_as_dir: local_abspath = svn_dirent_dirname(local_abspath, scratch_pool); moved_upwards = TRUE; + symlink_wcroot_abspath = NULL; /* Is the parent directory recorded in our hash? */ found_wcroot = svn_hash_gets(db->dir_data, local_abspath); @@ -669,7 +673,10 @@ try_symlink_as_dir: (ie. where we found it). */ err = svn_wc__db_pdh_create_wcroot(wcroot, - apr_pstrdup(db->state_pool, local_abspath), + apr_pstrdup(db->state_pool, + symlink_wcroot_abspath + ? symlink_wcroot_abspath + : local_abspath), sdb, wc_id, FORMAT_FROM_SDB, db->verify_format, db->enforce_empty_wq, db->state_pool, scratch_pool); @@ -737,7 +744,10 @@ try_symlink_as_dir: } SVN_ERR(svn_wc__db_pdh_create_wcroot(wcroot, - apr_pstrdup(db->state_pool, local_abspath), + apr_pstrdup(db->state_pool, + symlink_wcroot_abspath + ? symlink_wcroot_abspath + : local_abspath), NULL, UNKNOWN_WC_ID, wc_format, db->verify_format, db->enforce_empty_wq, db->state_pool, scratch_pool)); @@ -747,6 +757,13 @@ try_symlink_as_dir: { const char *dir_relpath; + if (symlink_wcroot_abspath) + { + /* The WCROOT was found through a symlink pointing at the root of + * the WC. Cache the WCROOT under the symlink's path. */ + local_dir_abspath = symlink_wcroot_abspath; + } + /* The subdirectory's relpath is easily computed relative to the wcroot that we just found. */ dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL); @@ -809,6 +826,7 @@ try_symlink_as_dir: scratch_pool)); if (resolved_kind == svn_node_dir) { + symlink_wcroot_abspath = original_abspath; SVN_ERR(read_link_target(&local_abspath, original_abspath, scratch_pool)); /* This handle was opened in this function but is not going |