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/05/06 16:37:32 UTC
svn commit: r1678010 - in /subversion/branches/move-tracking-2/subversion:
include/private/svn_editor3e.h libsvn_delta/compat3e.c svnmover/svnmover.c
Author: julianfoad
Date: Wed May 6 14:37:32 2015
New Revision: 1678010
URL: http://svn.apache.org/r1678010
Log:
On the 'move-tracking-2' branch: Fetch some information more directly.
* subversion/include/private/svn_editor3e.h,
subversion/libsvn_delta/compat3e.c
(svn_editor3_get_all_branches_in_rev): New.
* subversion/svnmover/svnmover.c
(list_branches,
list_all_branches): Request the branches directly from the editor rather
than via a given revision root object.
(execute): Adjust the calls to list branches.
Modified:
subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h?rev=1678010&r1=1678009&r2=1678010&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h Wed May 6 14:37:32 2015
@@ -1014,6 +1014,17 @@ svn_editor3__get_baton(const svn_editor3
/* ====================================================================== */
+/* Set *BRANCHES_P to an array of (svn_branch_state_t *) pointers to all
+ * branches in revision REVNUM, or in the editing transaction if REVNUM is
+ * SVN_INVALID_REVNUM.
+ */
+svn_error_t *
+svn_editor3_get_all_branches_in_rev(const apr_array_header_t **branches_p,
+ svn_editor3_t *editor,
+ svn_revnum_t revnum,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Find the (deepest) branch in the state being edited by EDITOR, of which
* the path RRPATH is either the root path or a normal, non-sub-branch
* path. An element need not exist at RRPATH.
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=1678010&r1=1678009&r2=1678010&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Wed May 6 14:37:32 2015
@@ -860,6 +860,31 @@ svn_editor3_el_rev_get(svn_branch_el_rev
}
svn_error_t *
+svn_editor3_get_all_branches_in_rev(const apr_array_header_t **branches_p,
+ svn_editor3_t *editor,
+ svn_revnum_t revnum,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ ev3_from_delta_baton_t *eb = svn_editor3__get_baton(editor);
+ svn_branch_revision_root_t *rev_root;
+
+ if (SVN_IS_VALID_REVNUM(revnum))
+ {
+ const svn_branch_repos_t *repos = eb->edited_rev_root->repos;
+
+ rev_root = svn_array_get(repos->rev_roots, (int)(revnum));
+ }
+ else
+ {
+ rev_root = eb->edited_rev_root;
+ }
+
+ *branches_p = rev_root->branches;
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_editor3_find_el_rev_by_path_rev(svn_branch_el_rev_id_t **el_rev_p,
svn_editor3_t *editor,
const char *rrpath,
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=1678010&r1=1678009&r2=1678010&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed May 6 14:37:32 2015
@@ -613,15 +613,19 @@ branch_info_by_eids(svn_branch_state_t *
/* List all branches rooted at EID.
*/
static svn_error_t *
-list_branches(svn_branch_revision_root_t *rev_root,
+list_branches(svn_editor3_t *editor,
+ svn_revnum_t revnum,
int eid,
svn_boolean_t verbose,
apr_pool_t *scratch_pool)
{
+ const apr_array_header_t *branches;
SVN_ITER_T(svn_branch_state_t) *bi;
- for (SVN_ARRAY_ITER(bi, svn_branch_revision_root_get_branches(
- rev_root, scratch_pool), scratch_pool))
+ SVN_ERR(svn_editor3_get_all_branches_in_rev(&branches, editor, revnum,
+ scratch_pool, scratch_pool));
+
+ for (SVN_ARRAY_ITER(bi, branches, scratch_pool))
{
svn_branch_state_t *branch = bi->val;
@@ -647,16 +651,20 @@ list_branches(svn_branch_revision_root_t
/* List all branches.
*/
static svn_error_t *
-list_all_branches(svn_branch_revision_root_t *rev_root,
+list_all_branches(svn_editor3_t *editor,
+ svn_revnum_t revnum,
svn_boolean_t verbose,
apr_pool_t *scratch_pool)
{
+ const apr_array_header_t *branches;
SVN_ITER_T(svn_branch_state_t) *bi;
+ SVN_ERR(svn_editor3_get_all_branches_in_rev(&branches, editor, revnum,
+ scratch_pool, scratch_pool));
+
printf("branches:\n");
- for (SVN_ARRAY_ITER(bi, svn_branch_revision_root_get_branches(
- rev_root, scratch_pool), scratch_pool))
+ for (SVN_ARRAY_ITER(bi, branches, scratch_pool))
{
svn_branch_state_t *branch = bi->val;
@@ -1866,19 +1874,15 @@ execute(const apr_array_header_t *action
printf("branches rooted at e%d:\n", el_rev[0]->eid);
}
SVN_ERR(list_branches(
- el_rev[0]->branch->rev_root,
+ editor, base_revision,
el_rev[0]->eid,
FALSE, iterpool));
}
break;
case ACTION_LIST_BRANCHES_R:
{
- SVN_ERR(find_el_rev_by_rrpath_rev(
- &el_rev[0], editor, base_revision, base_relpath,
- pool, pool));
-
- SVN_ERR(list_all_branches(el_rev[0]->branch->rev_root, TRUE,
- iterpool));
+ /* (Note: BASE_REVISION is always a real revision number, here) */
+ SVN_ERR(list_all_branches(editor, base_revision, TRUE, iterpool));
}
break;
case ACTION_LS: