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/18 11:29:13 UTC
svn commit: r1696377 - in /subversion/branches/move-tracking-2/subversion:
include/private/svn_branch.h libsvn_delta/branch.c libsvn_delta/compat3e.c
Author: julianfoad
Date: Tue Aug 18 09:29:13 2015
New Revision: 1696377
URL: http://svn.apache.org/r1696377
Log:
On the 'move-tracking-2' branch: Remove 'svn_branch_copy_subtree' from the
public API, because 'svn_branch_add_subtree' is a better, more general form
of the same operation.
* subversion/include/private/svn_branch.h
(svn_branch_copy_subtree): Move and rename...
* subversion/libsvn_delta/compat3e.c
(copy_subtree): ... to here.
(editor3_copy_tree): 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/libsvn_delta/compat3e.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=1696377&r1=1696376&r2=1696377&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 Tue Aug 18 09:29:13 2015
@@ -629,29 +629,6 @@ svn_branch_map_add_subtree(svn_branch_st
svn_branch_subtree_t new_subtree,
apr_pool_t *scratch_pool);
-/* Copy a subtree.
- *
- * Adjust TO_BRANCH and its subbranches (recursively), to reflect a copy
- * of a subtree from FROM_EL_REV to TO_PARENT_EID:TO_NAME.
- *
- * FROM_EL_REV must be an existing element. (It may be a branch root.)
- *
- * ### TODO:
- * If FROM_EL_REV is the root of a subbranch and/or contains nested
- * subbranches, also copy them ...
- * ### What shall we do with a subbranch? Make plain copies of its raw
- * elements; make a subbranch by branching the source subbranch?
- *
- * TO_PARENT_EID must be a directory element in TO_BRANCH, and TO_NAME a
- * non-existing path in it.
- */
-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,
- const char *to_name,
- apr_pool_t *scratch_pool);
-
/* Return the root repos-relpath of BRANCH.
*
* ### TODO: Clarify sequencing requirements.
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=1696377&r1=1696376&r2=1696377&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Tue Aug 18 09:29:13 2015
@@ -1348,27 +1348,3 @@ svn_branch_branch_subtree(svn_branch_sta
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,
- const char *to_name,
- apr_pool_t *scratch_pool)
-{
- SVN_DBG(("cp subtree from e%d to e%d/%s",
- from_el_rev->eid, to_parent_eid, to_name));
-
- /* copy the subtree, assigning new EIDs */
- SVN_ERR(svn_branch_map_add_subtree(to_branch, -1 /*to_eid*/,
- to_parent_eid, to_name,
- *svn_branch_get_subtree(
- from_el_rev->branch, from_el_rev->eid,
- scratch_pool),
- scratch_pool));
-
- /* handle any subbranches under FROM_BRANCH:FROM_EID */
- /* ### Later. */
-
- return SVN_NO_ERROR;
-}
-
Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1696377&r1=1696376&r2=1696377&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Tue Aug 18 09:29:13 2015
@@ -1200,6 +1200,46 @@ editor3_copy_one(void *baton,
return SVN_NO_ERROR;
}
+/* Copy a subtree.
+ *
+ * Adjust TO_BRANCH and its subbranches (recursively), to reflect a copy
+ * of a subtree from FROM_EL_REV to TO_PARENT_EID:TO_NAME.
+ *
+ * FROM_EL_REV must be an existing element. (It may be a branch root.)
+ *
+ * ### TODO:
+ * If FROM_EL_REV is the root of a subbranch and/or contains nested
+ * subbranches, also copy them ...
+ * ### What shall we do with a subbranch? Make plain copies of its raw
+ * elements; make a subbranch by branching the source subbranch?
+ *
+ * TO_PARENT_EID must be a directory element in TO_BRANCH, and TO_NAME a
+ * non-existing path in it.
+ */
+static svn_error_t *
+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,
+ const char *to_name,
+ apr_pool_t *scratch_pool)
+{
+ SVN_DBG(("cp subtree from e%d to e%d/%s",
+ from_el_rev->eid, to_parent_eid, to_name));
+
+ /* copy the subtree, assigning new EIDs */
+ SVN_ERR(svn_branch_map_add_subtree(to_branch, -1 /*to_eid*/,
+ to_parent_eid, to_name,
+ *svn_branch_get_subtree(
+ from_el_rev->branch, from_el_rev->eid,
+ scratch_pool),
+ scratch_pool));
+
+ /* handle any subbranches under FROM_BRANCH:FROM_EID */
+ /* ### Later. */
+
+ return SVN_NO_ERROR;
+}
+
/* An #svn_editor3_t method. */
static svn_error_t *
editor3_copy_tree(void *baton,
@@ -1212,7 +1252,7 @@ editor3_copy_tree(void *baton,
SVN_DBG(("copy_tree(e%d -> e%d/%s)",
src_el_rev->eid, new_parent_eid, new_name));
- SVN_ERR(svn_branch_copy_subtree(src_el_rev,
+ SVN_ERR(copy_subtree(src_el_rev,
to_branch, new_parent_eid, new_name,
scratch_pool));