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 3625610FEC for ; Mon, 25 Nov 2013 01:18:21 +0000 (UTC) Received: (qmail 91030 invoked by uid 500); 25 Nov 2013 01:18:21 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 91008 invoked by uid 500); 25 Nov 2013 01:18:21 -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 91001 invoked by uid 99); 25 Nov 2013 01:18:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Nov 2013 01:18:21 +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; Mon, 25 Nov 2013 01:18:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BC14723888CD; Mon, 25 Nov 2013 01:17:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1545127 - /subversion/trunk/subversion/libsvn_wc/wc_db.c Date: Mon, 25 Nov 2013 01:17:59 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131125011759.BC14723888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Mon Nov 25 01:17:59 2013 New Revision: 1545127 URL: http://svn.apache.org/r1545127 Log: Make wc_db.c's scan_addition() function follow the usual wc_db pattern that the private apis are called within a transaction and don't obtain one itself. This api is used by quite a lot of other functions that already have a lock and don't need an additional savepoint. * subversion/libsvn_wc/wc_db.c (scan_addition_txn): Rename to scan_addition and move comment here. (scan_addition): Remove old wrapper. (svn_wc__db_scan_addition, svn_wc__db_scan_moved): Use a lock around scan_addition. 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=1545127&r1=1545126&r2=1545127&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Nov 25 01:17:59 2013 @@ -11968,23 +11968,26 @@ get_moved_from_info(const char **moved_f return SVN_NO_ERROR; } -/* The body of scan_addition(). - */ +/* Like svn_wc__db_scan_addition(), but with WCROOT+LOCAL_RELPATH instead of + DB+LOCAL_ABSPATH. + + The output value of *ORIGINAL_REPOS_ID will be INVALID_REPOS_ID if there + is no 'copy-from' repository. */ static svn_error_t * -scan_addition_txn(svn_wc__db_status_t *status, - const char **op_root_relpath_p, - const char **repos_relpath, - apr_int64_t *repos_id, - const char **original_repos_relpath, - apr_int64_t *original_repos_id, - svn_revnum_t *original_revision, - const char **moved_from_relpath, - const char **moved_from_op_root_relpath, - int *moved_from_op_depth, - svn_wc__db_wcroot_t *wcroot, - const char *local_relpath, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) +scan_addition(svn_wc__db_status_t *status, + const char **op_root_relpath_p, + const char **repos_relpath, + apr_int64_t *repos_id, + const char **original_repos_relpath, + apr_int64_t *original_repos_id, + svn_revnum_t *original_revision, + const char **moved_from_relpath, + const char **moved_from_op_root_relpath, + int *moved_from_op_depth, + svn_wc__db_wcroot_t *wcroot, + const char *local_relpath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) { const char *op_root_relpath; const char *build_relpath = ""; @@ -12246,39 +12249,6 @@ scan_addition_txn(svn_wc__db_status_t *s return SVN_NO_ERROR; } - -/* Like svn_wc__db_scan_addition(), but with WCROOT+LOCAL_RELPATH instead of - DB+LOCAL_ABSPATH. - - The output value of *ORIGINAL_REPOS_ID will be INVALID_REPOS_ID if there - is no 'copy-from' repository. */ -static svn_error_t * -scan_addition(svn_wc__db_status_t *status, - const char **op_root_relpath, - const char **repos_relpath, - apr_int64_t *repos_id, - const char **original_repos_relpath, - apr_int64_t *original_repos_id, - svn_revnum_t *original_revision, - const char **moved_from_relpath, - const char **moved_from_op_root_relpath, - int *moved_from_op_depth, - svn_wc__db_wcroot_t *wcroot, - const char *local_relpath, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) -{ - SVN_WC__DB_WITH_TXN( - scan_addition_txn(status, op_root_relpath, repos_relpath, repos_id, - original_repos_relpath, original_repos_id, - original_revision, moved_from_relpath, - moved_from_op_root_relpath, moved_from_op_depth, - wcroot, local_relpath, result_pool, scratch_pool), - wcroot); - return SVN_NO_ERROR; -} - - svn_error_t * svn_wc__db_scan_addition(svn_wc__db_status_t *status, const char **op_root_abspath, @@ -12310,7 +12280,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat local_abspath, scratch_pool, scratch_pool)); VERIFY_USABLE_WCROOT(wcroot); - SVN_ERR(scan_addition(status, + SVN_WC__DB_WITH_TXN( + scan_addition(status, op_root_abspath ? &op_root_relpath : NULL, @@ -12318,7 +12289,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat original_repos_relpath, original_repos_id_p, original_revision, NULL, NULL, NULL, - wcroot, local_relpath, result_pool, scratch_pool)); + wcroot, local_relpath, result_pool, scratch_pool), + wcroot); if (op_root_abspath) *op_root_abspath = svn_dirent_join(wcroot->abspath, op_root_relpath, @@ -12359,7 +12331,8 @@ svn_wc__db_scan_moved(const char **moved local_abspath, scratch_pool, scratch_pool)); VERIFY_USABLE_WCROOT(wcroot); - SVN_ERR(scan_addition(&status, + SVN_WC__DB_WITH_TXN( + scan_addition(&status, op_root_abspath ? &op_root_relpath : NULL, @@ -12375,7 +12348,8 @@ svn_wc__db_scan_moved(const char **moved moved_from_delete_abspath ? &moved_from_op_depth : NULL, - wcroot, local_relpath, scratch_pool, scratch_pool)); + wcroot, local_relpath, scratch_pool, scratch_pool), + wcroot); if (status != svn_wc__db_status_moved_here || !moved_from_relpath) return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,