Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CBFD8D530 for ; Thu, 8 Nov 2012 11:44:14 +0000 (UTC) Received: (qmail 81166 invoked by uid 500); 8 Nov 2012 11:44:14 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 81132 invoked by uid 500); 8 Nov 2012 11:44:14 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 81102 invoked by uid 99); 8 Nov 2012 11:44:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 11:44:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 11:44:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F246723888EA; Thu, 8 Nov 2012 11:43:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1407021 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/op-depth-test.c Date: Thu, 08 Nov 2012 11:43:48 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121108114348.F246723888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Thu Nov 8 11:43:48 2012 New Revision: 1407021 URL: http://svn.apache.org/viewvc?rev=1407021&view=rev Log: Turn svn_wc__db_temp_op_make_copy() in a proper db operation, by renaming and adding conflicts and work_items arguments. This in preparation for adding another caller in my next patch and possibly another one later on. * subversion/libsvn_wc/wc_db.c (db_base_remove): Update caller. Remove comment. (make_copy_baton_t): Add 2 variables. (make_copy_txn): Handle conflicts and work items. Move struct out of loop. (svn_wc__db_temp_op_make_copy): Rename to ... (svn_wc__db_op_make_copy): ... this, add arguments and fill struct. * subversion/libsvn_wc/wc_db.h (svn_wc__db_temp_op_make_copy): Rename to ... (svn_wc__db_op_make_copy): ... this and add arguments. * subversion/tests/libsvn_wc/op-depth-test.c (temp_op_make_copy): Update caller. Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c subversion/trunk/subversion/libsvn_wc/wc_db.h subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.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=1407021&r1=1407020&r2=1407021&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Nov 8 11:43:48 2012 @@ -2074,16 +2074,15 @@ db_base_remove(void *baton, wcroot, local_relpath, scratch_pool, scratch_pool)); - /* ### This function should be turned into a helper of this function, - as this is the only valid caller */ if (status == svn_wc__db_status_normal && rb->keep_as_working) { - SVN_ERR(svn_wc__db_temp_op_make_copy(rb->db, - svn_dirent_join(wcroot->abspath, - local_relpath, - scratch_pool), - scratch_pool)); + SVN_ERR(svn_wc__db_op_make_copy(rb->db, + svn_dirent_join(wcroot->abspath, + local_relpath, + scratch_pool), + NULL, NULL, + scratch_pool)); keep_working = TRUE; } else @@ -13085,6 +13084,8 @@ svn_wc__db_temp_op_start_directory_updat struct make_copy_baton_t { int op_depth; + const svn_skel_t *conflicts; + const svn_skel_t *work_items; }; @@ -13133,6 +13134,7 @@ make_copy_txn(void *baton, svn_boolean_t add_working_base_deleted = FALSE; svn_boolean_t remove_working = FALSE; const apr_array_header_t *children; + struct make_copy_baton_t cbt; apr_pool_t *iterpool = svn_pool_create(scratch_pool); int i; @@ -13197,18 +13199,20 @@ make_copy_txn(void *baton, SVN_ERR(gather_repo_children(&children, wcroot, local_relpath, 0, scratch_pool, iterpool)); + cbt.op_depth = mcb->op_depth; + cbt.conflicts = NULL; + cbt.work_items = NULL; + for (i = 0; i < children->nelts; i++) { const char *name = APR_ARRAY_IDX(children, i, const char *); - struct make_copy_baton_t cbt; + const char *copy_relpath; svn_pool_clear(iterpool); copy_relpath = svn_relpath_join(local_relpath, name, iterpool); - cbt.op_depth = mcb->op_depth; - SVN_ERR(make_copy_txn(&cbt, wcroot, copy_relpath, iterpool)); } @@ -13216,6 +13220,11 @@ make_copy_txn(void *baton, iterpool), svn_depth_empty, iterpool)); + if (mcb->conflicts) + SVN_ERR(mark_conflict(wcroot, local_relpath, mcb->conflicts, iterpool)); + + SVN_ERR(add_work_items(wcroot->sdb, mcb->work_items, iterpool)); + svn_pool_destroy(iterpool); return SVN_NO_ERROR; @@ -13223,9 +13232,11 @@ make_copy_txn(void *baton, svn_error_t * -svn_wc__db_temp_op_make_copy(svn_wc__db_t *db, - const char *local_abspath, - apr_pool_t *scratch_pool) +svn_wc__db_op_make_copy(svn_wc__db_t *db, + const char *local_abspath, + const svn_skel_t *conflicts, + const svn_skel_t *work_items, + apr_pool_t *scratch_pool) { svn_wc__db_wcroot_t *wcroot; const char *local_relpath; @@ -13258,6 +13269,8 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_ SVN_ERR(catch_copy_of_server_excluded(wcroot, local_relpath, scratch_pool)); mcb.op_depth = relpath_depth(local_relpath); + mcb.conflicts = conflicts; + mcb.work_items = work_items; SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, make_copy_txn, &mcb, scratch_pool)); Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1407021&r1=1407020&r2=1407021&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.h (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu Nov 8 11:43:48 2012 @@ -3027,9 +3027,11 @@ svn_wc__db_temp_op_end_directory_update( leaving any subtree additions and copies as-is. This allows the base node tree to be removed. */ svn_error_t * -svn_wc__db_temp_op_make_copy(svn_wc__db_t *db, - const char *local_abspath, - apr_pool_t *scratch_pool); +svn_wc__db_op_make_copy(svn_wc__db_t *db, + const char *local_abspath, + const svn_skel_t *conflicts, + const svn_skel_t *work_items, + apr_pool_t *scratch_pool); /* Close the wc root LOCAL_ABSPATH and remove any per-directory handles associated with it. */ Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1407021&r1=1407020&r2=1407021&view=diff ============================================================================== --- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original) +++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Thu Nov 8 11:43:48 2012 @@ -1628,7 +1628,7 @@ temp_op_make_copy(svn_test__sandbox_t *b SVN_ERR(insert_dirs(b, before)); - SVN_ERR(svn_wc__db_temp_op_make_copy(b->wc_ctx->db, dir_abspath, b->pool)); + SVN_ERR(svn_wc__db_op_make_copy(b->wc_ctx->db, dir_abspath, NULL, NULL, b->pool)); SVN_ERR(check_db_rows(b, "", after));