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 2014/12/23 13:20:57 UTC
svn commit: r1647563 - in /subversion/trunk/subversion: include/svn_repos.h
libsvn_repos/deprecated.c libsvn_repos/load-fs-vtable.c
Author: julianfoad
Date: Tue Dec 23 12:20:57 2014
New Revision: 1647563
URL: http://svn.apache.org/r1647563
Log:
Expose missing options in the repository dumpfile loader API.
Rev svn_repos_get_fs_build_parser4() to svn_repos_get_fs_build_parser5(),
adding the three flags that have been added to its implementation and used by
its 'convenience' wrappers svn_repos_load_fs4() and svn_repos_load_fs5() but
that were not exposed here. Now all the features that the wrapper provides
are also exposed by the slightly lower level API.
* subversion/include/svn_repos.h
(svn_repos_load_fs4): Correct the '@since' version.
(svn_repos_get_fs_build_parser5): New.
(svn_repos_get_fs_build_parser4): Deprecate.
* subversion/libsvn_repos/deprecated.c
(svn_repos_get_fs_build_parser4): Implement as a wrapper.
* subversion/libsvn_repos/load-fs-vtable.c
(svn_repos_get_fs_build_parser5): Rename from ...4() and add the new
parameters.
(svn_repos_load_fs5): Simplify by using svn_repos_get_fs_build_parser5().
Modified:
subversion/trunk/subversion/include/svn_repos.h
subversion/trunk/subversion/libsvn_repos/deprecated.c
subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
Modified: subversion/trunk/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1647563&r1=1647562&r2=1647563&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Tue Dec 23 12:20:57 2014
@@ -3093,7 +3093,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
/** Similar to svn_repos_load_fs5(), but with @a ignore_dates
* always passed as FALSE.
*
- * @since New in 1.9.
+ * @since New in 1.8.
* @deprecated Provided for backward compatibility with the 1.8 API.
*/
SVN_DEPRECATED
@@ -3344,16 +3344,53 @@ svn_repos_parse_dumpstream3(svn_stream_t
* 'copyfrom' history to exist in the repository when it encounters
* nodes that are added-with-history.
*
+ * If @a use_pre_commit_hook is set, call the repository's pre-commit
+ * hook before committing each loaded revision.
+ *
+ * If @a use_post_commit_hook is set, call the repository's
+ * post-commit hook after committing each loaded revision.
+ *
* If @a validate_props is set, then validate Subversion revision and
* node properties (those in the svn: namespace) against established
* rules for those things.
*
+ * If @a ignore_dates is set, ignore any revision datestamps found in
+ * @a dumpstream, allowing the revisions created by the load process
+ * to be stamped as if they were newly created via the normal commit
+ * process.
+ *
* If @a parent_dir is not NULL, then the parser will reparent all the
* loaded nodes, from root to @a parent_dir. The directory @a parent_dir
* must be an existing directory in the repository.
*
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
+ void **parse_baton,
+ svn_repos_t *repos,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ svn_boolean_t use_history,
+ svn_boolean_t validate_props,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t ignore_dates,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_repos_get_fs_build_parser5(), but with the
+ * @c use_pre_commit_hook, @c use_post_commit_hook and @c ignore_dates
+ * arguments all false.
+ *
* @since New in 1.8.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **parser,
void **parse_baton,
Modified: subversion/trunk/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/deprecated.c?rev=1647563&r1=1647562&r2=1647563&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_repos/deprecated.c Tue Dec 23 12:20:57 2014
@@ -997,6 +997,35 @@ svn_repos_load_fs(svn_repos_t *repos,
}
svn_error_t *
+svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **callbacks,
+ void **parse_baton,
+ svn_repos_t *repos,
+ svn_revnum_t start_rev,
+ svn_revnum_t end_rev,
+ svn_boolean_t use_history,
+ svn_boolean_t validate_props,
+ enum svn_repos_load_uuid uuid_action,
+ const char *parent_dir,
+ svn_repos_notify_func_t notify_func,
+ void *notify_baton,
+ apr_pool_t *pool)
+{
+ SVN_ERR(svn_repos_get_fs_build_parser5(callbacks, parse_baton,
+ repos,
+ start_rev, end_rev,
+ use_history,
+ validate_props,
+ uuid_action,
+ parent_dir,
+ FALSE, FALSE, /*hooks */
+ FALSE /*ignore_dates*/,
+ notify_func,
+ notify_baton,
+ pool));
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **callbacks,
void **parse_baton,
svn_repos_t *repos,
Modified: subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c?rev=1647563&r1=1647562&r2=1647563&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/trunk/subversion/libsvn_repos/load-fs-vtable.c Tue Dec 23 12:20:57 2014
@@ -1121,7 +1121,7 @@ close_revision(void *baton)
svn_error_t *
-svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **callbacks,
+svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
void **parse_baton,
svn_repos_t *repos,
svn_revnum_t start_rev,
@@ -1130,6 +1130,9 @@ svn_repos_get_fs_build_parser4(const svn
svn_boolean_t validate_props,
enum svn_repos_load_uuid uuid_action,
const char *parent_dir,
+ svn_boolean_t use_pre_commit_hook,
+ svn_boolean_t use_post_commit_hook,
+ svn_boolean_t ignore_dates,
svn_repos_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *pool)
@@ -1175,6 +1178,9 @@ svn_repos_get_fs_build_parser4(const svn
pb->last_rev_mapped = SVN_INVALID_REVNUM;
pb->start_rev = start_rev;
pb->end_rev = end_rev;
+ pb->use_pre_commit_hook = use_pre_commit_hook;
+ pb->use_post_commit_hook = use_post_commit_hook;
+ pb->ignore_dates = ignore_dates;
*callbacks = parser;
*parse_baton = pb;
@@ -1201,28 +1207,23 @@ svn_repos_load_fs5(svn_repos_t *repos,
{
const svn_repos_parse_fns3_t *parser;
void *parse_baton;
- struct parse_baton *pb;
/* This is really simple. */
- SVN_ERR(svn_repos_get_fs_build_parser4(&parser, &parse_baton,
+ SVN_ERR(svn_repos_get_fs_build_parser5(&parser, &parse_baton,
repos,
start_rev, end_rev,
TRUE, /* look for copyfrom revs */
validate_props,
uuid_action,
parent_dir,
+ use_pre_commit_hook,
+ use_post_commit_hook,
+ ignore_dates,
notify_func,
notify_baton,
pool));
- /* Heh. We know this is a parse_baton. This file made it. So
- cast away, and set our hook booleans. */
- pb = parse_baton;
- pb->use_pre_commit_hook = use_pre_commit_hook;
- pb->use_post_commit_hook = use_post_commit_hook;
- pb->ignore_dates = ignore_dates;
-
return svn_repos_parse_dumpstream3(dumpstream, parser, parse_baton, FALSE,
cancel_func, cancel_baton, pool);
}