Return-Path: Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: (qmail 43594 invoked from network); 23 Apr 2010 18:18:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Apr 2010 18:18:20 -0000 Received: (qmail 72058 invoked by uid 500); 23 Apr 2010 18:18:20 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 72043 invoked by uid 500); 23 Apr 2010 18:18:20 -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 72036 invoked by uid 99); 23 Apr 2010 18:18:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 18:18:20 +0000 X-ASF-Spam-Status: No, hits=-1431.8 required=10.0 tests=ALL_TRUSTED,AWL 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; Fri, 23 Apr 2010 18:18:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 99F0723888E3; Fri, 23 Apr 2010 18:17:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r937452 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/status.c libsvn_wc/node.c libsvn_wc/questions.c Date: Fri, 23 Apr 2010 18:17:37 -0000 To: commits@subversion.apache.org From: cmpilato@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100423181737.99F0723888E3@eris.apache.org> Author: cmpilato Date: Fri Apr 23 18:17:37 2010 New Revision: 937452 URL: http://svn.apache.org/viewvc?rev=937452&view=rev Log: More svn_wc_entry_t purging from libsvn_client. * subversion/include/private/svn_wc_private.h (svn_wc__node_is_replaced): New. * subversion/libsvn_wc/questions.c (svn_wc__internal_is_replaced): Moved to node.c. * subversion/libsvn_wc/node.c (svn_wc__internal_is_replaced): Moved from questions.c. (svn_wc__node_is_replaced): New wrapper around svn_wc__internal_is_replaced(). * subversion/libsvn_client/status.c (svn_client_status5): Use WC-NG node functions rather than svn_wc_entry_t stuffs to determine how to handle status targets missing from HEAD. Modified: subversion/trunk/subversion/include/private/svn_wc_private.h subversion/trunk/subversion/libsvn_client/status.c subversion/trunk/subversion/libsvn_wc/node.c subversion/trunk/subversion/libsvn_wc/questions.c Modified: subversion/trunk/subversion/include/private/svn_wc_private.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=937452&r1=937451&r2=937452&view=diff ============================================================================== --- subversion/trunk/subversion/include/private/svn_wc_private.h (original) +++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Apr 23 18:17:37 2010 @@ -457,6 +457,20 @@ svn_wc__node_is_added(svn_boolean_t *is_ apr_pool_t *scratch_pool); /** + * Set @a *is_replaced to whether @a local_abspath is replaced, using + * @a wc_ctx. If @a local_abspath is not in the working copy, return + * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary + * allocations. + * + * NOTE: This corresponds directly to svn_wc_schedule_replace. + */ +svn_error_t * +svn_wc__node_is_replaced(svn_boolean_t *is_replaced, + svn_wc_context_t *wc_ctx, + const char *local_abspath, + apr_pool_t *scratch_pool); + +/** * Get the base revision of @a local_abspath using @a wc_ctx. If * @a local_abspath is not in the working copy, return * @c SVN_ERR_WC_PATH_NOT_FOUND. Modified: subversion/trunk/subversion/libsvn_client/status.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=937452&r1=937451&r2=937452&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/status.c (original) +++ subversion/trunk/subversion/libsvn_client/status.c Fri Apr 23 18:17:37 2010 @@ -391,17 +391,26 @@ svn_client_status5(svn_revnum_t *result_ &kind, pool)); if (kind == svn_node_none) { - const svn_wc_entry_t *entry; - SVN_ERR(svn_wc__get_entry_versioned(&entry, ctx->wc_ctx, - dir_abspath, svn_node_dir, - FALSE, FALSE, - pool, pool)); - - /* Our status target does not exist in HEAD of the - repository. If we're just adding this thing, that's - fine. But if it was previously versioned, then it must - have been deleted from the repository. */ - if (entry->schedule != svn_wc_schedule_add) + svn_boolean_t added; + + /* Our status target does not exist in HEAD. If we've got + it localled added, that's okay. But if it was previously + versioned, then it must have since been deleted from the + repository. (Note that "locally replaced" doesn't count + as "added" in this case.) */ + SVN_ERR(svn_wc__node_is_added(&added, ctx->wc_ctx, + dir_abspath, pool)); + if (added) + { + svn_boolean_t replaced; + + SVN_ERR(svn_wc__node_is_replaced(&added, ctx->wc_ctx, + dir_abspath, pool)); + if (replaced) + added = FALSE; + } + + if (! added) sb.deleted_in_repos = TRUE; /* And now close the edit. */ Modified: subversion/trunk/subversion/libsvn_wc/node.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=937452&r1=937451&r2=937452&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/node.c (original) +++ subversion/trunk/subversion/libsvn_wc/node.c Fri Apr 23 18:17:37 2010 @@ -667,6 +667,56 @@ svn_wc__node_is_added(svn_boolean_t *is_ return SVN_NO_ERROR; } + +/* Equivalent to the old notion of "entry->schedule == schedule_replace" */ +svn_error_t * +svn_wc__internal_is_replaced(svn_boolean_t *replaced, + svn_wc__db_t *db, + const char *local_abspath, + apr_pool_t *scratch_pool) +{ + svn_wc__db_status_t status; + svn_boolean_t base_shadowed; + svn_wc__db_status_t base_status; + + SVN_ERR(svn_wc__db_read_info( + &status, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, &base_shadowed, + NULL, NULL, + db, local_abspath, + scratch_pool, scratch_pool)); + if (base_shadowed) + SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + NULL, NULL, NULL, + db, local_abspath, + scratch_pool, scratch_pool)); + + *replaced = ((status == svn_wc__db_status_added + || status == svn_wc__db_status_obstructed_add) + && base_shadowed + && base_status != svn_wc__db_status_not_present); + + return SVN_NO_ERROR; +} + + +svn_error_t * +svn_wc__node_is_replaced(svn_boolean_t *replaced, + svn_wc_context_t *wc_ctx, + const char *local_abspath, + apr_pool_t *scratch_pool) +{ + SVN_ERR(svn_wc__internal_is_replaced(replaced, wc_ctx->db, + local_abspath, scratch_pool)); +} + + svn_error_t * svn_wc__node_get_base_rev(svn_revnum_t *base_revision, svn_wc_context_t *wc_ctx, Modified: subversion/trunk/subversion/libsvn_wc/questions.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=937452&r1=937451&r2=937452&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/questions.c (original) +++ subversion/trunk/subversion/libsvn_wc/questions.c Fri Apr 23 18:17:37 2010 @@ -567,41 +567,3 @@ svn_wc__marked_as_binary(svn_boolean_t * return SVN_NO_ERROR; } - - -/* Equivalent to the old notion of "entry->schedule == schedule_replace" */ -svn_error_t * -svn_wc__internal_is_replaced(svn_boolean_t *replaced, - svn_wc__db_t *db, - const char *local_abspath, - apr_pool_t *scratch_pool) -{ - svn_wc__db_status_t status; - svn_boolean_t base_shadowed; - svn_wc__db_status_t base_status; - - SVN_ERR(svn_wc__db_read_info( - &status, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, &base_shadowed, - NULL, NULL, - db, local_abspath, - scratch_pool, scratch_pool)); - if (base_shadowed) - SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - NULL, NULL, NULL, - db, local_abspath, - scratch_pool, scratch_pool)); - - *replaced = ((status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add) - && base_shadowed - && base_status != svn_wc__db_status_not_present); - - return SVN_NO_ERROR; -}