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/08/20 15:07:59 UTC

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

Author: julianfoad
Date: Thu Aug 20 13:07:58 2015
New Revision: 1696784

URL: http://svn.apache.org/r1696784
Log:
On the 'move-tracking-2' branch: Hide a tiny implementation detail.

* subversion/include/private/svn_branch.h
  (svn_branch_add_new_branch,
   svn_branch_branch_subtree): Document that when creating a top-level
    branch a new id is assigned and the OUTER_EID parameter ignored.

* subversion/libsvn_delta/branch.c
  (svn_branch_add_new_branch): When creating a top-level branch, assign it
    the next available top-branch number.

* subversion/svnmover/svnmover.c
  (wc_commit,
   do_topbranch): Pass 0 for the new top-level branch number instead of
    peeking into the implementation.

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/svnmover/svnmover.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=1696784&r1=1696783&r2=1696784&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 Thu Aug 20 13:07:58 2015
@@ -348,8 +348,8 @@ svn_branch_get_id(svn_branch_state_t *br
  *
  * Create and return a new branch object. Register its existence in REV_ROOT.
  *
- * If OUTER_BRANCH is NULL, create a top-level branch with OUTER_EID
- * as its top-level branch number. Otherise, create a branch that claims
+ * If OUTER_BRANCH is NULL, create a top-level branch with a new top-level
+ * branch number, ignoring OUTER_EID. Otherise, create a branch that claims
  * to be nested under OUTER_BRANCH:OUTER_EID, but do not require that
  * a subbranch root element exists there, nor create one.
  *
@@ -605,8 +605,8 @@ svn_branch_instantiate_subtree(svn_branc
  * branch, create new subbranches corresponding to any subbranches
  * specified in FROM_SUBTREE, recursively.
  *
- * If TO_OUTER_BRANCH is NULL, create a top-level branch with TO_OUTER_EID
- * as its top-level branch number. Otherise, create a branch that claims
+ * If TO_OUTER_BRANCH is NULL, create a top-level branch with a new top-level
+ * branch number, ignoring TO_OUTER_EID. Otherise, create a branch that claims
  * to be nested under TO_OUTER_BRANCH:TO_OUTER_EID, but do not require that
  * a subbranch root element exists there, nor create one.
  *

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=1696784&r1=1696783&r2=1696784&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Thu Aug 20 13:07:58 2015
@@ -848,6 +848,8 @@ svn_branch_add_new_branch(svn_branch_rev
 
   SVN_ERR_ASSERT_NO_RETURN(!outer_branch || outer_branch->rev_root == rev_root);
 
+  if (! outer_branch)
+    outer_eid = rev_root->root_branches->nelts;
   if (root_eid == -1)
     root_eid = svn_branch_allocate_new_eid(rev_root);
 

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1696784&r1=1696783&r2=1696784&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Thu Aug 20 13:07:58 2015
@@ -533,16 +533,13 @@ wc_commit(svn_revnum_t *new_rev_p,
     {
       /* Create a new top-level branch in the edited state. (It will have
          an independent new top-level branch number.) */
-      int top_branch_num = commit_txn->root_branches->nelts;
-
       SVN_ERR(svn_branch_branch_subtree(&edit_root_branch,
                                         *svn_branch_get_subtree(
                                           wc->base->branch,
                                           wc->base->branch->root_eid,
                                           scratch_pool),
                                         commit_txn,
-                                        NULL /*outer_branch*/,
-                                        top_branch_num /*outer_eid*/,
+                                        NULL, 0, /*outer_branch,outer_eid*/
                                         scratch_pool));
     }
   SVN_ERR(replay(commit_editor,
@@ -2239,7 +2236,6 @@ do_topbranch(svn_branch_state_t **new_br
              apr_pool_t *scratch_pool)
 {
   svn_branch_subtree_t *from_subtree;
-  int to_outer_eid; /* ### top-level branch number */
 
   /* Source element must exist */
   if (! svn_branch_get_path_by_eid(from_branch, from_eid, scratch_pool))
@@ -2253,13 +2249,10 @@ do_topbranch(svn_branch_state_t **new_br
 
   from_subtree = svn_branch_get_subtree(from_branch, from_eid, scratch_pool);
 
-  /* assign new top-level branch number to new branch */
-  to_outer_eid = from_branch->rev_root->root_branches->nelts;
-
   SVN_ERR(svn_branch_branch_subtree(new_branch_p,
                                     *from_subtree,
                                     rev_root,
-                                    NULL /*to_outer_branch*/, to_outer_eid,
+                                    NULL, 0, /*outer_branch,outer_eid*/
                                     scratch_pool));
 
   return SVN_NO_ERROR;