Author: julianfoad
Date: Wed Nov 12 16:02:40 2014
New Revision: 1638822

URL: http://svn.apache.org/r1638822
Log:
On the 'move-tracking-2' branch: Change the editor API so that the branch is
specified explicitly by each action instead of having a 'main' branch for
the whole edit.

* BRANCH-README
  Remove the 'todo' item.

* subversion/include/private/svn_editor3.h,
  subversion/libsvn_delta/compat3.c,
  subversion/libsvn_delta/editor3.c,
  subversion/svnmover/svnmover.c
  As above.

Modified:
    subversion/branches/move-tracking-2/BRANCH-README
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/BRANCH-README
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/BRANCH-README?rev=1638822&r1=1638821&r2=1638822&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/BRANCH-README (original)
+++ subversion/branches/move-tracking-2/BRANCH-README Wed Nov 12 16:02:40 2014
@@ -44,9 +44,6 @@ Work on this branch:
       provide a way to specify a mixed-rev base state
       merge: interpret the three arguments consistently as relative to
         the repo root
-      change the editor API so that the branch is specified explicitly
-        by each action instead of having a 'main' branch for the whole
-        edit
       synthesize element tracking info (instead of aborting) when reading
         a revision that was committed by a non-move-tracking client
       make the user interface degrade cross-branch moves so that the user
@@ -56,6 +53,9 @@ Work on this branch:
   * The model.
 
     To do:
+      clarify the sequencing requirements of editing: for example,
+        requesting the full path to an element implies finalization of
+        at least it and all its parent elements
       copying: model copying as a (tree) relationship between elements
         that is the same across all branches in a family?
 

Modified: 
subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h?rev=1638822&r1=1638821&r2=1638822&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h 
(original)
+++ 
subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h 
Wed Nov 12 16:02:40 2014
@@ -585,7 +585,9 @@ typedef int svn_editor3_eid_t;
  */
 typedef struct svn_editor3_node_content_t svn_editor3_node_content_t;
 
-struct svn_branch_el_rev_id_t;
+typedef struct svn_branch_el_rev_id_t svn_branch_el_rev_id_t;
+
+typedef struct svn_branch_instance_t svn_branch_instance_t;
 
 /** The kind of the checksum to be used throughout the #svn_editor3_t APIs.
  */
@@ -945,7 +947,7 @@ svn_editor3_put(svn_editor3_t *editor,
  *     but in that case the caller would need to specify the new eids.]
  */
 
-/** Create a new element (versioned object) of kind @a new_kind.
+/** Create a new element of kind @a new_kind in branch @a branch.
  * 
  * Assign the new element a new element id; store this in @a *eid_p if
  * @a eid_p is not null.
@@ -960,11 +962,12 @@ svn_error_t *
 svn_editor3_add(svn_editor3_t *editor,
                 svn_editor3_eid_t *eid,
                 svn_node_kind_t new_kind,
+                svn_branch_instance_t *branch,
                 svn_editor3_eid_t new_parent_eid,
                 const char *new_name,
                 const svn_editor3_node_content_t *new_content);
 
-/* Make the existing element @a eid exist in this branch, assuming it was
+/* Make the existing element @a eid exist in branch @a branch, assuming it was
  * previously not existing in this branch.
  *
  * This can be used to "branch" the element from another branch during a
@@ -980,12 +983,13 @@ svn_editor3_add(svn_editor3_t *editor,
  */
 svn_error_t *
 svn_editor3_instantiate(svn_editor3_t *editor,
+                        svn_branch_instance_t *branch,
                         svn_editor3_eid_t eid,
                         svn_editor3_eid_t new_parent_eid,
                         const char *new_name,
                         const svn_editor3_node_content_t *new_content);
 
-/** Create a new element that is copied (branched) from a pre-existing
+/** Create a new element that is copied from a pre-existing
  * <SVN_EDITOR3_WITH_COPY_FROM_THIS_REV> or newly created </>
  * element, with the same or different content.
  *
@@ -1014,8 +1018,9 @@ svn_editor3_instantiate(svn_editor3_t *e
  */
 svn_error_t *
 svn_editor3_copy_one(svn_editor3_t *editor,
+                     const svn_branch_el_rev_id_t *src_el_rev,
+                     svn_branch_instance_t *branch,
                      svn_editor3_eid_t local_eid,
-                     const struct svn_branch_el_rev_id_t *src_el_rev,
                      svn_editor3_eid_t new_parent_eid,
                      const char *new_name,
                      const svn_editor3_node_content_t *new_content);
@@ -1052,7 +1057,8 @@ svn_editor3_copy_one(svn_editor3_t *edit
  */
 svn_error_t *
 svn_editor3_copy_tree(svn_editor3_t *editor,
-                      const struct svn_branch_el_rev_id_t *src_el_rev,
+                      const svn_branch_el_rev_id_t *src_el_rev,
+                      svn_branch_instance_t *branch,
                       svn_editor3_eid_t new_parent_eid,
                       const char *new_name);
 
@@ -1102,6 +1108,7 @@ svn_editor3_copy_tree(svn_editor3_t *edi
 svn_error_t *
 svn_editor3_delete(svn_editor3_t *editor,
                    svn_revnum_t since_rev,
+                   svn_branch_instance_t *branch,
                    svn_editor3_eid_t eid);
 
 /** Alter the tree position and/or contents of the element identified
@@ -1125,6 +1132,7 @@ svn_editor3_delete(svn_editor3_t *editor
 svn_error_t *
 svn_editor3_alter(svn_editor3_t *editor,
                   svn_revnum_t since_rev,
+                  svn_branch_instance_t *branch,
                   svn_editor3_eid_t eid,
                   svn_editor3_eid_t new_parent_eid,
                   const char *new_name,
@@ -1239,6 +1247,7 @@ typedef svn_error_t *(*svn_editor3_cb_ad
   void *baton,
   svn_editor3_eid_t *eid,
   svn_node_kind_t new_kind,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t new_parent_eid,
   const char *new_name,
   const svn_editor3_node_content_t *new_content,
@@ -1248,6 +1257,7 @@ typedef svn_error_t *(*svn_editor3_cb_ad
  */
 typedef svn_error_t *(*svn_editor3_cb_instantiate_t)(
   void *baton,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t eid,
   svn_editor3_eid_t new_parent_eid,
   const char *new_name,
@@ -1258,8 +1268,9 @@ typedef svn_error_t *(*svn_editor3_cb_in
  */
 typedef svn_error_t *(*svn_editor3_cb_copy_one_t)(
   void *baton,
+  const svn_branch_el_rev_id_t *src_el_rev,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t local_eid,
-  const struct svn_branch_el_rev_id_t *src_el_rev,
   svn_editor3_eid_t new_parent_eid,
   const char *new_name,
   const svn_editor3_node_content_t *new_content,
@@ -1269,7 +1280,8 @@ typedef svn_error_t *(*svn_editor3_cb_co
  */
 typedef svn_error_t *(*svn_editor3_cb_copy_tree_t)(
   void *baton,
-  const struct svn_branch_el_rev_id_t *src_el_rev,
+  const svn_branch_el_rev_id_t *src_el_rev,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t new_parent_eid,
   const char *new_name,
   apr_pool_t *scratch_pool);
@@ -1279,6 +1291,7 @@ typedef svn_error_t *(*svn_editor3_cb_co
 typedef svn_error_t *(*svn_editor3_cb_delete_t)(
   void *baton,
   svn_revnum_t since_rev,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t eid,
   apr_pool_t *scratch_pool);
 
@@ -1287,6 +1300,7 @@ typedef svn_error_t *(*svn_editor3_cb_de
 typedef svn_error_t *(*svn_editor3_cb_alter_t)(
   void *baton,
   svn_revnum_t since_rev,
+  svn_branch_instance_t *branch,
   svn_editor3_eid_t eid,
   svn_editor3_eid_t new_parent_eid,
   const char *new_name,
@@ -1489,8 +1503,6 @@ svn_editor3_node_content_create_symlink(
 /* ### */
 #define SVN_ERR_BRANCHING 123456
 
-struct svn_branch_instance_t;
-
 /* Per-repository branching info.
  */
 typedef struct svn_branch_repos_t
@@ -1643,7 +1655,7 @@ svn_branch_sibling_create(svn_branch_fam
  * A branch instance object describes one branch in this family. (There is
  * one instance of this branch within each branch of its outer families.)
  */
-typedef struct svn_branch_instance_t
+struct svn_branch_instance_t
 {
   /* --- Identity of this object --- */
 
@@ -1666,7 +1678,7 @@ typedef struct svn_branch_instance_t
    * be calculated on demand not stored here. */
   const char *branch_root_rrpath;
 
-} svn_branch_instance_t;
+};
 
 /* Create a new branch instance object */
 svn_branch_instance_t *
@@ -1686,7 +1698,7 @@ typedef struct svn_branch_element_t
 */
 
 /* Branch-Element-Revision */
-typedef struct svn_branch_el_rev_id_t
+struct svn_branch_el_rev_id_t
 {
   /* The branch-instance that applies to REV. */
   svn_branch_instance_t *branch;
@@ -1696,7 +1708,7 @@ typedef struct svn_branch_el_rev_id_t
      ### Do we need this if BRANCH refers to a particular branch-revision? */
   svn_revnum_t rev;
 
-} svn_branch_el_rev_id_t;
+};
 
 /* Return a new el_rev_id object constructed with *shallow* copies of BRANCH,
  * EID and REV, allocated in RESULT_POOL.
@@ -1829,10 +1841,6 @@ svn_branch_revision_root_serialize(svn_s
                                    int next_fid,
                                    apr_pool_t *scratch_pool);
 
-/* Return the branch family of the main branch of @a editor. */
-svn_branch_family_t *
-svn_branch_get_family(svn_editor3_t *editor);
-
 /* Return (left, right) pairs of element content that differ between
  * subtrees LEFT and RIGHT.
 
@@ -1860,8 +1868,8 @@ svn_branch_branch(svn_editor3_t *editor,
                   const char *new_name,
                   apr_pool_t *scratch_pool);
 
-/* Change the existing simple sub-tree at OUTER_EID into a sub-branch in a
- * new branch family.
+/* Change the existing simple sub-tree at OUTER_BRANCH:OUTER_EID into a
+ * sub-branch in a new branch family.
  *
  * ### TODO: Also we must (in order to maintain correctness) branchify
  *     the corresponding subtrees in all other branches in this family.
@@ -1882,6 +1890,7 @@ svn_branch_branch(svn_editor3_t *editor,
  */
 svn_error_t *
 svn_branch_branchify(svn_editor3_t *editor,
+                     svn_branch_instance_t *outer_branch,
                      svn_editor3_eid_t outer_eid,
                      apr_pool_t *scratch_pool);
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c?rev=1638822&r1=1638821&r2=1638822&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c Wed 
Nov 12 16:02:40 2014
@@ -2885,32 +2885,6 @@ svn_branch_find_nested_branch_element_by
     *eid_p = branch_map_get_eid_by_rrpath(root_branch, rrpath, scratch_pool);
 }
 
-/* Find the deepest branch in REV_ROOT of which RRPATH is
- * either the root element or a normal, non-sub-branch element.
- * If EID_P is not null, set *EID_P to the EID of RRPATH in that branch.
- *
- * An element need not exist at RRPATH.
- *
- * The result will never be NULL.
- */
-static svn_branch_instance_t *
-svn_branch_revision_root_find_branch_element_by_rrpath(
-                                int *eid_p,
-                                svn_branch_revision_root_t *rev_root,
-                                const char *rrpath,
-                                apr_pool_t *scratch_pool)
-{
-  svn_branch_instance_t *branch;
-
-  svn_branch_find_nested_branch_element_by_rrpath(&branch, eid_p,
-                                                  rev_root->root_branch, 
rrpath,
-                                                  scratch_pool);
-
-  /* Any path must at least be within the repository root branch */
-  SVN_ERR_ASSERT_NO_RETURN(branch);
-  return branch;
-}
-
 /* Adjust BRANCH and its subbranches (recursively),
  * to reflect deletion of the subtree at EID.
  *
@@ -3217,13 +3191,8 @@ typedef struct ev3_from_delta_baton_t
   /* Moves recorded so far: from_relpath -> (char *)to_relpath. */
   apr_hash_t *moves;
 
-  /* The branch on which the per-element API is working */
-  /* ### Assumes most operations operate on a single branch. Not true for
-         operations such as "branch", "branchify", and those that recurse
-         into nested branches. For the time being, this just gives a
-         notion of a "main" branch for the editing. */
+  /* The branching state on which the per-element API is working */
   svn_branch_revision_root_t *edited_rev_root;
-  svn_branch_instance_t *edited_branch;
 
   apr_pool_t *edit_pool;
 } ev3_from_delta_baton_t;
@@ -4032,14 +4001,6 @@ svn_editor3_find_branch_element_by_rrpat
                                                   rrpath, scratch_pool);
 }
 
-svn_branch_family_t *
-svn_branch_get_family(svn_editor3_t *editor)
-{
-  ev3_from_delta_baton_t *eb = svn_editor3__get_baton(editor);
-  svn_branch_family_t *family = eb->edited_branch->sibling_defn->family;
-  return family;
-}
-
 svn_error_t *
 svn_branch_branch(svn_editor3_t *editor,
                   svn_branch_instance_t *from_branch,
@@ -4068,12 +4029,10 @@ svn_branch_branch(svn_editor3_t *editor,
 
 svn_error_t *
 svn_branch_branchify(svn_editor3_t *editor,
+                     svn_branch_instance_t *outer_branch,
                      svn_editor3_eid_t outer_eid,
                      apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = svn_editor3__get_baton(editor);
-  svn_branch_instance_t *outer_branch = eb->edited_branch;
-
   /* ### TODO: First check the element is not already a branch root
          and its subtree does not contain any branch roots. */
 
@@ -4118,13 +4077,12 @@ static svn_error_t *
 editor3_add(void *baton,
             svn_editor3_eid_t *eid_p,
             svn_node_kind_t new_kind,
+            svn_branch_instance_t *branch,
             svn_editor3_eid_t new_parent_eid,
             const char *new_name,
             const svn_editor3_node_content_t *new_content,
             apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = baton;
-  svn_branch_instance_t *branch = eb->edited_branch;
   int eid;
 
   eid = family_add_new_element(branch->sibling_defn->family);
@@ -4142,15 +4100,13 @@ editor3_add(void *baton,
 /* An #svn_editor3_t method. */
 static svn_error_t *
 editor3_instantiate(void *baton,
+                    svn_branch_instance_t *branch,
                     svn_editor3_eid_t eid,
                     svn_editor3_eid_t new_parent_eid,
                     const char *new_name,
                     const svn_editor3_node_content_t *new_content,
                     apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = baton;
-  svn_branch_instance_t *branch = eb->edited_branch;
-
   SVN_DBG(("add(e%d): parent e%d, name '%s', kind %s",
            /*branch->sibling->bid,*/ eid, new_parent_eid,
            new_name, svn_node_kind_to_word(new_content->kind)));
@@ -4162,8 +4118,9 @@ editor3_instantiate(void *baton,
 /* An #svn_editor3_t method. */
 static svn_error_t *
 editor3_copy_one(void *baton,
+                 const svn_branch_el_rev_id_t *src_el_rev,
+                 svn_branch_instance_t *branch,
                  svn_editor3_eid_t eid,
-                 const struct svn_branch_el_rev_id_t *src_el_rev,
                  svn_editor3_eid_t new_parent_eid,
                  const char *new_name,
                  const svn_editor3_node_content_t *new_content,
@@ -4183,13 +4140,11 @@ editor3_copy_one(void *baton,
 static svn_error_t *
 editor3_copy_tree(void *baton,
                   const svn_branch_el_rev_id_t *src_el_rev,
+                  svn_branch_instance_t *to_branch,
                   svn_editor3_eid_t new_parent_eid,
                   const char *new_name,
                   apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = baton;
-  svn_branch_instance_t *to_branch = eb->edited_branch;
-
   SVN_DBG(("copy_tree(e%d -> e%d/%s)",
            src_el_rev->eid, new_parent_eid, new_name));
 
@@ -4204,12 +4159,10 @@ editor3_copy_tree(void *baton,
 static svn_error_t *
 editor3_delete(void *baton,
                    svn_revnum_t since_rev,
+                   svn_branch_instance_t *branch,
                    svn_editor3_eid_t eid,
                    apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = baton;
-  svn_branch_instance_t *branch = eb->edited_branch;
-
   SVN_DBG(("delete(e%d)",
            /*branch->sibling_defn->bid,*/ eid));
 
@@ -4224,15 +4177,13 @@ editor3_delete(void *baton,
 static svn_error_t *
 editor3_alter(void *baton,
               svn_revnum_t since_rev,
+              svn_branch_instance_t *branch,
               svn_editor3_eid_t eid,
               svn_editor3_eid_t new_parent_eid,
               const char *new_name,
               const svn_editor3_node_content_t *new_content,
               apr_pool_t *scratch_pool)
 {
-  ev3_from_delta_baton_t *eb = baton;
-  svn_branch_instance_t *branch = eb->edited_branch;
-
   SVN_DBG(("alter(e%d): parent e%d, name '%s', kind %s",
            /*branch->sibling_defn->bid,*/ eid,
            new_parent_eid,
@@ -4730,7 +4681,7 @@ editor3_complete(void *baton,
   svn_error_t *err;
 
   /* Drive the tree we've created. */
-  if (eb->edited_branch)
+  if (eb->edited_rev_root)
     err = drive_changes_branch(eb, scratch_pool);
   else
     err = drive_changes(eb, scratch_pool);
@@ -4836,14 +4787,6 @@ svn_delta__ev3_from_delta_for_commit2(
          and those that recurse into sub-branches operate on more than one.
    */
   eb->edited_rev_root = branching_txn;
-  eb->edited_branch = svn_branch_revision_root_find_branch_element_by_rrpath(
-                       NULL, eb->edited_rev_root, base_relpath, scratch_pool);
-  SVN_DBG(("look up path '%s': found branch f%db%de%d at path '%s'",
-           base_relpath,
-           eb->edited_branch->sibling_defn->family->fid,
-           eb->edited_branch->sibling_defn->bid,
-           eb->edited_branch->sibling_defn->root_eid,
-           svn_branch_get_root_rrpath(eb->edited_branch)));
 
   if (shim_connector)
     {

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c?rev=1638822&r1=1638821&r2=1638822&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3.c Wed 
Nov 12 16:02:40 2014
@@ -276,6 +276,7 @@ svn_error_t *
 svn_editor3_add(svn_editor3_t *editor,
                 svn_editor3_eid_t *local_eid_p,
                 svn_node_kind_t new_kind,
+                svn_branch_instance_t *branch,
                 svn_editor3_eid_t new_parent_eid,
                 const char *new_name,
                 const svn_editor3_node_content_t *new_content)
@@ -289,8 +290,8 @@ svn_editor3_add(svn_editor3_t *editor,
   SVN_ERR_ASSERT(new_content->kind == new_kind);
 
   DO_CALLBACK(editor, cb_add,
-              5(&eid, new_kind,
-                new_parent_eid, new_name,
+              6(&eid, new_kind,
+                branch, new_parent_eid, new_name,
                 new_content));
 
   SVN_ERR_ASSERT(VALID_EID(eid));
@@ -305,6 +306,7 @@ svn_editor3_add(svn_editor3_t *editor,
 
 svn_error_t *
 svn_editor3_instantiate(svn_editor3_t *editor,
+                        svn_branch_instance_t *branch,
                         svn_editor3_eid_t local_eid,
                         svn_editor3_eid_t new_parent_eid,
                         const char *new_name,
@@ -316,7 +318,7 @@ svn_editor3_instantiate(svn_editor3_t *e
   SVN_ERR_ASSERT(VALID_CONTENT(new_content));
 
   DO_CALLBACK(editor, cb_instantiate,
-              4(local_eid,
+              5(branch, local_eid,
                 new_parent_eid, new_name,
                 new_content));
   return SVN_NO_ERROR;
@@ -324,8 +326,9 @@ svn_editor3_instantiate(svn_editor3_t *e
 
 svn_error_t *
 svn_editor3_copy_one(svn_editor3_t *editor,
+                     const svn_branch_el_rev_id_t *src_el_rev,
+                     svn_branch_instance_t *branch,
                      svn_editor3_eid_t local_eid,
-                     const struct svn_branch_el_rev_id_t *src_el_rev,
                      svn_editor3_eid_t new_parent_eid,
                      const char *new_name,
                      const svn_editor3_node_content_t *new_content)
@@ -337,8 +340,8 @@ svn_editor3_copy_one(svn_editor3_t *edit
   SVN_ERR_ASSERT(! new_content || VALID_CONTENT(new_content));
 
   DO_CALLBACK(editor, cb_copy_one,
-              5(local_eid,
-                src_el_rev,
+              6(src_el_rev,
+                branch, local_eid,
                 new_parent_eid, new_name,
                 new_content));
 
@@ -348,6 +351,7 @@ svn_editor3_copy_one(svn_editor3_t *edit
 svn_error_t *
 svn_editor3_copy_tree(svn_editor3_t *editor,
                       const svn_branch_el_rev_id_t *src_el_rev,
+                      svn_branch_instance_t *branch,
                       svn_editor3_eid_t new_parent_eid,
                       const char *new_name)
 {
@@ -356,8 +360,8 @@ svn_editor3_copy_tree(svn_editor3_t *edi
   SVN_ERR_ASSERT(VALID_NAME(new_name));
 
   DO_CALLBACK(editor, cb_copy_tree,
-              3(src_el_rev,
-                new_parent_eid, new_name));
+              4(src_el_rev,
+                branch, new_parent_eid, new_name));
 
   return SVN_NO_ERROR;
 }
@@ -365,12 +369,13 @@ svn_editor3_copy_tree(svn_editor3_t *edi
 svn_error_t *
 svn_editor3_delete(svn_editor3_t *editor,
                    svn_revnum_t since_rev,
+                   svn_branch_instance_t *branch,
                    svn_editor3_eid_t eid)
 {
   SVN_ERR_ASSERT(VALID_EID(eid));
 
   DO_CALLBACK(editor, cb_delete,
-              2(since_rev, eid));
+              3(since_rev, branch, eid));
 
   return SVN_NO_ERROR;
 }
@@ -378,6 +383,7 @@ svn_editor3_delete(svn_editor3_t *editor
 svn_error_t *
 svn_editor3_alter(svn_editor3_t *editor,
                   svn_revnum_t since_rev,
+                  svn_branch_instance_t *branch,
                   svn_editor3_eid_t eid,
                   svn_editor3_eid_t new_parent_eid,
                   const char *new_name,
@@ -389,7 +395,7 @@ svn_editor3_alter(svn_editor3_t *editor,
   SVN_ERR_ASSERT(! new_content || VALID_CONTENT(new_content));
 
   DO_CALLBACK(editor, cb_alter,
-              5(since_rev, eid,
+              6(since_rev, branch, eid,
                 new_parent_eid, new_name,
                 new_content));
 
@@ -776,6 +782,7 @@ static svn_error_t *
 wrap_add(void *baton,
          svn_editor3_eid_t *local_eid,
          svn_node_kind_t new_kind,
+         svn_branch_instance_t *branch,
          svn_editor3_eid_t new_parent_eid,
          const char *new_name,
          const svn_editor3_node_content_t *new_content,
@@ -788,17 +795,18 @@ wrap_add(void *baton,
       eid_str(new_parent_eid, scratch_pool), new_name);
   SVN_ERR(svn_editor3_add(eb->wrapped_editor,
                           local_eid, new_kind,
-                          new_parent_eid, new_name, new_content));
+                          branch, new_parent_eid, new_name, new_content));
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
 wrap_instantiate(void *baton,
-         svn_editor3_eid_t local_eid,
-         svn_editor3_eid_t new_parent_eid,
-         const char *new_name,
-         const svn_editor3_node_content_t *new_content,
-         apr_pool_t *scratch_pool)
+                 svn_branch_instance_t *branch,
+                 svn_editor3_eid_t local_eid,
+                 svn_editor3_eid_t new_parent_eid,
+                 const char *new_name,
+                 const svn_editor3_node_content_t *new_content,
+                 apr_pool_t *scratch_pool)
 {
   wrapper_baton_t *eb = baton;
 
@@ -806,15 +814,16 @@ wrap_instantiate(void *baton,
       eid_str(local_eid, scratch_pool),
       eid_str(new_parent_eid, scratch_pool), new_name);
   SVN_ERR(svn_editor3_instantiate(eb->wrapped_editor,
-                                  local_eid,
+                                  branch, local_eid,
                                   new_parent_eid, new_name, new_content));
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
 wrap_copy_one(void *baton,
+              const svn_branch_el_rev_id_t *src_el_rev,
+              svn_branch_instance_t *branch,
               svn_editor3_eid_t local_eid,
-              const struct svn_branch_el_rev_id_t *src_el_rev,
               svn_editor3_eid_t new_parent_eid,
               const char *new_name,
               const svn_editor3_node_content_t *new_content,
@@ -826,7 +835,8 @@ wrap_copy_one(void *baton,
       eid_str(local_eid, scratch_pool), el_rev_str(src_el_rev, scratch_pool),
       eid_str(new_parent_eid, scratch_pool), new_name);
   SVN_ERR(svn_editor3_copy_one(eb->wrapped_editor,
-                               local_eid, src_el_rev,
+                               src_el_rev,
+                               branch, local_eid,
                                new_parent_eid, new_name, new_content));
   return SVN_NO_ERROR;
 }
@@ -834,6 +844,7 @@ wrap_copy_one(void *baton,
 static svn_error_t *
 wrap_copy_tree(void *baton,
                const svn_branch_el_rev_id_t *src_el_rev,
+               svn_branch_instance_t *branch,
                svn_editor3_eid_t new_parent_eid,
                const char *new_name,
                apr_pool_t *scratch_pool)
@@ -845,13 +856,14 @@ wrap_copy_tree(void *baton,
       eid_str(new_parent_eid, scratch_pool), new_name);
   SVN_ERR(svn_editor3_copy_tree(eb->wrapped_editor,
                                 src_el_rev,
-                                new_parent_eid, new_name));
+                                branch, new_parent_eid, new_name));
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
 wrap_delete(void *baton,
             svn_revnum_t since_rev,
+            svn_branch_instance_t *branch,
             svn_editor3_eid_t eid,
             apr_pool_t *scratch_pool)
 {
@@ -860,13 +872,14 @@ wrap_delete(void *baton,
   dbg(eb, scratch_pool, "%s : delete()",
       eid_str(eid, scratch_pool));
   SVN_ERR(svn_editor3_delete(eb->wrapped_editor,
-                             since_rev, eid));
+                             since_rev, branch, eid));
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
 wrap_alter(void *baton,
            svn_revnum_t since_rev,
+           svn_branch_instance_t *branch,
            svn_editor3_eid_t eid,
            svn_editor3_eid_t new_parent_eid,
            const char *new_name,
@@ -879,7 +892,7 @@ wrap_alter(void *baton,
       eid_str(eid, scratch_pool), eid_str(eid, scratch_pool),
       eid_str(new_parent_eid, scratch_pool), new_name);
   SVN_ERR(svn_editor3_alter(eb->wrapped_editor,
-                            since_rev, eid,
+                            since_rev, branch, eid,
                             new_parent_eid, new_name, new_content));
   return SVN_NO_ERROR;
 }

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=1638822&r1=1638821&r2=1638822&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed Nov 
12 16:02:40 2014
@@ -611,14 +611,14 @@ branch_merge_subtree_r(svn_editor3_t *ed
           SVN_DBG(("merged: e%d => parent=e%d, name=%s, content=...",
                    eid, result->parent_eid, result->name));
 
-          SVN_ERR(svn_editor3_alter(editor, tgt->rev, eid,
+          SVN_ERR(svn_editor3_alter(editor, tgt->rev, tgt->branch, eid,
                                     result->parent_eid, result->name,
                                     result->content));
         }
       else if (e_tgt)
         {
           SVN_DBG(("merged: e%d => <deleted>", eid));
-          SVN_ERR(svn_editor3_delete(editor, tgt->rev, eid));
+          SVN_ERR(svn_editor3_delete(editor, tgt->rev, tgt->branch, eid));
         }
       else if (result)
         {
@@ -631,7 +631,7 @@ branch_merge_subtree_r(svn_editor3_t *ed
            * (which is not specified here, but will need to be),
            * which may be in this branch or in another branch.
            */
-          SVN_ERR(svn_editor3_instantiate(editor, eid,
+          SVN_ERR(svn_editor3_instantiate(editor, tgt->branch, eid,
                                           result->parent_eid, result->name,
                                           result->content));
         }
@@ -1027,17 +1027,21 @@ execute(const apr_array_header_t *action
           break;
         case ACTION_LIST_BRANCHES:
           {
-            svn_branch_family_t *family = svn_branch_get_family(editor);
+            SVN_ERR(find_el_rev_by_rrpath_rev(
+                      &el_rev[0], editor, SVN_INVALID_REVNUM, base_relpath,
+                      pool, pool));
 
-            SVN_ERR(family_list_branch_instances(family,
+            
SVN_ERR(family_list_branch_instances(el_rev[0]->branch->sibling_defn->family,
                                                  FALSE, iterpool));
           }
           break;
         case ACTION_LIST_BRANCHES_R:
           {
-            svn_branch_family_t *family = svn_branch_get_family(editor);
+            SVN_ERR(find_el_rev_by_rrpath_rev(
+                      &el_rev[0], editor, SVN_INVALID_REVNUM, base_relpath,
+                      pool, pool));
 
-            SVN_ERR(family_list_branch_instances(family,
+            
SVN_ERR(family_list_branch_instances(el_rev[0]->branch->sibling_defn->family,
                                                  TRUE, iterpool));
           }
           break;
@@ -1055,7 +1059,7 @@ execute(const apr_array_header_t *action
           VERIFY_REV_UNSPECIFIED("branchify", 0);
           VERIFY_EID_EXISTS("branchify", 0);
           SVN_ERR(svn_branch_branchify(editor,
-                                       el_rev[0]->eid,
+                                       el_rev[0]->branch, el_rev[0]->eid,
                                        iterpool));
           made_changes = TRUE;
           break;
@@ -1096,7 +1100,7 @@ execute(const apr_array_header_t *action
             svn_editor3_node_content_t *content = NULL; /* "no change" */
 
             SVN_ERR(svn_editor3_alter(editor, el_rev[0]->rev,
-                                      el_rev[0]->eid,
+                                      el_rev[0]->branch, el_rev[0]->eid,
                                       parent_el_rev[1]->eid, path_name[1], 
content));
           }
           made_changes = TRUE;
@@ -1109,6 +1113,7 @@ execute(const apr_array_header_t *action
           VERIFY_EID_NONEXISTENT("cp", 1);
           SVN_ERR(svn_editor3_copy_tree(editor,
                                         el_rev[0],
+                                        parent_el_rev[1]->branch,
                                         parent_el_rev[1]->eid, path_name[1]));
           made_changes = TRUE;
           break;
@@ -1116,7 +1121,7 @@ execute(const apr_array_header_t *action
           VERIFY_REV_UNSPECIFIED("rm", 0);
           VERIFY_EID_EXISTS("rm", 0);
           SVN_ERR(svn_editor3_delete(editor, el_rev[0]->rev,
-                                     el_rev[0]->eid));
+                                     el_rev[0]->branch, el_rev[0]->eid));
           made_changes = TRUE;
           break;
         case ACTION_MKDIR:
@@ -1129,7 +1134,9 @@ execute(const apr_array_header_t *action
             int new_eid;
 
             SVN_ERR(svn_editor3_add(editor, &new_eid, svn_node_dir,
-                                    parent_el_rev[0]->eid, path_name[0], 
content));
+                                    parent_el_rev[0]->branch,
+                                    parent_el_rev[0]->eid, path_name[0],
+                                    content));
           }
           made_changes = TRUE;
           break;
@@ -1166,7 +1173,7 @@ execute(const apr_array_header_t *action
             if (el_rev[1]->eid >= 0)
               {
                 SVN_ERR(svn_editor3_alter(editor, SVN_INVALID_REVNUM,
-                                          el_rev[1]->eid,
+                                          el_rev[1]->branch, el_rev[1]->eid,
                                           parent_el_rev[1]->eid, path_name[1],
                                           content));
               }
@@ -1175,6 +1182,7 @@ execute(const apr_array_header_t *action
                 int new_eid;
 
                 SVN_ERR(svn_editor3_add(editor, &new_eid, svn_node_file,
+                                        parent_el_rev[1]->branch,
                                         parent_el_rev[1]->eid, path_name[1],
                                         content));
               }


Reply via email to