subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
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 GMT
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--;
         }
     }
 



Mime
View raw message