[[[ Working towards issue #3217: svn commit should show unknown files in editor Modify the log message callback to use the newly created svn_client_get_commit_log4_t type. The new callback type includes a list of unversioned items that are in the working copy. We can now include this list in the log message when calling an external editor. * subversion/svn/cl.h (svn_cl__get_log_message): Add the parameter unversioned_items so it is now compatible with svn_client_get_commit_log4_t. * subversion/svn/util.c (svn_cl__get_log_message): Modify this callback to be of the new svn_client_get_commit_log4_t type. When calling an external editor add the list of unversioned_items after the commit_items. * subversion/svn/main.c (main): Assign svn_cl__get_log_message to log_msg_func4 rather than log_msg_func3. All callers updated. ]]] Index: subversion/svn/cl.h =================================================================== --- subversion/svn/cl.h (revision 31824) +++ subversion/svn/cl.h (working copy) @@ -546,10 +546,11 @@ apr_hash_t *config, apr_pool_t *pool); -/* A function of type svn_client_get_commit_log3_t. */ +/* A function of type svn_client_get_commit_log4_t. */ svn_error_t *svn_cl__get_log_message(const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, + const apr_array_header_t *unversioned_items, void *baton, apr_pool_t *pool); Index: subversion/svn/move-cmd.c =================================================================== --- subversion/svn/move-cmd.c (revision 31824) +++ subversion/svn/move-cmd.c (working copy) @@ -70,7 +70,7 @@ if (! svn_path_is_url(dst_path)) { - ctx->log_msg_func3 = NULL; + ctx->log_msg_func4 = NULL; if (opt_state->message || opt_state->filedata || opt_state->revprop_table) return svn_error_create (SVN_ERR_CL_UNNECESSARY_LOG_MESSAGE, NULL, @@ -78,8 +78,8 @@ "or revision properties")); } - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, pool)); err = svn_client_move5(&commit_info, targets, dst_path, opt_state->force, @@ -89,8 +89,8 @@ if (err) err = svn_cl__may_need_force(err); - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err)); + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err)); else if (err) return err; Index: subversion/svn/mkdir-cmd.c =================================================================== --- subversion/svn/mkdir-cmd.c (revision 31824) +++ subversion/svn/mkdir-cmd.c (working copy) @@ -58,7 +58,7 @@ if (! svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *))) { - ctx->log_msg_func3 = NULL; + ctx->log_msg_func4 = NULL; if (opt_state->message || opt_state->filedata || opt_state->revprop_table) { return svn_error_create @@ -69,15 +69,15 @@ } else { - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, pool)); } err = svn_client_mkdir3(&commit_info, targets, opt_state->parents, opt_state->revprop_table, ctx, pool); - if (ctx->log_msg_func3) - err = svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err); + if (ctx->log_msg_func4) + err = svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err); if (err) { Index: subversion/svn/copy-cmd.c =================================================================== --- subversion/svn/copy-cmd.c (revision 31824) +++ subversion/svn/copy-cmd.c (working copy) @@ -119,7 +119,7 @@ if (! dst_is_url) { - ctx->log_msg_func3 = NULL; + ctx->log_msg_func4 = NULL; if (opt_state->message || opt_state->filedata || opt_state->revprop_table) return svn_error_create (SVN_ERR_CL_UNNECESSARY_LOG_MESSAGE, NULL, @@ -127,16 +127,16 @@ "or revision properties")); } - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, pool)); err = svn_client_copy4(&commit_info, sources, dst_path, TRUE, opt_state->parents, opt_state->revprop_table, ctx, pool); - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err)); + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err)); else if (err) return err; Index: subversion/svn/util.c =================================================================== --- subversion/svn/util.c (revision 31824) +++ subversion/svn/util.c (working copy) @@ -486,7 +486,7 @@ } -/* A svn_client_ctx_t's log_msg_baton3, for use with +/* A svn_client_ctx_t's log_msg_baton4, for use with svn_cl__make_log_msg_baton(). */ struct log_msg_baton { @@ -638,6 +638,7 @@ svn_cl__get_log_message(const char **log_msg, const char **tmp_file, const apr_array_header_t *commit_items, + const apr_array_header_t *unversioned_items, void *baton, apr_pool_t *pool) { @@ -645,6 +646,8 @@ struct log_msg_baton *lmb = baton; svn_stringbuf_t *message = NULL; + assert(baton); + /* Set default message. */ default_msg = svn_stringbuf_create(APR_EOL_STR, pool); svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX); @@ -741,6 +744,21 @@ svn_stringbuf_appendcstr(tmp_message, APR_EOL_STR); } + if (unversioned_items) + { + for (i = 0; i < unversioned_items->nelts; i++) + { + const char *path = APR_ARRAY_IDX(unversioned_items, + i, const char *); + + if (path && lmb->base_dir) + path = svn_path_is_child(lmb->base_dir, path, pool); + + svn_stringbuf_appendcstr(tmp_message, "? "); + svn_stringbuf_appendcstr(tmp_message, path); + svn_stringbuf_appendcstr(tmp_message, APR_EOL_STR); + } + } msg_string->data = tmp_message->data; msg_string->len = tmp_message->len; Index: subversion/svn/commit-cmd.c =================================================================== --- subversion/svn/commit-cmd.c (revision 31824) +++ subversion/svn/commit-cmd.c (working copy) @@ -104,7 +104,7 @@ to store the temp file, instead of the current working directory. The client might not have write access to their working directory, but they better have write access to the directory they're committing. */ - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, base_dir, ctx->config, pool)); @@ -132,7 +132,7 @@ err = root_err; } } - SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err)); + SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err)); if (! err && ! opt_state->quiet) SVN_ERR(svn_cl__print_commit_info(commit_info, pool)); Index: subversion/svn/delete-cmd.c =================================================================== --- subversion/svn/delete-cmd.c (revision 31824) +++ subversion/svn/delete-cmd.c (working copy) @@ -57,7 +57,7 @@ if (! svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *))) { - ctx->log_msg_func3 = NULL; + ctx->log_msg_func4 = NULL; if (opt_state->message || opt_state->filedata || opt_state->revprop_table) { return svn_error_create @@ -68,7 +68,7 @@ } else { - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, pool)); } @@ -78,8 +78,8 @@ if (err) err = svn_cl__may_need_force(err); - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err)); + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err)); else if (err) return err; Index: subversion/svn/import-cmd.c =================================================================== --- subversion/svn/import-cmd.c (revision 31824) +++ subversion/svn/import-cmd.c (working copy) @@ -108,11 +108,11 @@ if (opt_state->depth == svn_depth_unknown) opt_state->depth = svn_depth_infinity; - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state, + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, pool)); SVN_ERR(svn_cl__cleanup_log_msg - (ctx->log_msg_baton3, + (ctx->log_msg_baton4, svn_client_import3(&commit_info, path, url, Index: subversion/svn/main.c =================================================================== --- subversion/svn/main.c (revision 31824) +++ subversion/svn/main.c (working copy) @@ -1883,8 +1883,8 @@ SVN_CONFIG_OPTION_NO_UNLOCK, TRUE); /* Set the log message callback function. Note that individual - subcommands will populate the ctx->log_msg_baton3. */ - ctx->log_msg_func3 = svn_cl__get_log_message; + subcommands will populate the ctx->log_msg_baton4. */ + ctx->log_msg_func4 = svn_cl__get_log_message; /* Set up our cancellation support. */ ctx->cancel_func = svn_cl__check_cancel; Index: subversion/svn/propedit-cmd.c =================================================================== --- subversion/svn/propedit-cmd.c (revision 31824) +++ subversion/svn/propedit-cmd.c (working copy) @@ -254,8 +254,8 @@ svn_cl__check_boolean_prop_val(pname_utf8, edited_propval->data, subpool); - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state, NULL, ctx->config, subpool)); @@ -264,8 +264,8 @@ svn_depth_empty, opt_state->force, base_rev, NULL, opt_state->revprop_table, ctx, subpool); - if (ctx->log_msg_func3) - SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err)); + if (ctx->log_msg_func4) + SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err)); else if (err) return err;