Modified: subversion/branches/addremove/subversion/libsvn_client/commit_util.c URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/commit_util.c?rev=1878061&r1=1878060&r2=1878061&view=diff ============================================================================== --- subversion/branches/addremove/subversion/libsvn_client/commit_util.c (original) +++ subversion/branches/addremove/subversion/libsvn_client/commit_util.c Sat May 23 14:16:56 2020 @@ -1392,6 +1392,29 @@ sort_commit_item_urls(const void *a, con } +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_u } /* 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_u 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. */ @@ -2011,7 +2031,7 @@ svn_client__get_log_msg(const char **log old_item->kind = item->kind; old_item->url = item->url; /* The pre-1.3 API used the revision field for copyfrom_rev - and revision depeding of copyfrom_url. */ + and revision depending of copyfrom_url. */ old_item->revision = item->copyfrom_url ? item->copyfrom_rev : item->revision; old_item->copyfrom_url = item->copyfrom_url;