aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_client/commit_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_client/commit_util.c')
-rw-r--r--subversion/libsvn_client/commit_util.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/subversion/libsvn_client/commit_util.c b/subversion/libsvn_client/commit_util.c
index 1f3d87783436..2be3ecd5ce39 100644
--- a/subversion/libsvn_client/commit_util.c
+++ b/subversion/libsvn_client/commit_util.c
@@ -1392,6 +1392,29 @@ sort_commit_item_urls(const void *a, const void *b)
}
+svn_error_t *
+svn_client__condense_commit_items2(const char *base_url,
+ apr_array_header_t *commit_items,
+ apr_pool_t *pool)
+{
+ apr_array_header_t *ci = commit_items; /* convenience */
+ int i;
+
+ /* Sort our commit items by their URLs. */
+ svn_sort__array(ci, sort_commit_item_urls);
+
+ /* Hack BASE_URL off each URL; store the result as session_relpath. */
+ for (i = 0; i < ci->nelts; i++)
+ {
+ svn_client_commit_item3_t *this_item
+ = APR_ARRAY_IDX(ci, i, svn_client_commit_item3_t *);
+
+ this_item->session_relpath = svn_uri_skip_ancestor(base_url,
+ this_item->url, pool);
+ }
+
+ return SVN_NO_ERROR;
+}
svn_error_t *
svn_client__condense_commit_items(const char **base_url,
@@ -1501,8 +1524,6 @@ struct file_mod_t
/* A baton for use while driving a path-based editor driver for commit */
struct item_commit_baton
{
- const svn_delta_editor_t *editor; /* commit editor */
- void *edit_baton; /* commit editor's baton */
apr_hash_t *file_mods; /* hash: path->file_mod_t */
const char *notify_path_prefix; /* notification path prefix
(NULL is okay, else abs path) */
@@ -1524,6 +1545,8 @@ struct item_commit_baton
* This implements svn_delta_path_driver_cb_func_t. */
static svn_error_t *
do_item_commit(void **dir_baton,
+ const svn_delta_editor_t *editor,
+ void *edit_baton,
void *parent_baton,
void *callback_baton,
const char *path,
@@ -1535,7 +1558,6 @@ do_item_commit(void **dir_baton,
svn_node_kind_t kind = item->kind;
void *file_baton = NULL;
apr_pool_t *file_pool = NULL;
- const svn_delta_editor_t *editor = icb->editor;
apr_hash_t *file_mods = icb->file_mods;
svn_client_ctx_t *ctx = icb->ctx;
svn_error_t *err;
@@ -1737,7 +1759,7 @@ do_item_commit(void **dir_baton,
{
if (! parent_baton)
{
- err = editor->open_root(icb->edit_baton, item->revision,
+ err = editor->open_root(edit_baton, item->revision,
pool, dir_baton);
}
else
@@ -1871,8 +1893,6 @@ svn_client__do_commit(const char *base_url,
}
/* Setup the callback baton. */
- cb_baton.editor = editor;
- cb_baton.edit_baton = edit_baton;
cb_baton.file_mods = file_mods;
cb_baton.notify_path_prefix = notify_path_prefix;
cb_baton.ctx = ctx;
@@ -1880,7 +1900,7 @@ svn_client__do_commit(const char *base_url,
cb_baton.base_url = base_url;
/* Drive the commit editor! */
- SVN_ERR(svn_delta_path_driver2(editor, edit_baton, paths, TRUE,
+ SVN_ERR(svn_delta_path_driver3(editor, edit_baton, paths, TRUE,
do_item_commit, &cb_baton, scratch_pool));
/* Transmit outstanding text deltas. */