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/09/30 15:01:25 UTC

svn commit: r1706019 - /subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Author: julianfoad
Date: Wed Sep 30 13:01:25 2015
New Revision: 1706019

URL: http://svn.apache.org/viewvc?rev=1706019&view=rev
Log:
On the 'move-tracking-2' branch: Tweak code to use more editor API
calls and fewer direct calls.

* subversion/svnmover/svnmover.c
  (wc_commit): Use do_topbranch(), which drives the editor, instead of
    svn_branch_branch_subtree().

Modified:
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

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=1706019&r1=1706018&r2=1706019&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed Sep 30 13:01:25 2015
@@ -452,6 +452,13 @@ static svn_error_t *
 display_diff_of_commit(const commit_callback_baton_t *ccbb,
                        apr_pool_t *scratch_pool);
 
+static svn_error_t *
+do_topbranch(const char **new_branch_id_p,
+             svn_editor3_t *editor,
+             svn_branch_rev_bid_eid_t *from,
+             apr_pool_t *result_pool,
+             apr_pool_t *scratch_pool);
+
 /* Commit the changes from WC into the repository.
  *
  * Open a new commit txn to the repo. Replay the changes from WC into it.
@@ -525,15 +532,15 @@ 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.) */
-      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, 0, /*outer_branch,outer_eid*/
-                                        scratch_pool));
-      edit_root_branch_id = svn_branch_get_id(edit_root_branch, scratch_pool);
+      svn_branch_rev_bid_eid_t *from
+        = svn_branch_rev_bid_eid_create(wc->base->revision, wc->base->branch_id,
+                                        wc->base->branch->root_eid,
+                                        scratch_pool);
+
+      SVN_ERR(do_topbranch(&edit_root_branch_id, commit_editor,
+                           from, scratch_pool, scratch_pool));
+      edit_root_branch = svn_branch_revision_root_get_branch_by_id(
+                           commit_txn, edit_root_branch_id, scratch_pool);
     }
   SVN_ERR(replay(commit_editor,
                  edit_root_branch_id,