You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/10/14 12:20:10 UTC

svn commit: r1708578 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_branch.h libsvn_delta/branch.c libsvn_delta/compat3e.c

Author: julianfoad
Date: Wed Oct 14 10:20:10 2015
New Revision: 1708578

URL: http://svn.apache.org/viewvc?rev=1708578&view=rev
Log:
On the 'move-tracking-2' branch: Following r1708550, remove the 'root
branches' field of the branch state object.

* subversion/include/private/svn_branch.h
  (svn_branch_revision_root_t): Remove the 'root branches' field. Update a
    comment.

* subversion/libsvn_delta/branch.c
  (svn_branch_revision_root_create,
   svn_branch_add_new_branch,
   svn_branch_revision_root_delete_branch,
   svn_branch_revision_root_parse): No longer update the 'root branches'
    field.

* subversion/libsvn_delta/compat3e.c
  (drive_changes): Adjust the way of looping over all 'root branches'.

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=1708578&r1=1708577&r2=1708578&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 Wed Oct 14 10:20:10 2015
@@ -143,10 +143,7 @@ typedef struct svn_branch_revision_root_
    * (skipping -1). */
   int first_eid, next_eid;
 
-  /* The root branches, indexed by top-level branch id (0...N). */
-  apr_array_header_t *root_branches;
-
-  /* All branches, including root branches. */
+  /* All branches. */
   apr_array_header_t *branches;
 
 } svn_branch_revision_root_t;
@@ -242,8 +239,7 @@ struct svn_branch_state_t
 
   /* EID -> svn_branch_el_rev_content_t mapping. */
   /* ### TODO: This should use an svn_branch_subtree_t instead of E_MAP and
-   *     ROOT_EID. And the immediate subbranches would be directly in there,
-   *     instead of (or as well as) being in a single big list in REV_ROOT.
+   *     ROOT_EID.
    *     And a whole bunch of methods would be common to both. */
   apr_hash_t *e_map;
 

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=1708578&r1=1708577&r2=1708578&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Wed Oct 14 10:20:10 2015
@@ -60,7 +60,6 @@ svn_branch_revision_root_create(svn_bran
   rev_root->repos = repos;
   rev_root->rev = rev;
   rev_root->base_rev = base_rev;
-  rev_root->root_branches = apr_array_make(result_pool, 0, sizeof(void *));
   rev_root->branches = svn_array_make(result_pool);
   return rev_root;
 }
@@ -744,8 +743,6 @@ svn_branch_add_new_branch(const char *bi
                                        rev_root->branches->pool);
 
   SVN_ARRAY_PUSH(rev_root->branches) = new_branch;
-  if (!strchr(bid, '.'))
-    SVN_ARRAY_PUSH(rev_root->root_branches) = new_branch;
 
   return new_branch;
 }
@@ -771,17 +768,6 @@ svn_branch_revision_root_delete_branch(
           break;
         }
     }
-  for (SVN_ARRAY_ITER(bi, rev_root->root_branches, scratch_pool))
-    {
-      if (bi->val == branch)
-        {
-          SVN_DBG(("deleting root-branch b%s e%d",
-                   svn_branch_get_id(bi->val, bi->iterpool),
-                   bi->val->root_eid));
-          svn_sort__array_delete(rev_root->root_branches, bi->i, 1);
-          break;
-        }
-    }
 }
 
 /*
@@ -998,12 +984,6 @@ svn_branch_revision_root_parse(svn_branc
       SVN_ERR(svn_branch_state_parse(&branch, rev_root, stream,
                                      result_pool, scratch_pool));
       SVN_ARRAY_PUSH(rev_root->branches) = branch;
-
-      /* Note the root branches */
-      if (! strchr(branch->bid, '.'))
-        {
-          APR_ARRAY_PUSH(rev_root->root_branches, void *) = branch;
-        }
     }
 
   *rev_root_p = rev_root;

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=1708578&r1=1708577&r2=1708578&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Wed Oct 14 10:20:10 2015
@@ -1821,10 +1821,10 @@ 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->root_branches->nelts; i++)
+  for (i = 0; i < eb->edited_rev_root->branches->nelts; i++)
     {
       svn_branch_state_t *root_branch
-        = APR_ARRAY_IDX(eb->edited_rev_root->root_branches, i, void *);
+        = APR_ARRAY_IDX(eb->edited_rev_root->branches, i, void *);
       apr_hash_t *paths_final;
 
       const char *top_path = branch_get_storage_root_rrpath(root_branch,
@@ -1833,6 +1833,9 @@ drive_changes(ev3_from_delta_baton_t *eb
       svn_branch_state_t *base_root_branch;
       svn_boolean_t branch_is_new;
 
+      if (strchr(root_branch->bid, '.'))
+        continue;  /* that's not a root branch */
+
       SVN_ERR(svn_branch_repos_get_branch_by_id(&base_root_branch,
                                                 eb->edited_rev_root->repos,
                                                 eb->edited_rev_root->base_rev,