subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1686294 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_branch.h libsvn_delta/branch.c svnmover/svnmover.c
Date Thu, 18 Jun 2015 19:20:09 GMT
Author: julianfoad
Date: Thu Jun 18 19:20:09 2015
New Revision: 1686294

URL: http://svn.apache.org/r1686294
Log:
On the 'move-tracking-2' branch: Remove the 'branch-into' function from the
public API as it is a derived, not fundamental, branching operation.

* subversion/include/private/svn_branch.h,
  subversion/libsvn_delta/branch.c
  (svn_branch_branch_into): Move from here...

* subversion/svnmover/svnmover.c
  (do_branch_into): ... to here. Rename. Improve and correct the doc string.
  (execute): Track the rename.

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=1686294&r1=1686293&r2=1686294&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 Jun 18
19:20:09 2015
@@ -755,20 +755,6 @@ svn_branch_branch(svn_branch_state_t **n
                   const char *new_name,
                   apr_pool_t *scratch_pool);
 
-/* Branch the subtree of FROM_BRANCH found at FROM_EID, to appear
- * in the existing branch TO_BRANCH at TO_PARENT_EID:NEW_NAME.
- *
- * No element of FROM_BRANCH:FROM_EID may already exist in TO_BRANCH.
- * (### Or, perhaps, elements that already exist should be altered?)
- */
-svn_error_t *
-svn_branch_branch_into(svn_branch_state_t *from_branch,
-                       int from_eid,
-                       svn_branch_state_t *to_branch,
-                       svn_branch_eid_t to_parent_eid,
-                       const char *new_name,
-                       apr_pool_t *scratch_pool);
-
 /* Get the full id of branch BRANCH.
  *
  * Note: a branch id is, in behavioural terms, an arbitrary token. In the

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=1686294&r1=1686293&r2=1686294&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Thu Jun 18 19:20:09
2015
@@ -1417,35 +1417,6 @@ svn_branch_branch(svn_branch_state_t **n
 }
 
 svn_error_t *
-svn_branch_branch_into(svn_branch_state_t *from_branch,
-                       int from_eid,
-                       svn_branch_state_t *to_branch,
-                       svn_branch_eid_t to_parent_eid,
-                       const char *new_name,
-                       apr_pool_t *scratch_pool)
-{
-  svn_branch_subtree_t *from_subtree;
-
-  /* Source element must exist */
-  if (! svn_branch_get_path_by_eid(from_branch, from_eid, scratch_pool))
-    {
-      return svn_error_createf(SVN_ERR_BRANCHING, NULL,
-                               _("Cannot branch from %s e%d: "
-                                 "does not exist"),
-                               svn_branch_get_id(
-                                 from_branch, scratch_pool), from_eid);
-    }
-
-  from_subtree = svn_branch_get_subtree(from_branch, from_eid, scratch_pool);
-
-  /* Populate the new branch mapping */
-  SVN_ERR(svn_branch_instantiate_subtree(to_branch, to_parent_eid, new_name,
-                                         *from_subtree, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_branch_copy_subtree(const svn_branch_el_rev_id_t *from_el_rev,
                         svn_branch_state_t *to_branch,
                         svn_branch_eid_t to_parent_eid,

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=1686294&r1=1686293&r2=1686294&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Thu Jun 18 19:20:09
2015
@@ -2016,6 +2016,46 @@ mk_branch(svn_branch_state_t **new_branc
   return SVN_NO_ERROR;
 }
 
+/* Branch the subtree of FROM_BRANCH found at FROM_EID, to appear
+ * in the existing branch TO_BRANCH at TO_PARENT_EID:NEW_NAME.
+ *
+ * This is like merging the creation of the source subtree into TO_BRANCH.
+ *
+ * Any elements of the source subtree that already exist in TO_BRANCH
+ * are altered. This is like resolving any merge conflicts as 'theirs'.
+ *
+ * (### Sometimes the user might prefer that we throw an error if any
+ * element of the source subtree already exists in TO_BRANCH.)
+ */
+static svn_error_t *
+do_branch_into(svn_branch_state_t *from_branch,
+               int from_eid,
+               svn_branch_state_t *to_branch,
+               svn_branch_eid_t to_parent_eid,
+               const char *new_name,
+               apr_pool_t *scratch_pool)
+{
+  svn_branch_subtree_t *from_subtree;
+
+  /* Source element must exist */
+  if (! svn_branch_get_path_by_eid(from_branch, from_eid, scratch_pool))
+    {
+      return svn_error_createf(SVN_ERR_BRANCHING, NULL,
+                               _("Cannot branch from %s e%d: "
+                                 "does not exist"),
+                               svn_branch_get_id(
+                                 from_branch, scratch_pool), from_eid);
+    }
+
+  from_subtree = svn_branch_get_subtree(from_branch, from_eid, scratch_pool);
+
+  /* Populate the new branch mapping */
+  SVN_ERR(svn_branch_instantiate_subtree(to_branch, to_parent_eid, new_name,
+                                         *from_subtree, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* This commit callback prints not only a commit summary line but also
  * a log-style summary of the changes.
  */
@@ -2478,10 +2518,10 @@ execute(svnmover_wc_t *wc,
           VERIFY_EID_NONEXISTENT("branch-into", 1);
           VERIFY_PARENT_EID_EXISTS("branch-into", 1);
           {
-            SVN_ERR(svn_branch_branch_into(arg[0]->el_rev->branch, arg[0]->el_rev->eid,
-                                           arg[1]->el_rev->branch,
-                                           arg[1]->parent_el_rev->eid, arg[1]->path_name,
-                                           iterpool));
+            SVN_ERR(do_branch_into(arg[0]->el_rev->branch, arg[0]->el_rev->eid,
+                                   arg[1]->el_rev->branch,
+                                   arg[1]->parent_el_rev->eid, arg[1]->path_name,
+                                   iterpool));
             notify("A+   %s (subtree)", action->relpath[1]);
           }
           break;



Mime
View raw message