Author: hwright
Date: Fri Jan 13 22:23:07 2012
New Revision: 1231345
URL: http://svn.apache.org/viewvc?rev=1231345&view=rev
Log:
On the ev2-export branch:
Add a helper function; no functional change.
* subversion/libsvn_client/export.c
(get_editor): New.
(svn_client_export5): Use the helper function.
Modified:
subversion/branches/ev2-export/subversion/libsvn_client/export.c
Modified: subversion/branches/ev2-export/subversion/libsvn_client/export.c
URL:
http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/export.c?rev=1231345&r1=1231344&r2=1231345&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/export.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/export.c Fri Jan 13
22:23:07 2012
@@ -1069,6 +1069,47 @@ fetch_base_func(const char **filename,
return SVN_NO_ERROR;
}
+static svn_error_t *
+get_editor(const svn_delta_editor_t **export_editor,
+ void **edit_baton,
+ void *eb,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_delta_editor_t *editor = svn_delta_default_editor(result_pool);
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(result_pool);
+
+ editor->set_target_revision = set_target_revision;
+ editor->open_root = open_root;
+ editor->add_directory = add_directory;
+ editor->add_file = add_file;
+ editor->apply_textdelta = apply_textdelta;
+ editor->close_file = close_file;
+ editor->change_file_prop = change_file_prop;
+ editor->change_dir_prop = change_dir_prop;
+
+ SVN_ERR(svn_delta_get_cancellation_editor(ctx->cancel_func,
+ ctx->cancel_baton,
+ editor,
+ eb,
+ export_editor,
+ edit_baton,
+ result_pool));
+
+ shim_callbacks->fetch_kind_func = fetch_kind_func;
+ shim_callbacks->fetch_props_func = fetch_props_func;
+ shim_callbacks->fetch_base_func = fetch_base_func;
+ shim_callbacks->fetch_baton = eb;
+
+ SVN_ERR(svn_editor__insert_shims(export_editor, edit_baton,
+ *export_editor, *edit_baton,
+ shim_callbacks, result_pool, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
/*** Public Interfaces ***/
@@ -1207,36 +1248,10 @@ svn_client_export5(svn_revnum_t *result_
const svn_delta_editor_t *export_editor;
const svn_ra_reporter3_t *reporter;
void *report_baton;
- svn_delta_editor_t *editor = svn_delta_default_editor(pool);
svn_boolean_t use_sleep = FALSE;
- svn_delta_shim_callbacks_t *shim_callbacks =
- svn_delta_shim_callbacks_default(pool);
- editor->set_target_revision = set_target_revision;
- editor->open_root = open_root;
- editor->add_directory = add_directory;
- editor->add_file = add_file;
- editor->apply_textdelta = apply_textdelta;
- editor->close_file = close_file;
- editor->change_file_prop = change_file_prop;
- editor->change_dir_prop = change_dir_prop;
-
- SVN_ERR(svn_delta_get_cancellation_editor(ctx->cancel_func,
- ctx->cancel_baton,
- editor,
- eb,
- &export_editor,
- &edit_baton,
- pool));
-
- shim_callbacks->fetch_kind_func = fetch_kind_func;
- shim_callbacks->fetch_props_func = fetch_props_func;
- shim_callbacks->fetch_base_func = fetch_base_func;
- shim_callbacks->fetch_baton = eb;
-
- SVN_ERR(svn_editor__insert_shims(&export_editor, &edit_baton,
- export_editor, edit_baton,
- shim_callbacks, pool, pool));
+ SVN_ERR(get_editor(&export_editor, &edit_baton, eb,
+ ctx, pool, pool));
/* Manufacture a basic 'report' to the update reporter. */
SVN_ERR(svn_ra_do_update2(ra_session,