Return-Path: Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: (qmail 44490 invoked from network); 22 Apr 2010 12:19:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Apr 2010 12:19:27 -0000 Received: (qmail 28024 invoked by uid 500); 22 Apr 2010 12:19:26 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 27975 invoked by uid 500); 22 Apr 2010 12:19:26 -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 27968 invoked by uid 99); 22 Apr 2010 12:19:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 12:19:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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, 22 Apr 2010 12:19:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4029E23888CC; Thu, 22 Apr 2010 12:18:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r936809 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/diff.c libsvn_wc/node.c Date: Thu, 22 Apr 2010 12:18:37 -0000 To: commits@subversion.apache.org From: cmpilato@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100422121837.4029E23888CC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cmpilato Date: Thu Apr 22 12:18:36 2010 New Revision: 936809 URL: http://svn.apache.org/viewvc?rev=936809&view=rev Log: Irradicate the last remaining svn_wc_entry_t instance in the libsvn_client diff logic. * subversion/include/private/svn_wc_private.h, * subversion/libsvn_wc/node.c (svn_wc__node_get_copyfrom_info): New. * subversion/libsvn_client/diff.c (convert_to_url): Trade use of svn_wc_entry_t for some WC-NG node functions. Modified: subversion/trunk/subversion/include/private/svn_wc_private.h subversion/trunk/subversion/libsvn_client/diff.c subversion/trunk/subversion/libsvn_wc/node.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=936809&r1=936808&r2=936809&view=diff ============================================================================== --- subversion/trunk/subversion/include/private/svn_wc_private.h (original) +++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Apr 22 12:18:36 2010 @@ -361,6 +361,21 @@ svn_wc__node_get_url(const char **url, /** + * Set @a *copyfrom_url to the corresponding copy-from URL, and @a + * copyfrom_rev to the corresponding copy-from revision, of @a + * local_abspath, using @a wc_ctx. If @a local_abspath does not + * represent the root of a copied subtree, set @a *copyfrom_rev to + * NULL and @a copyfrom_rev to @c SVN_INVALID_REVNUM. + */ +svn_error_t * +svn_wc__node_get_copyfrom_info(const char **copyfrom_url, + svn_revnum_t *copyfrom_rev, + svn_wc_context_t *wc_ctx, + const char *local_abspath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + +/** * Recursively call @a callbacks->found_node for all nodes underneath * @a local_abspath. */ Modified: subversion/trunk/subversion/libsvn_client/diff.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=936809&r1=936808&r2=936809&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/diff.c (original) +++ subversion/trunk/subversion/libsvn_client/diff.c Thu Apr 22 12:18:36 2010 @@ -880,22 +880,21 @@ convert_to_url(const char **url, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { - const svn_wc_entry_t *entry; - if (svn_path_is_url(abspath_or_url)) { *url = apr_pstrdup(result_pool, abspath_or_url); return SVN_NO_ERROR; } - SVN_ERR(svn_wc__get_entry_versioned(&entry, wc_ctx, abspath_or_url, - svn_node_unknown, FALSE, FALSE, - scratch_pool, scratch_pool)); - - if (entry->url) - *url = apr_pstrdup(result_pool, entry->url); - else - *url = apr_pstrdup(result_pool, entry->copyfrom_url); + SVN_ERR(svn_wc__node_get_url(url, wc_ctx, abspath_or_url, + result_pool, scratch_pool)); + if (! *url) + { + svn_revnum_t copyfrom_rev; + SVN_ERR(svn_wc__node_get_copyfrom_info(url, ©from_rev, + wc_ctx, abspath_or_url, + result_pool, scratch_pool)); + } return SVN_NO_ERROR; } Modified: subversion/trunk/subversion/libsvn_wc/node.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=936809&r1=936808&r2=936809&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/node.c (original) +++ subversion/trunk/subversion/libsvn_wc/node.c Thu Apr 22 12:18:36 2010 @@ -338,6 +338,39 @@ svn_wc__node_get_url(const char **url, result_pool, scratch_pool)); } +svn_error_t * +svn_wc__node_get_copyfrom_info(const char **copyfrom_url, + svn_revnum_t *copyfrom_rev, + svn_wc_context_t *wc_ctx, + const char *local_abspath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + svn_wc__db_t *db = wc_ctx->db; + const char *original_root_url; + const char *original_repos_relpath; + svn_revnum_t original_revision; + + *copyfrom_url = NULL; + *copyfrom_rev = SVN_INVALID_REVNUM; + + SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, &original_repos_relpath, + &original_root_url, NULL, &original_revision, + NULL, NULL, NULL, NULL, NULL, db, + local_abspath, scratch_pool, scratch_pool)); + if (original_root_url && original_repos_relpath) + { + *copyfrom_url = svn_path_url_add_component2(original_root_url, + original_repos_relpath, + result_pool); + *copyfrom_rev = original_revision; + } + + return SVN_NO_ERROR; +} + /* A recursive node-walker, helper for svn_wc__node_walk_children(). */ static svn_error_t *