subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1677855 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_branch.h libsvn_delta/branch.c
Date Tue, 05 May 2015 16:18:01 GMT
Author: julianfoad
Date: Tue May  5 16:18:01 2015
New Revision: 1677855

URL: http://svn.apache.org/r1677855
Log:
On the 'move-tracking-2' branch: Delete a branch_state_t API function that
assumed branch state would have access by paths.

* subversion/include/private/svn_branch.h,
  subversion/libsvn_delta/branch.c
  (svn_branch_get_subbranches): Delete.
  (svn_branch_get_subtree): Gather subbranches a different way, using
    svn_branch_get_all_subbranches() instead of svn_branch_get_subbranches().

Modified:
    subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.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=1677855&r1=1677854&r2=1677855&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 Tue May  5
16:18:01 2015
@@ -247,15 +247,6 @@ svn_branch_delete_branch_r(svn_branch_st
                            apr_pool_t *scratch_pool);
 
 /* Return an array of pointers to the branches that are immediate
- * sub-branches of BRANCH at or below EID.
- */
-apr_array_header_t *
-svn_branch_get_subbranches(const svn_branch_state_t *branch,
-                           int eid,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
-
-/* Return an array of pointers to the branches that are immediate
  * sub-branches of BRANCH.
  */
 apr_array_header_t *

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=1677855&r1=1677854&r2=1677855&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Tue May  5 16:18:01
2015
@@ -411,14 +411,23 @@ svn_branch_get_subtree(const svn_branch_
                      -1, "", subtree_root_element->payload, result_pool));
 
   /* Add subbranches */
-  for (SVN_ARRAY_ITER(bi, svn_branch_get_subbranches(branch, eid,
-                                                     result_pool, result_pool),
-                      result_pool))
+  for (SVN_ARRAY_ITER(bi, svn_branch_get_all_subbranches(
+                            branch, result_pool, result_pool), result_pool))
     {
-      svn_branch_subtree_t *this_subtree
-        = svn_branch_get_subtree(bi->val, bi->val->root_eid, result_pool);
+      svn_branch_state_t *subbranch = bi->val;
+      const char *subbranch_relpath_in_subtree
+        = svn_branch_subtree_get_path_by_eid(new_subtree, subbranch->outer_eid,
+                                             bi->iterpool);
 
-      svn_int_hash_set(new_subtree->subbranches, bi->val->outer_eid, this_subtree);
+      /* Is it pathwise at or below EID? If so, add it into the subtree. */
+      if (subbranch_relpath_in_subtree)
+        {
+          svn_branch_subtree_t *this_subtree
+            = svn_branch_get_subtree(subbranch, subbranch->root_eid, result_pool);
+
+          svn_int_hash_set(new_subtree->subbranches, subbranch->outer_eid,
+                           this_subtree);
+        }
     }
   return new_subtree;
 }
@@ -734,31 +743,6 @@ svn_branch_instantiate_subtree(svn_branc
 }
 
 apr_array_header_t *
-svn_branch_get_subbranches(const svn_branch_state_t *branch,
-                           int eid,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
-{
-  const char *top_rrpath = svn_branch_get_rrpath_by_eid(branch, eid,
-                                                        scratch_pool);
-  svn_array_t *subbranches = svn_array_make(result_pool);
-  SVN_ITER_T(svn_branch_state_t) *bi;
-
-  for (SVN_ARRAY_ITER(bi, branch->rev_root->branches, scratch_pool))
-    {
-      svn_branch_state_t *subbranch = bi->val;
-      const char *subbranch_root_rrpath
-        = svn_branch_get_root_rrpath(subbranch, bi->iterpool);
-
-      /* Is it an immediate child at or below EID? */
-      if (subbranch->outer_branch == branch
-          && svn_relpath_skip_ancestor(top_rrpath, subbranch_root_rrpath))
-        SVN_ARRAY_PUSH(subbranches) = bi->val;
-    }
-  return subbranches;
-}
-
-apr_array_header_t *
 svn_branch_get_all_subbranches(const svn_branch_state_t *branch,
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool)



Mime
View raw message