You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/07/22 01:35:48 UTC
svn commit: r966463 - in /subversion/trunk/subversion: include/svn_client.h
libsvn_client/commit.c libsvn_client/deprecated.c svn/import-cmd.c
Author: hwright
Date: Wed Jul 21 23:35:48 2010
New Revision: 966463
URL: http://svn.apache.org/viewvc?rev=966463&view=rev
Log:
Another in a series:
Make the import client API return commit information through the cxt callback.
* subversion/svn/import-cmd.c
(svn_cl__import): Update client API call.
* subversion/include/svn_client.h
(svn_client_import4): New.
(svn_client_import3): Deprecated.
* subversion/libsvn_client/deprecated.c
(svn_client_import3): New wrapper.
* subversion/libsvn_client/commit.c
(svn_client_import3): Remove.
(svn_client_import4): New.
Modified:
subversion/trunk/subversion/include/svn_client.h
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/libsvn_client/deprecated.c
subversion/trunk/subversion/svn/import-cmd.c
Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=966463&r1=966462&r2=966463&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Wed Jul 21 23:35:48 2010
@@ -1659,8 +1659,7 @@ svn_client_delete(svn_client_commit_info
/** Import file or directory @a path into repository directory @a url at
* head, authenticating with the authentication baton cached in @a ctx,
* and using @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to get a log message
- * for the (implied) commit. Set @a *commit_info_p to the results of the
- * commit, allocated in @a pool. If some components of @a url do not exist
+ * for the (implied) commit. If some components of @a url do not exist
* then create parent directories as necessary.
*
* This function reads an unversioned tree from disk and skips any ".svn"
@@ -1712,8 +1711,30 @@ svn_client_delete(svn_client_commit_info
* If @a ignore_unknown_node_types is @c FALSE, ignore files of which the
* node type is unknown, such as device files and pipes.
*
+ * If @a ctx->commit_callback2 is non-NULL, then for each successful commit,
+ * call @a ctx->commit_callback2 with @a ctx->commit_baton and a
+ * #svn_commit_info_t for the commit.
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_client_import4(const char *path,
+ const char *url,
+ svn_depth_t depth,
+ svn_boolean_t no_ignore,
+ svn_boolean_t ignore_unknown_node_types,
+ const apr_hash_t *revprop_table,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_import4(), but returns the @a commit_info_p directly,
+ * rather than through @a ctx->commit_callback2.
+ *
* @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.6 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_client_import3(svn_commit_info_t **commit_info_p,
const char *path,
Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=966463&r1=966462&r2=966463&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Wed Jul 21 23:35:48 2010
@@ -444,7 +444,7 @@ import_dir(const svn_delta_editor_t *edi
* EDIT_BATON. PATH can be a file or directory.
*
* DEPTH is the depth at which to import PATH; it behaves as for
- * svn_client_import3().
+ * svn_client_import4().
*
* NEW_ENTRIES is an ordered array of path components that must be
* created in the repository (where the ordering direction is
@@ -645,8 +645,7 @@ get_ra_editor(svn_ra_session_t **ra_sess
/*** Public Interfaces. ***/
svn_error_t *
-svn_client_import3(svn_commit_info_t **commit_info_p,
- const char *path,
+svn_client_import4(const char *path,
const char *url,
svn_depth_t depth,
svn_boolean_t no_ignore,
@@ -659,7 +658,6 @@ svn_client_import3(svn_commit_info_t **c
const char *log_msg = "";
const svn_delta_editor_t *editor;
void *edit_baton;
- void *commit_baton;
svn_ra_session_t *ra_session;
apr_hash_t *excludes = apr_hash_make(pool);
svn_node_kind_t kind;
@@ -706,8 +704,6 @@ svn_client_import3(svn_commit_info_t **c
if (kind == svn_node_file)
base_dir_abspath = svn_dirent_dirname(local_abspath, pool);
- SVN_ERR(svn_client__commit_get_baton(&commit_baton, commit_info_p, pool));
-
/* Figure out all the path components we need to create just to have
a place to stick our imported tree. */
subpool = svn_pool_create(pool);
@@ -739,7 +735,7 @@ svn_client_import3(svn_commit_info_t **c
while ((err = get_ra_editor(&ra_session,
&editor, &edit_baton, ctx, url, base_dir_abspath,
log_msg, NULL, revprop_table, FALSE, NULL, TRUE,
- svn_client__commit_callback, commit_baton,
+ ctx->commit_callback2, ctx->commit_baton,
subpool)));
/* Reverse the order of the components we added to our NEW_ENTRIES array. */
@@ -795,10 +791,6 @@ svn_client_import3(svn_commit_info_t **c
return err;
}
- /* Transfer *COMMIT_INFO from the subpool to the callers pool */
- if (*commit_info_p)
- *commit_info_p = svn_commit_info_dup(*commit_info_p, pool);
-
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=966463&r1=966462&r2=966463&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Wed Jul 21 23:35:48 2010
@@ -384,6 +384,34 @@ svn_client_blame(const char *target,
/*** From commit.c ***/
svn_error_t *
+svn_client_import3(svn_commit_info_t **commit_info_p,
+ const char *path,
+ const char *url,
+ svn_depth_t depth,
+ svn_boolean_t no_ignore,
+ svn_boolean_t ignore_unknown_node_types,
+ const apr_hash_t *revprop_table,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ svn_client_ctx_t shadow_ctx;
+ struct capture_baton_t cb;
+
+ cb.info = commit_info_p;
+ cb.pool = pool;
+ cb.original_callback = ctx->commit_callback2;
+ cb.original_baton = ctx->commit_baton;
+
+ shadow_ctx = *ctx;
+ shadow_ctx.commit_callback2 = capture_commit_info;
+ shadow_ctx.commit_baton = &cb;
+
+ return svn_client_import4(path, url, depth, no_ignore,
+ ignore_unknown_node_types, revprop_table,
+ &shadow_ctx, pool);
+}
+
+svn_error_t *
svn_client_import2(svn_commit_info_t **commit_info_p,
const char *path,
const char *url,
Modified: subversion/trunk/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/import-cmd.c?rev=966463&r1=966462&r2=966463&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/import-cmd.c (original)
+++ subversion/trunk/subversion/svn/import-cmd.c Wed Jul 21 23:35:48 2010
@@ -48,7 +48,6 @@ svn_cl__import(apr_getopt_t *os,
apr_array_header_t *targets;
const char *path;
const char *url;
- svn_commit_info_t *commit_info = NULL;
/* Import takes two arguments, for example
*
@@ -114,8 +113,7 @@ svn_cl__import(apr_getopt_t *os,
SVN_ERR(svn_cl__cleanup_log_msg
(ctx->log_msg_baton3,
- svn_client_import3(&commit_info,
- path,
+ svn_client_import4(path,
url,
opt_state->depth,
opt_state->no_ignore,
@@ -124,8 +122,5 @@ svn_cl__import(apr_getopt_t *os,
ctx,
pool), pool));
- if (commit_info && ! opt_state->quiet)
- SVN_ERR(svn_cl__print_commit_info(commit_info, NULL, pool));
-
return SVN_NO_ERROR;
}