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 EFAB09932 for ; Fri, 2 Mar 2012 08:39:54 +0000 (UTC) Received: (qmail 6164 invoked by uid 500); 2 Mar 2012 08:39:54 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 6040 invoked by uid 500); 2 Mar 2012 08:39:54 -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 5661 invoked by uid 99); 2 Mar 2012 08:39:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 08:39:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [78.47.87.163] (HELO mx0.elegosoft.com) (78.47.87.163) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2012 08:39:46 +0000 Received: from localhost (localhost [127.0.0.1]) by mx0.elegosoft.com (Postfix) with ESMTP id CE3D8DE95D; Fri, 2 Mar 2012 09:39:24 +0100 (CET) Received: from mx0.elegosoft.com ([127.0.0.1]) by localhost (mx0.elegosoft.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LZD+pjkYYSgH; Fri, 2 Mar 2012 09:39:24 +0100 (CET) Received: from daniel3.local (bzq-79-180-206-85.red.bezeqint.net [79.180.206.85]) by mx0.elegosoft.com (Postfix) with ESMTPSA id 8FD1EDE861; Fri, 2 Mar 2012 09:39:23 +0100 (CET) Date: Fri, 2 Mar 2012 10:39:13 +0200 From: Daniel Shahaf To: dev@subversion.apache.org Cc: commits@subversion.apache.org, Hyrum K Wright Subject: Re: svn commit: r1296056 - /subversion/trunk/subversion/libsvn_client/util.c Message-ID: <20120302083913.GA20019@daniel3.local> References: <20120302053322.D1A7D23889B8@eris.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120302053322.D1A7D23889B8@eris.apache.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Checked: Checked by ClamAV on apache.org Eewww: I pressed 'page down' and the picture didn't change. (Duplicate block of code.) Break out a helper function? hwright@apache.org wrote on Fri, Mar 02, 2012 at 05:33:22 -0000: > Author: hwright > Date: Fri Mar 2 05:33:22 2012 > New Revision: 1296056 > > URL: http://svn.apache.org/viewvc?rev=1296056&view=rev > Log: > In the client-side ra Ev2 shim callbacks, make sure we handle copyfrom paths > correctly. > > Current number of test failures over ra_svn: 357 > > * subversion/libsvn_client/util.c > (fetch_props_func, fetch_kind_func, fetch_base_func): Detect and appropriately > munge copyfrom urls as paths. > > Modified: > subversion/trunk/subversion/libsvn_client/util.c > > Modified: subversion/trunk/subversion/libsvn_client/util.c > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/util.c?rev=1296056&r1=1296055&r2=1296056&view=diff > ============================================================================== > --- subversion/trunk/subversion/libsvn_client/util.c (original) > +++ subversion/trunk/subversion/libsvn_client/util.c Fri Mar 2 05:33:22 2012 > @@ -256,8 +256,25 @@ fetch_props_func(apr_hash_t **props, > apr_pool_t *scratch_pool) > { > struct shim_callbacks_baton *scb = baton; > - const char *local_abspath = svn_dirent_join(scb->anchor_abspath, path, > - scratch_pool); > + const char *local_abspath; > + > + if (svn_path_is_url(path)) > + { > + /* This is a copyfrom URL */ > + const char *wcroot_abspath; > + const char *wcroot_url; > + const char *relpath; > + > + SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, scb->wc_ctx, > + scb->anchor_abspath, > + scratch_pool, scratch_pool)); > + SVN_ERR(svn_wc__node_get_url(&wcroot_url, scb->wc_ctx, wcroot_abspath, > + scratch_pool, scratch_pool)); > + relpath = svn_uri_skip_ancestor(wcroot_url, path, scratch_pool); > + local_abspath = svn_dirent_join(wcroot_abspath, relpath, scratch_pool); > + } > + else > + local_abspath = svn_dirent_join(scb->anchor_abspath, path, scratch_pool); > > SVN_ERR(svn_wc_get_pristine_props(props, scb->wc_ctx, local_abspath, > result_pool, scratch_pool)); > @@ -274,8 +291,25 @@ fetch_kind_func(svn_kind_t *kind, > { > struct shim_callbacks_baton *scb = baton; > svn_node_kind_t node_kind; > - const char *local_abspath = svn_dirent_join(scb->anchor_abspath, path, > - scratch_pool); > + const char *local_abspath; > + > + if (svn_path_is_url(path)) > + { > + /* This is a copyfrom URL */ > + const char *wcroot_abspath; > + const char *wcroot_url; > + const char *relpath; > + > + SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, scb->wc_ctx, > + scb->anchor_abspath, > + scratch_pool, scratch_pool)); > + SVN_ERR(svn_wc__node_get_url(&wcroot_url, scb->wc_ctx, wcroot_abspath, > + scratch_pool, scratch_pool)); > + relpath = svn_uri_skip_ancestor(wcroot_url, path, scratch_pool); > + local_abspath = svn_dirent_join(wcroot_abspath, relpath, scratch_pool); > + } > + else > + local_abspath = svn_dirent_join(scb->anchor_abspath, path, scratch_pool); > > SVN_ERR(svn_wc_read_kind(&node_kind, scb->wc_ctx, local_abspath, FALSE, > scratch_pool)); > @@ -293,12 +327,29 @@ fetch_base_func(const char **filename, > apr_pool_t *scratch_pool) > { > struct shim_callbacks_baton *scb = baton; > - const char *local_abspath = svn_dirent_join(scb->anchor_abspath, path, > - scratch_pool); > + const char *local_abspath; > svn_stream_t *pristine_stream; > svn_stream_t *temp_stream; > svn_error_t *err; > > + if (svn_path_is_url(path)) > + { > + /* This is a copyfrom URL */ > + const char *wcroot_abspath; > + const char *wcroot_url; > + const char *relpath; > + > + SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, scb->wc_ctx, > + scb->anchor_abspath, > + scratch_pool, scratch_pool)); > + SVN_ERR(svn_wc__node_get_url(&wcroot_url, scb->wc_ctx, wcroot_abspath, > + scratch_pool, scratch_pool)); > + relpath = svn_uri_skip_ancestor(wcroot_url, path, scratch_pool); > + local_abspath = svn_dirent_join(wcroot_abspath, relpath, scratch_pool); > + } > + else > + local_abspath = svn_dirent_join(scb->anchor_abspath, path, scratch_pool); > + > err = svn_wc_get_pristine_contents2(&pristine_stream, scb->wc_ctx, > local_abspath, scratch_pool, > scratch_pool); > >