Author: rhuijben
Date: Thu Jul 1 09:50:50 2010
New Revision: 959578
URL: http://svn.apache.org/viewvc?rev=959578&view=rev
Log:
Switch some of the copy functions to passing a svn_wc__db_t* instead of
passing a svn_wc_ctx_t*. No functional changes.
* subversion/libsvn_wc/copy.c
(copy_versioned_file): Accept and pass db.
(copy_versioned_dir): Accept and pass db. Use svn_wc__internal_node_get_url()
instead of the svn_wc__node variant.
(svn_wc_copy3): Update caller.
Modified:
subversion/trunk/subversion/libsvn_wc/copy.c
Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=959578&r1=959577&r2=959578&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu Jul 1 09:50:50 2010
@@ -124,7 +124,7 @@ copy_to_tmpdir(const char **dst_abspath,
This also works for versioned symlinks that are stored in the db as
svn_wc__db_kind_file with svn:special set. */
static svn_error_t *
-copy_versioned_file(svn_wc_context_t *wc_ctx,
+copy_versioned_file(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
svn_cancel_func_t cancel_func,
@@ -140,7 +140,7 @@ copy_versioned_file(svn_wc_context_t *wc
const char *tmp_dst_abspath;
svn_node_kind_t kind;
- SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, wc_ctx->db,
+ SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
dst_abspath,
scratch_pool, scratch_pool));
@@ -156,14 +156,14 @@ copy_versioned_file(svn_wc_context_t *wc
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
- wc_ctx->db, dst_abspath,
+ 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(wc_ctx->db, dst_abspath,
+ SVN_ERR(svn_wc__wq_prepare_revert_files(db, dst_abspath,
scratch_pool));
}
@@ -180,7 +180,7 @@ copy_versioned_file(svn_wc_context_t *wc
&checksum,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
- wc_ctx->db, src_abspath,
+ db, src_abspath,
scratch_pool, scratch_pool));
if (checksum)
{
@@ -191,18 +191,18 @@ copy_versioned_file(svn_wc_context_t *wc
if (checksum->kind == svn_checksum_md5)
{
md5_checksum = checksum;
- SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, wc_ctx->db,
+ SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db,
src_abspath, checksum,
scratch_pool,
scratch_pool));
}
else
{
sha1_checksum = checksum;
- SVN_ERR(svn_wc__db_pristine_get_md5(&md5_checksum, wc_ctx->db,
+ SVN_ERR(svn_wc__db_pristine_get_md5(&md5_checksum, db,
src_abspath, checksum,
scratch_pool, scratch_pool));
}
- SVN_ERR(svn_wc__db_pristine_read(&src_pristine, wc_ctx->db,
+ SVN_ERR(svn_wc__db_pristine_read(&src_pristine, db,
src_abspath, sha1_checksum,
scratch_pool, scratch_pool));
SVN_ERR(svn_stream_open_unique(&tmp_pristine, &tmp_pristine_abspath,
@@ -210,7 +210,7 @@ copy_versioned_file(svn_wc_context_t *wc
scratch_pool, scratch_pool));
SVN_ERR(svn_stream_copy3(src_pristine, tmp_pristine,
cancel_func, cancel_baton, scratch_pool));
- SVN_ERR(svn_wc__db_pristine_install(wc_ctx->db, tmp_pristine_abspath,
+ SVN_ERR(svn_wc__db_pristine_install(db, tmp_pristine_abspath,
sha1_checksum, md5_checksum,
scratch_pool));
}
@@ -226,14 +226,14 @@ copy_versioned_file(svn_wc_context_t *wc
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
- wc_ctx->db, src_abspath,
+ db, src_abspath,
scratch_pool, scratch_pool));
if (src_status == svn_wc__db_status_absent
|| src_status == svn_wc__db_status_excluded
|| src_status == svn_wc__db_status_not_present)
src_pristine = NULL;
else
- SVN_ERR(svn_wc__get_pristine_contents(&src_pristine, wc_ctx->db,
+ SVN_ERR(svn_wc__get_pristine_contents(&src_pristine, db,
src_abspath,
scratch_pool, scratch_pool));
@@ -248,9 +248,9 @@ copy_versioned_file(svn_wc_context_t *wc
scratch_pool, scratch_pool));
SVN_ERR(svn_stream_copy3(src_pristine, tmp_pristine,
cancel_func, cancel_baton, scratch_pool));
- SVN_ERR(svn_wc__text_base_path(&dst_pristine_abspath, wc_ctx->db,
+ SVN_ERR(svn_wc__text_base_path(&dst_pristine_abspath, db,
dst_abspath, scratch_pool));
- SVN_ERR(svn_wc__loggy_move(&work_item, wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__loggy_move(&work_item, db, dir_abspath,
tmp_pristine_abspath, dst_pristine_abspath,
scratch_pool));
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
@@ -263,7 +263,7 @@ copy_versioned_file(svn_wc_context_t *wc
{
apr_hash_t *src_props;
- SVN_ERR(svn_wc__get_pristine_props(&src_props, wc_ctx->db, src_abspath,
+ SVN_ERR(svn_wc__get_pristine_props(&src_props, db, src_abspath,
scratch_pool, scratch_pool));
if (src_props && apr_hash_count(src_props))
{
@@ -278,7 +278,7 @@ copy_versioned_file(svn_wc_context_t *wc
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
}
- SVN_ERR(svn_wc__get_actual_props(&src_props, wc_ctx->db, src_abspath,
+ SVN_ERR(svn_wc__get_actual_props(&src_props, db, src_abspath,
scratch_pool, scratch_pool));
if (src_props && apr_hash_count(src_props))
{
@@ -302,15 +302,15 @@ copy_versioned_file(svn_wc_context_t *wc
{
svn_skel_t *work_item;
- SVN_ERR(svn_wc__loggy_move(&work_item, wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__loggy_move(&work_item, db, dir_abspath,
tmp_dst_abspath, dst_abspath,
scratch_pool));
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
}
- SVN_ERR(svn_wc__db_op_copy(wc_ctx->db, src_abspath, dst_abspath,
+ SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
work_items, scratch_pool));
- SVN_ERR(svn_wc__wq_run(wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__wq_run(db, dir_abspath,
cancel_func, cancel_baton, scratch_pool));
if (notify_func)
@@ -325,7 +325,7 @@ copy_versioned_file(svn_wc_context_t *wc
}
static svn_error_t *
-copy_versioned_dir(svn_wc_context_t *wc_ctx,
+copy_versioned_dir(svn_wc__db_t *db,
const char *src_abspath,
const char *dst_abspath,
svn_cancel_func_t cancel_func,
@@ -344,7 +344,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
apr_pool_t *iterpool;
int i;
- SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, wc_ctx->db,
+ SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
dst_abspath,
scratch_pool, scratch_pool));
@@ -355,7 +355,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
{
svn_skel_t *work_item;
- SVN_ERR(svn_wc__loggy_move(&work_item, wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__loggy_move(&work_item, db, dir_abspath,
tmp_dst_abspath, dst_abspath,
scratch_pool));
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
@@ -374,8 +374,9 @@ copy_versioned_dir(svn_wc_context_t *wc_
svn_dirent_split(&dst_parent_abspath, &name, dst_abspath,
scratch_pool);
- SVN_ERR(svn_wc__node_get_url(&parent_url, wc_ctx, dst_parent_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__internal_node_get_url(&parent_url, db,
+ dst_parent_abspath,
+ scratch_pool, scratch_pool));
url = svn_uri_join(parent_url, name, scratch_pool);
SVN_ERR(svn_wc__db_read_info(&status,
@@ -402,7 +403,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
NULL, /* base_shadowed */
NULL, /* conflicted */
NULL, /* lock */
- wc_ctx->db, src_abspath,
+ db, src_abspath,
scratch_pool, scratch_pool));
if (status == svn_wc__db_status_added)
@@ -415,22 +416,22 @@ copy_versioned_dir(svn_wc_context_t *wc_
NULL /* original_root_url */,
NULL /* original_uuid */,
NULL /* original_revision */,
- wc_ctx->db, src_abspath,
+ db, src_abspath,
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__internal_ensure_adm(wc_ctx->db, tmp_dst_abspath,
+ SVN_ERR(svn_wc__internal_ensure_adm(db, tmp_dst_abspath,
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(wc_ctx->db, tmp_dst_abspath,
+ 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. Is this the right way to do it? This
### is not temporary code so the _temp_ name isn't
### right. */
- SVN_ERR(svn_wc__db_temp_forget_directory(wc_ctx->db, tmp_dst_abspath,
+ SVN_ERR(svn_wc__db_temp_forget_directory(db, tmp_dst_abspath,
scratch_pool));
}
}
@@ -440,7 +441,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
{
apr_hash_t *src_props;
- SVN_ERR(svn_wc__get_pristine_props(&src_props, wc_ctx->db, src_abspath,
+ SVN_ERR(svn_wc__get_pristine_props(&src_props, db, src_abspath,
scratch_pool, scratch_pool));
if (src_props && apr_hash_count(src_props))
{
@@ -455,7 +456,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
}
- SVN_ERR(svn_wc__get_actual_props(&src_props, wc_ctx->db, src_abspath,
+ SVN_ERR(svn_wc__get_actual_props(&src_props, db, src_abspath,
scratch_pool, scratch_pool));
if (src_props && apr_hash_count(src_props))
{
@@ -472,9 +473,9 @@ copy_versioned_dir(svn_wc_context_t *wc_
}
#endif
- SVN_ERR(svn_wc__db_op_copy(wc_ctx->db, src_abspath, dst_abspath,
+ SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
work_items, scratch_pool));
- SVN_ERR(svn_wc__wq_run(wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__wq_run(db, dir_abspath,
cancel_func, cancel_baton, scratch_pool));
if (kind == svn_node_dir)
@@ -482,7 +483,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
/* 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. */
- SVN_ERR(svn_wc__db_op_copy(wc_ctx->db, src_abspath, dst_abspath,
+ SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
NULL, scratch_pool));
}
@@ -500,7 +501,7 @@ copy_versioned_dir(svn_wc_context_t *wc_
SVN_ERR(svn_io_get_dirents2(&children, src_abspath, scratch_pool));
/* Copy all the versioned children */
- SVN_ERR(svn_wc__db_read_children(&versioned_children, wc_ctx->db,
src_abspath,
+ SVN_ERR(svn_wc__db_read_children(&versioned_children, db, src_abspath,
scratch_pool, scratch_pool));
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < versioned_children->nelts; ++i)
@@ -516,16 +517,16 @@ copy_versioned_dir(svn_wc_context_t *wc_
child_src_abspath = svn_dirent_join(src_abspath, child_name, iterpool);
child_dst_abspath = svn_dirent_join(dst_abspath, child_name, iterpool);
- SVN_ERR(svn_wc__db_read_kind(&child_kind, wc_ctx->db, child_src_abspath,
+ SVN_ERR(svn_wc__db_read_kind(&child_kind, db, child_src_abspath,
TRUE, iterpool));
if (child_kind == svn_wc__db_kind_file)
- SVN_ERR(copy_versioned_file(wc_ctx,
+ SVN_ERR(copy_versioned_file(db,
child_src_abspath, child_dst_abspath,
cancel_func, cancel_baton, NULL, NULL,
iterpool));
else if (child_kind == svn_wc__db_kind_dir)
- SVN_ERR(copy_versioned_dir(wc_ctx,
+ SVN_ERR(copy_versioned_dir(db,
child_src_abspath, child_dst_abspath,
cancel_func, cancel_baton, NULL, NULL,
iterpool));
@@ -568,15 +569,15 @@ copy_versioned_dir(svn_wc_context_t *wc_
if (tmp_dst_abspath)
{
svn_skel_t *work_item;
- SVN_ERR(svn_wc__loggy_move(&work_item, wc_ctx->db, dir_abspath,
+ SVN_ERR(svn_wc__loggy_move(&work_item, db, dir_abspath,
tmp_dst_abspath, unver_dst_abspath,
iterpool));
- SVN_ERR(svn_wc__db_wq_add(wc_ctx->db, dst_abspath, work_item,
+ SVN_ERR(svn_wc__db_wq_add(db, dst_abspath, work_item,
iterpool));
}
}
- SVN_ERR(svn_wc__wq_run(wc_ctx->db, dst_abspath, cancel_func,
cancel_baton,
+ SVN_ERR(svn_wc__wq_run(db, dst_abspath, cancel_func, cancel_baton,
scratch_pool));
}
@@ -763,14 +764,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(wc_ctx, src_abspath, dst_abspath,
+ SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath,
cancel_func, cancel_baton,
notify_func, notify_baton,
scratch_pool));
}
else
{
- SVN_ERR(copy_versioned_dir(wc_ctx, src_abspath, dst_abspath,
+ SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath,
cancel_func, cancel_baton,
notify_func, notify_baton,
scratch_pool));