subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1712966 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_branch.h libsvn_delta/branch.c libsvn_delta/branch_nested.c
Date Fri, 06 Nov 2015 14:08:24 GMT
Author: julianfoad
Date: Fri Nov  6 14:08:24 2015
New Revision: 1712966

URL: http://svn.apache.org/viewvc?rev=1712966&view=rev
Log:
On the 'move-tracking-2' branch: Remove svn_branch_instantiate_elements()
from the public API and reimplement svn_branch_instantiate_elements_r() in a
way that will work with a class derived from the branch_state class.

* subversion/include/private/svn_branch.h,
  subversion/libsvn_delta/branch.c
  (branch_instantiate_elements): Rename from
    'svn_branch_instantiate_elements' and make private.
  (branch_txn_branch): Track the rename.

* subversion/libsvn_delta/branch_nested.c
  (branch_instantiate_elements): New function, similar to the one above but
    using the public methods of the branch_state class.
  (svn_branch_instantiate_elements_r): Use it.

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/branch_nested.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=1712966&r1=1712965&r2=1712966&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 Nov  6
14:08:24 2015
@@ -613,16 +613,6 @@ svn_error_t *
 svn_branch_state_purge(svn_branch_state_t *branch,
                        apr_pool_t *scratch_pool);
 
-/* Instantiate elements in a branch.
- *
- * In TO_BRANCH, instantiate (or alter, if existing) each element of
- * ELEMENTS, each with its given tree structure (parent, name) and payload.
- */
-svn_error_t *
-svn_branch_instantiate_elements(svn_branch_state_t *to_branch,
-                                const svn_element_tree_t *elements,
-                                apr_pool_t *scratch_pool);
-
 /* Create a copy of NEW_SUBTREE in TO_BRANCH.
  *
  * For each non-root element in NEW_SUBTREE, create a new element with

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=1712966&r1=1712965&r2=1712966&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Fri Nov  6 14:08:24
2015
@@ -81,6 +81,11 @@ branch_state_create(const char *bid,
                     svn_branch_txn_t *txn,
                     apr_pool_t *result_pool);
 
+static svn_error_t *
+branch_instantiate_elements(svn_branch_state_t *to_branch,
+                            const svn_element_tree_t *elements,
+                            apr_pool_t *scratch_pool);
+
 /*  */
 static apr_pool_t *
 branch_state_pool_get(svn_branch_state_t *branch)
@@ -282,8 +287,8 @@ branch_txn_branch(svn_branch_txn_t *txn,
                                              from->eid, scratch_pool);
 
   /* Populate the mapping from the 'from' source */
-  SVN_ERR(svn_branch_instantiate_elements(new_branch, from_subtree,
-                                          scratch_pool));
+  SVN_ERR(branch_instantiate_elements(new_branch, from_subtree,
+                                      scratch_pool));
   new_branch->priv->is_flat = TRUE;
 
   if (new_branch_p)
@@ -1184,14 +1189,18 @@ svn_branch_map_add_subtree(svn_branch_st
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_branch_instantiate_elements(svn_branch_state_t *to_branch,
-                                const svn_element_tree_t *elements,
-                                apr_pool_t *scratch_pool)
+/* Instantiate elements in a branch.
+ *
+ * In TO_BRANCH, instantiate (or alter, if existing) each element of
+ * ELEMENTS, each with its given tree structure (parent, name) and payload.
+ */
+static svn_error_t *
+branch_instantiate_elements(svn_branch_state_t *to_branch,
+                            const svn_element_tree_t *elements,
+                            apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *hi;
 
-  /* Instantiate all the elements of NEW_SUBTREE */
   for (hi = apr_hash_first(scratch_pool, elements->e_map);
        hi; hi = apr_hash_next(hi))
     {

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/branch_nested.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/branch_nested.c?rev=1712966&r1=1712965&r2=1712966&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch_nested.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch_nested.c Fri Nov  6
14:08:24 2015
@@ -213,13 +213,38 @@ svn_branch_subtree_get_subbranch_at_eid(
   return subtree;
 }
 
+/* Instantiate ELEMENTS in TO_BRANCH.
+ */
+static svn_error_t *
+branch_instantiate_elements(svn_branch_state_t *to_branch,
+                            const svn_element_tree_t *elements,
+                            apr_pool_t *scratch_pool)
+{
+  apr_hash_index_t *hi;
+
+  for (hi = apr_hash_first(scratch_pool, elements->e_map);
+       hi; hi = apr_hash_next(hi))
+    {
+      int this_eid = svn_int_hash_this_key(hi);
+      svn_element_content_t *this_element = apr_hash_this_val(hi);
+
+      svn_branch_state_alter_one(to_branch, this_eid,
+                                 this_element->parent_eid,
+                                 this_element->name,
+                                 this_element->payload,
+                                 scratch_pool);
+    }
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_branch_instantiate_elements_r(svn_branch_state_t *to_branch,
                                   svn_branch_subtree_t elements,
                                   apr_pool_t *scratch_pool)
 {
-  SVN_ERR(svn_branch_instantiate_elements(to_branch, elements.tree,
-                                          scratch_pool));
+  SVN_ERR(branch_instantiate_elements(to_branch, elements.tree,
+                                      scratch_pool));
 
   /* branch any subbranches */
   {



Mime
View raw message