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 6E45910BDA for ; Fri, 16 Oct 2015 10:39:12 +0000 (UTC) Received: (qmail 24398 invoked by uid 500); 16 Oct 2015 10:39:11 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 24365 invoked by uid 500); 16 Oct 2015 10:39:11 -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 24355 invoked by uid 99); 16 Oct 2015 10:39:11 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2015 10:39:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 06E491809BA for ; Fri, 16 Oct 2015 10:39:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.79 X-Spam-Level: * X-Spam-Status: No, score=1.79 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id GFDk3Dm9ZeZK for ; Fri, 16 Oct 2015 10:39:10 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 3D56A4448D for ; Fri, 16 Oct 2015 10:38:44 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5AA51E04C2 for ; Fri, 16 Oct 2015 10:38:43 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 55F2F3A06F6 for ; Fri, 16 Oct 2015 10:38:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1708952 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_branch.h libsvn_delta/branch.c libsvn_delta/compat3e.c Date: Fri, 16 Oct 2015 10:38:43 -0000 To: commits@subversion.apache.org From: julianfoad@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151016103843.55F2F3A06F6@svn01-us-west.apache.org> Author: julianfoad Date: Fri Oct 16 10:38:43 2015 New Revision: 1708952 URL: http://svn.apache.org/viewvc?rev=1708952&view=rev Log: On the 'move-tracking-2' branch: Tweak. * subversion/include/private/svn_branch.h, subversion/libsvn_delta/branch.c (svn_branch_revision_root_get_branches): Return a copy of the array. * subversion/libsvn_delta/compat3e.c (drive_changes): Use svn_branch_revision_root_get_branches() instead of direct access. (editor3_sequence_point): Use svn_branch_revision_root_get_branches() instead of direct access, and thus simplify a little. Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h?rev=1708952&r1=1708951&r2=1708952&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h (original) +++ subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h Fri Oct 16 10:38:43 2015 @@ -162,7 +162,7 @@ svn_branch_revision_root_create(svn_bran * * Return an empty array if there are none. */ -const apr_array_header_t * +apr_array_header_t * svn_branch_revision_root_get_branches(svn_branch_revision_root_t *rev_root, apr_pool_t *result_pool); Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c?rev=1708952&r1=1708951&r2=1708952&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original) +++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Fri Oct 16 10:38:43 2015 @@ -171,11 +171,11 @@ svn_branch_txn_finalize_eids(svn_branch_ return SVN_NO_ERROR; } -const apr_array_header_t * +apr_array_header_t * svn_branch_revision_root_get_branches(svn_branch_revision_root_t *rev_root, apr_pool_t *result_pool) { - return rev_root->branches; + return apr_array_copy(result_pool, rev_root->branches); } svn_branch_state_t * Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1708952&r1=1708951&r2=1708952&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original) +++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Fri Oct 16 10:38:43 2015 @@ -1817,6 +1817,7 @@ static svn_error_t * drive_changes(ev3_from_delta_baton_t *eb, apr_pool_t *scratch_pool) { + apr_array_header_t *branches; int i; const apr_array_header_t *paths; @@ -1828,10 +1829,11 @@ drive_changes(ev3_from_delta_baton_t *eb */ /* Process one hierarchy of nested branches at a time. */ - for (i = 0; i < eb->edited_rev_root->branches->nelts; i++) + branches = svn_branch_revision_root_get_branches(eb->edited_rev_root, + scratch_pool); + for (i = 0; i < branches->nelts; i++) { - svn_branch_state_t *root_branch - = APR_ARRAY_IDX(eb->edited_rev_root->branches, i, void *); + svn_branch_state_t *root_branch = APR_ARRAY_IDX(branches, i, void *); apr_hash_t *paths_final; const char *top_path = branch_get_storage_root_rrpath(root_branch, @@ -1905,6 +1907,7 @@ editor3_sequence_point(void *baton, apr_pool_t *scratch_pool) { ev3_from_delta_baton_t *eb = baton; + apr_array_header_t *branches; int i; /* first, purge elements in each branch */ @@ -1917,10 +1920,11 @@ editor3_sequence_point(void *baton, } /* second, purge branches that are no longer nested */ - for (i = 0; i < eb->edited_rev_root->branches->nelts; i++) + branches = svn_branch_revision_root_get_branches(eb->edited_rev_root, + scratch_pool); + for (i = 0; i < branches->nelts; i++) { - svn_branch_state_t *b - = APR_ARRAY_IDX(eb->edited_rev_root->branches, i, void *); + svn_branch_state_t *b = APR_ARRAY_IDX(branches, i, void *); svn_branch_state_t *outer_branch; int outer_eid; @@ -1931,8 +1935,6 @@ editor3_sequence_point(void *baton, && ! svn_branch_get_element(outer_branch, outer_eid)) { svn_branch_revision_root_delete_branch(b->rev_root, b, scratch_pool); - /* Re-visit this position in the array */ - i--; } }