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 2014/03/23 23:15:35 UTC
svn commit: r1580637 -
/subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c
Author: rhuijben
Date: Sun Mar 23 22:15:34 2014
New Revision: 1580637
URL: http://svn.apache.org/r1580637
Log:
Merge the equivalent of the fix in r1580626 to this branch.
* subversion/libsvn_wc/wc_db.c
(get_info_for_copy): Calculate the right copyfrom_id here
(db_op_copy): Instead of here... because this value is used in more
places than just when inserting the node. Most importantly for
op_depth_for_copy().
Modified:
subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c
Modified: subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c?rev=1580637&r1=1580636&r2=1580637&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.7.x-r1580626/subversion/libsvn_wc/wc_db.c Sun Mar 23 22:15:34 2014
@@ -3308,8 +3308,9 @@ get_info_for_copy(apr_int64_t *copyfrom_
svn_wc__db_kind_t *kind,
svn_boolean_t *op_root,
svn_boolean_t *have_work,
- svn_wc__db_wcroot_t *wcroot,
+ svn_wc__db_wcroot_t *src_wcroot,
const char *local_relpath,
+ svn_wc__db_wcroot_t *dst_wcroot,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -3322,7 +3323,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
NULL /* have_base */,
NULL /* have_more_work */,
have_work,
- wcroot, local_relpath, result_pool, scratch_pool));
+ src_wcroot, local_relpath, result_pool, scratch_pool));
if (*status == svn_wc__db_status_excluded)
{
@@ -3339,7 +3340,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
&parent_status,
&parent_kind,
NULL, &parent_have_work,
- wcroot, parent_relpath,
+ src_wcroot, parent_relpath, dst_wcroot,
scratch_pool, scratch_pool));
if (*copyfrom_relpath)
*copyfrom_relpath = svn_relpath_join(*copyfrom_relpath, base_name,
@@ -3352,7 +3353,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
SVN_ERR(scan_addition(NULL, &op_root_relpath,
NULL, NULL, /* repos_* */
copyfrom_relpath, copyfrom_id, copyfrom_rev,
- wcroot, local_relpath,
+ src_wcroot, local_relpath,
scratch_pool, scratch_pool));
if (*copyfrom_relpath)
{
@@ -3368,7 +3369,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
const char *base_del_relpath, *work_del_relpath;
SVN_ERR(scan_deletion(&base_del_relpath, NULL, &work_del_relpath,
- wcroot, local_relpath, scratch_pool,
+ src_wcroot, local_relpath, scratch_pool,
scratch_pool));
if (work_del_relpath)
{
@@ -3381,7 +3382,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
SVN_ERR(scan_addition(NULL, &op_root_relpath,
NULL, NULL, /* repos_* */
copyfrom_relpath, copyfrom_id, copyfrom_rev,
- wcroot, parent_del_relpath,
+ src_wcroot, parent_del_relpath,
scratch_pool, scratch_pool));
*copyfrom_relpath
= svn_relpath_join(*copyfrom_relpath,
@@ -3395,7 +3396,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
copyfrom_id,
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
+ src_wcroot, local_relpath,
result_pool, scratch_pool));
}
else
@@ -3407,6 +3408,24 @@ get_info_for_copy(apr_int64_t *copyfrom_
*copyfrom_rev = revision;
}
+ if (src_wcroot != dst_wcroot && copyfrom_relpath)
+ {
+ const char *repos_root_url;
+ const char *repos_uuid;
+
+ /* Pass the right repos-id for the destination db. We can't just use
+ the id of the source database, as this value can change after
+ relocation (and perhaps also when we start storing multiple
+ working copies in a single db)! */
+
+ SVN_ERR(fetch_repos_info(&repos_root_url, &repos_uuid,
+ src_wcroot->sdb, *copyfrom_id,
+ scratch_pool));
+
+ SVN_ERR(create_repos_id(copyfrom_id, repos_root_url, repos_uuid,
+ dst_wcroot->sdb, scratch_pool));
+ }
+
return SVN_NO_ERROR;
}
@@ -3455,7 +3474,8 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
SVN_ERR(get_info_for_copy(©from_id, ©from_relpath, ©from_rev,
&status, &kind, &op_root, &have_work, src_wcroot,
- src_relpath, scratch_pool, scratch_pool));
+ src_relpath, dst_wcroot,
+ scratch_pool, scratch_pool));
SVN_ERR(op_depth_for_copy(&dst_op_depth, &dst_np_op_depth, copyfrom_id,
copyfrom_relpath, copyfrom_rev,
@@ -3606,21 +3626,6 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
}
else
{
- if (copyfrom_relpath)
- {
- const char *repos_root_url;
- const char *repos_uuid;
-
- /* Pass the right repos-id for the destination db! */
-
- SVN_ERR(fetch_repos_info(&repos_root_url, &repos_uuid,
- src_wcroot->sdb, copyfrom_id,
- scratch_pool));
-
- SVN_ERR(create_repos_id(©from_id, repos_root_url, repos_uuid,
- dst_wcroot->sdb, scratch_pool));
- }
-
SVN_ERR(cross_db_copy(src_wcroot, src_relpath, dst_wcroot,
dst_relpath, dst_presence, dst_op_depth,
dst_np_op_depth, kind,