Index: subversion/include/private/svn_repos_private.h =================================================================== --- subversion/include/private/svn_repos_private.h (revision 0) +++ subversion/include/private/svn_repos_private.h (revision 0) @@ -0,0 +1,57 @@ +/** + * @copyright + * ==================================================================== + * Copyright (c) 2007 CollabNet. All rights reserved. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://subversion.tigris.org/license-1.html. + * If newer versions of this license are posted there, you may use a + * newer version instead, at your option. + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://subversion.tigris.org/. + * ==================================================================== + * @endcopyright + * + * @file svn_repos_private.h + * @brief Subversion-internal repository APIs. + */ + +#ifndef SVN_REPOS_PRIVATE_H +#define SVN_REPOS_PRIVATE_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * Behaves as per the docs for svn_repos_begin_report2(), with the + * additional parameter DEFAULT_DEPTH for compatibility with the + * original svn_repos_begin_report() API. + * + * @since New in 1.5. + */ +/* */ +svn_error_t * +svn_repos__begin_report(void **report_baton, + svn_revnum_t revnum, + svn_repos_t *repos, + const char *fs_base, + const char *s_operand, + const char *switch_path, + svn_boolean_t text_deltas, + svn_depth_t default_depth, + svn_boolean_t ignore_ancestry, + const svn_delta_editor_t *editor, + void *edit_baton, + svn_repos_authz_func_t authz_read_func, + void *authz_read_baton, + apr_pool_t *pool); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* SVN_REPOS_PRIVATE_H */ Index: subversion/libsvn_ra_local/ra_plugin.c =================================================================== --- subversion/libsvn_ra_local/ra_plugin.c (revision 24444) +++ subversion/libsvn_ra_local/ra_plugin.c (working copy) @@ -26,7 +26,9 @@ #include "svn_props.h" #include "svn_mergeinfo.h" #include "svn_path.h" + #include "svn_private_config.h" +#include "private/svn_repos_private.h" #include "../libsvn_ra/ra_loader.h" #define APR_WANT_STRFUNC @@ -614,13 +616,14 @@ pool)); /* Build a reporter baton. */ - SVN_ERR(svn_repos_begin_report2(&rbaton, + SVN_ERR(svn_repos__begin_report(&rbaton, revision, sbaton->repos, sbaton->fs_path->data, target, other_fs_path, text_deltas, + depth, ignore_ancestry, editor, edit_baton, Index: subversion/mod_dav_svn/reports/update.c =================================================================== --- subversion/mod_dav_svn/reports/update.c (revision 24444) +++ subversion/mod_dav_svn/reports/update.c (working copy) @@ -35,6 +35,8 @@ #include "svn_dav.h" #include "svn_props.h" +#include "private/svn_repos_private.h" + #include "../dav_svn.h" @@ -1167,11 +1169,12 @@ editor->close_file = upd_close_file; editor->absent_file = upd_absent_file; editor->close_edit = upd_close_edit; - if ((serr = svn_repos_begin_report2(&rbaton, revnum, + if ((serr = svn_repos__begin_report(&rbaton, revnum, repos->repos, src_path, target, dst_path, text_deltas, + depth, ignore_ancestry, editor, &uc, dav_svn__authz_read_func(&arb), Index: subversion/libsvn_repos/reporter.c =================================================================== --- subversion/libsvn_repos/reporter.c (revision 24444) +++ subversion/libsvn_repos/reporter.c (working copy) @@ -17,11 +17,15 @@ */ #include "svn_path.h" +#include "svn_types.h" +#include "svn_error.h" +#include "svn_error_codes.h" #include "svn_fs.h" #include "svn_repos.h" #include "svn_pools.h" #include "svn_md5.h" #include "svn_props.h" +#include "private/svn_repos_private.h" #include "repos.h" #include "svn_private_config.h" @@ -1040,7 +1044,8 @@ /* --- COLLECTING THE REPORT INFORMATION --- */ -/* Record a report operation into the temporary file. */ +/* Record a report operation into the temporary file. Return an error + if DEPTH is svn_depth_unknown. */ static svn_error_t * write_path_info(report_baton_t *b, const char *path, const char *lpath, svn_revnum_t rev, svn_depth_t depth, @@ -1049,6 +1054,11 @@ { const char *lrep, *rrep, *drep, *ltrep, *rep; + if (depth == svn_depth_unknown) + return svn_error_createf(SVN_ERR_REPOS_BAD_ARGS, NULL, + _("Unsupported report depth '%s'"), + svn_depth_to_word(depth)); + /* Munge the path to be anchor-relative, so that we can use edit paths as report paths. */ path = svn_path_join(b->s_operand, path, pool); @@ -1058,9 +1068,6 @@ rrep = (SVN_IS_VALID_REVNUM(rev)) ? apr_psprintf(pool, "+%ld:", rev) : "-"; - if (depth == svn_depth_unknown) - depth = b->default_depth; - if (depth == svn_depth_empty) drep = "+0:"; else if (depth == svn_depth_files) @@ -1092,7 +1099,8 @@ svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool) { - return svn_repos_set_path3(baton, path, rev, svn_depth_infinity, + return svn_repos_set_path3(baton, path, rev, + ((report_baton_t *) baton)->default_depth, start_empty, lock_token, pool); } @@ -1118,9 +1126,9 @@ svn_revnum_t rev, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool) { - return svn_repos_link_path3(baton, path, link_path, - rev, svn_depth_infinity, start_empty, - lock_token, pool); + return svn_repos_link_path3(baton, path, link_path, rev, + ((report_baton_t *) baton)->default_depth, + start_empty, lock_token, pool); } svn_error_t * @@ -1165,24 +1173,21 @@ /* --- BEGINNING THE REPORT --- */ -/* Behaves as per the docs for svn_repos_begin_report2(), with the - additional parameter DEFAULT_DEPTH for compatibility with the - original svn_repos_begin_report() API. */ -static svn_error_t * -begin_report(void **report_baton, - svn_revnum_t revnum, - svn_repos_t *repos, - const char *fs_base, - const char *s_operand, - const char *switch_path, - svn_boolean_t text_deltas, - svn_depth_t default_depth, - svn_boolean_t ignore_ancestry, - const svn_delta_editor_t *editor, - void *edit_baton, - svn_repos_authz_func_t authz_read_func, - void *authz_read_baton, - apr_pool_t *pool) +svn_error_t * +svn_repos__begin_report(void **report_baton, + svn_revnum_t revnum, + svn_repos_t *repos, + const char *fs_base, + const char *s_operand, + const char *switch_path, + svn_boolean_t text_deltas, + svn_depth_t default_depth, + svn_boolean_t ignore_ancestry, + const svn_delta_editor_t *editor, + void *edit_baton, + svn_repos_authz_func_t authz_read_func, + void *authz_read_baton, + apr_pool_t *pool) { report_baton_t *b; const char *tempdir; @@ -1230,20 +1235,20 @@ void *authz_read_baton, apr_pool_t *pool) { - return begin_report(report_baton, - revnum, - repos, - fs_base, - s_operand, - switch_path, - text_deltas, - svn_depth_infinity, - ignore_ancestry, - editor, - edit_baton, - authz_read_func, - authz_read_baton, - pool); + return svn_repos__begin_report(report_baton, + revnum, + repos, + fs_base, + s_operand, + switch_path, + text_deltas, + svn_depth_unknown, + ignore_ancestry, + editor, + edit_baton, + authz_read_func, + authz_read_baton, + pool); } @@ -1264,18 +1269,18 @@ void *authz_read_baton, apr_pool_t *pool) { - return begin_report(report_baton, - revnum, - repos, - fs_base, - s_operand, - switch_path, - text_deltas, - SVN_DEPTH_FROM_RECURSE(recurse), - ignore_ancestry, - editor, - edit_baton, - authz_read_func, - authz_read_baton, - pool); + return svn_repos__begin_report(report_baton, + revnum, + repos, + fs_base, + s_operand, + switch_path, + text_deltas, + SVN_DEPTH_FROM_RECURSE(recurse), + ignore_ancestry, + editor, + edit_baton, + authz_read_func, + authz_read_baton, + pool); } Index: subversion/svnserve/serve.c =================================================================== --- subversion/svnserve/serve.c (revision 24444) +++ subversion/svnserve/serve.c (working copy) @@ -41,6 +41,8 @@ #include "svn_mergeinfo.h" #include "svn_user.h" +#include "private/svn_repos_private.h" + #include "server.h" /* Set DEPTH based on boolean RECURSE, but only if DEPTH was unset. @@ -627,9 +629,9 @@ /* Make an svn_repos report baton. Tell it to drive the network editor * when the report is complete. */ svn_ra_svn_get_editor(&editor, &edit_baton, conn, pool, NULL, NULL); - SVN_CMD_ERR(svn_repos_begin_report2(&report_baton, rev, b->repos, + SVN_CMD_ERR(svn_repos__begin_report(&report_baton, rev, b->repos, b->fs_path->data, target, tgt_path, - text_deltas, ignore_ancestry, + text_deltas, depth, ignore_ancestry, editor, edit_baton, authz_check_access_cb_func(b), b, pool));