subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1623786 - in /subversion/branches/log-message-templates/subversion: include/ libsvn_client/ svn/
Date Tue, 09 Sep 2014 12:27:21 GMT
Author: stsp
Date: Tue Sep  9 12:27:21 2014
New Revision: 1623786

URL: http://svn.apache.org/r1623786
Log:
On the log-message-templates branch, undo the introduction of
a new log message callback, and use call the new API function
svn_client_get_log_message_templates_for_commit_items() instead.

This reduces the changeset size vs trunk and allows API consumers to
start using this feature with minimal changes (add one function call).

However, this change requires changes to the log message baton
used by the 'svn' client.

Suggested by: rhuijben

* subversion/include/svn_client.h
  (svn_client_get_commit_log4_t): Remove.
  (svn_client_ctx_t): Remove log_msg_func4 and log_msg_baton4.
   Un-deprecate log_msg_func3.

* subversion/libsvn_client/client.h
  (SVN_CLIENT__HAS_LOG_MSG_FUNC): Undo log_msg_func4 changes.

* subversion/libsvn_client/commit_util.c
  (svn_client_get_log_message_templates,
   svn_client__get_log_msg): Undo log_msg_func4 changes.

* subversion/svn/cl.h
  (svn_cl__make_log_msg_baton): This baton must now store a pointer to
   the whole client context, instead of just ctx->config.
  (svn_cl__get_log_message): Undo log_msg_func4 changes.

* subversion/svn/commit-cmd.c, subversion/svn/copy-cmd.c,
  subversion/svn/delete-cmd.c, subversion/svn/import-cmd.c,
  subversion/svn/mkdir-cmd.c, subversion/svn/move-cmd.c,
  subversion/svn/propedit-cmd.c
  (svn_cl__commit, svn_cl__copy, svn_cl__delete, svn_cl__import,
   svn_cl__mkdir, svn_cl__move, svn_cl__propedit): Undo log_msg_func4 changes.
   Update calls to svn_cl__make_log_msg_baton() to pass the client context.

* subversion/svn/svn.c
  (sub_main): Undo log_msg_func4 changes.

* subversion/svn/util.c
  (log_msg_baton): Replace the pointer to the client config with a pointer
   to the client context, so svn_cl__get_log_message() can use the context.
   Undo log_msg_func4 changes.
  (svn_cl__make_log_msg_baton): Accept and use a client context instead of
   just the client config. Refer to the config via ctx->config.
  (svn_cl__get_log_message): Undo log_msg_func4 changes and call
   svn_client_get_log_message_templates_for_commit_items() to obtain
   log message templates. Refer to the client config via ctx->config.

Modified:
    subversion/branches/log-message-templates/subversion/include/svn_client.h
    subversion/branches/log-message-templates/subversion/libsvn_client/client.h
    subversion/branches/log-message-templates/subversion/libsvn_client/commit_util.c
    subversion/branches/log-message-templates/subversion/svn/cl.h
    subversion/branches/log-message-templates/subversion/svn/commit-cmd.c
    subversion/branches/log-message-templates/subversion/svn/copy-cmd.c
    subversion/branches/log-message-templates/subversion/svn/delete-cmd.c
    subversion/branches/log-message-templates/subversion/svn/import-cmd.c
    subversion/branches/log-message-templates/subversion/svn/mkdir-cmd.c
    subversion/branches/log-message-templates/subversion/svn/move-cmd.c
    subversion/branches/log-message-templates/subversion/svn/propedit-cmd.c
    subversion/branches/log-message-templates/subversion/svn/svn.c
    subversion/branches/log-message-templates/subversion/svn/util.c

Modified: subversion/branches/log-message-templates/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/include/svn_client.h?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/include/svn_client.h (original)
+++ subversion/branches/log-message-templates/subversion/include/svn_client.h Tue Sep  9 12:27:21
2014
@@ -653,31 +653,11 @@ svn_client_commit_item2_dup(const svn_cl
  * structures, which may be fully or only partially filled-in,
  * depending on the type of commit operation.
  *
- * @a log_message_templates is a hash table containing one or more log
- * message templates obtained from svn:log-message properties applicable
- * to @a commit_items. It is @c NULL if no log message template is defined.
- * The hash table is keyed by paths relative to the repository root.
- * Each path in this list of keys contributes a log message template.
- * The value for each key in the table is a 'const char *' log template.
- *
  * @a baton is provided along with the callback for use by the handler.
  *
  * All allocations should be performed in @a pool.
  *
- * @since New in 1.9.
- */
-typedef svn_error_t *(*svn_client_get_commit_log4_t)(
-  const char **log_msg,
-  const char **tmp_file,
-  const apr_array_header_t *commit_items,
-  const apr_hash_t *log_message_templates,
-  void *baton,
-  apr_pool_t *pool);
-
-/* Like svn_client_get_commit_log3_t but without log message template support.
- *
  * @since New in 1.5.
- * @deprecated Provided for backward compatibility with the 1.8 API.
  */
 typedef svn_error_t *(*svn_client_get_commit_log3_t)(
   const char **log_msg,
@@ -1001,8 +981,6 @@ typedef struct svn_client_ctx_t
 
   /** Log message callback function. NULL means that Subversion
    *   should try @c log_msg_func2, then @c log_msg_func.
-   * @deprecated Provided for backward compatibility with the 1.8 API.
-   * Use @c log_msg_func4 instead.
    * @since New in 1.5. */
   svn_client_get_commit_log3_t log_msg_func3;
 
@@ -1066,15 +1044,6 @@ typedef struct svn_client_ctx_t
    * @since New in 1.9.
    */
   void *tunnel_baton;
-
-  /** Log message callback function. NULL means that Subversion should
-   * try @c log_msgs_func3, @c log_msg_func2, then @c log_msg_func.
-   * @since New in 1.9. */
-  svn_client_get_commit_log4_t log_msg_func4;
-
-  /** The callback baton for @c log_msg_func4.
-   * @since New in 1.9. */
-  void *log_msg_baton4;
 } svn_client_ctx_t;
 
 /** Initialize a client context.

Modified: subversion/branches/log-message-templates/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/libsvn_client/client.h?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/libsvn_client/client.h (original)
+++ subversion/branches/log-message-templates/subversion/libsvn_client/client.h Tue Sep  9
12:27:21 2014
@@ -290,8 +290,7 @@ svn_client__ensure_ra_session_url(const 
 
 /* CTX is of type "svn_client_ctx_t *". */
 #define SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx) \
-        ((ctx)->log_msg_func4 || (ctx)->log_msg_func3 || (ctx)->log_msg_func2 \
-         || (ctx)->log_msg_func)
+        ((ctx)->log_msg_func3 || (ctx)->log_msg_func2 || (ctx)->log_msg_func)
 
 /* Open an RA session, returning it in *RA_SESSION or a corrected URL
    in *CORRECTED_URL.  (This function mirrors svn_ra_open4(), which

Modified: subversion/branches/log-message-templates/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/libsvn_client/commit_util.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/log-message-templates/subversion/libsvn_client/commit_util.c Tue Sep
 9 12:27:21 2014
@@ -451,7 +451,6 @@ harvest_committables(const char *local_a
   return SVN_NO_ERROR;
 }
 
-/* Obtain log message templates for svn_client_get_commit_log4_t. */
 svn_error_t *
 svn_client_get_log_message_templates(apr_hash_t **log_message_templates,
                                      const apr_array_header_t *paths_or_urls,
@@ -1161,7 +1160,6 @@ handle_descendants(void *baton,
                                               const char *);
           const char *local_abspath = svn_dirent_join(item->path, relpath,
                                                       iterpool);
-
           /* ### Need a sub-iterpool? */
 
 
@@ -1238,7 +1236,6 @@ handle_descendants(void *baton,
             }
 
           /* Add a new commit item that describes the delete */
-
           SVN_ERR(add_committable(hdb->committables,
                                   svn_dirent_join(item->path, relpath,
                                                   iterpool),
@@ -2130,21 +2127,9 @@ svn_client__get_log_msg(const char **log
                         svn_client_ctx_t *ctx,
                         apr_pool_t *pool)
 {
-  if (ctx->log_msg_func4)
-    {
-      apr_hash_t *log_message_templates;
-
-      SVN_ERR(svn_client_get_log_message_templates_for_commit_items(
-                &log_message_templates, commit_items, ctx, pool, pool));
-      return svn_error_trace((*ctx->log_msg_func4)(log_msg, tmp_file,
-                                                   commit_items,
-                                                   log_message_templates,
-                                                   ctx->log_msg_baton4,
-                                                   pool));
-    }
-  else if (ctx->log_msg_func3)
+  if (ctx->log_msg_func3)
     {
-      /* The client provided a callback function for the 1.8 API.
+      /* The client provided a callback function for the current API.
          Forward the call to it directly. */
       return (*ctx->log_msg_func3)(log_msg, tmp_file, commit_items,
                                    ctx->log_msg_baton3, pool);

Modified: subversion/branches/log-message-templates/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/cl.h?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/cl.h (original)
+++ subversion/branches/log-message-templates/subversion/svn/cl.h Tue Sep  9 12:27:21 2014
@@ -616,8 +616,8 @@ svn_cl__notifier_print_conflict_stats(vo
    on Unix and C:\Windows\Temp on Win32 or something), and use it.
    But APR doesn't yet have that capability.
 
-   CONFIG is a client configuration hash of svn_config_t * items keyed
-   on config categories, and may be NULL.
+   CTX->CONFIG is a client configuration hash of svn_config_t * items
+   keyed on config categories, and may be NULL.
 
    NOTE: While the baton itself will be allocated from POOL, the items
    add to it are added by reference, not duped into POOL!*/
@@ -625,15 +625,14 @@ svn_error_t *
 svn_cl__make_log_msg_baton(void **baton,
                            svn_cl__opt_state_t *opt_state,
                            const char *base_dir,
-                           apr_hash_t *config,
+                           svn_client_ctx_t *ctx,
                            apr_pool_t *pool);
 
-/* A function of type svn_client_get_commit_log4_t. */
+/* A function of type svn_client_get_commit_log3_t. */
 svn_error_t *
 svn_cl__get_log_message(const char **log_msg,
                         const char **tmp_file,
                         const apr_array_header_t *commit_items,
-                        apr_hash_t *log_message_templates,
                         void *baton,
                         apr_pool_t *pool);
 

Modified: subversion/branches/log-message-templates/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/commit-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/commit-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/commit-cmd.c Tue Sep  9 12:27:21
2014
@@ -147,9 +147,9 @@ svn_cl__commit(apr_getopt_t *os,
      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_baton4),
+  SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3),
                                      opt_state, base_dir,
-                                     ctx->config, pool));
+                                     ctx, pool));
 
   /* Copies are done server-side, and cheaply, which means they're
      effectively always done with infinite depth.  This is a potential
@@ -180,7 +180,7 @@ svn_cl__commit(apr_getopt_t *os,
                            NULL,
                            ctx,
                            pool);
-  SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err, pool));
+  SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/log-message-templates/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/copy-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/copy-cmd.c Tue Sep  9 12:27:21
2014
@@ -155,7 +155,7 @@ svn_cl__copy(apr_getopt_t *os,
 
   if (! dst_is_url)
     {
-      ctx->log_msg_func4 = NULL;
+      ctx->log_msg_func3 = NULL;
       if (opt_state->message || opt_state->filedata || opt_state->revprop_table)
         return svn_error_create
           (SVN_ERR_CL_UNNECESSARY_LOG_MESSAGE, NULL,
@@ -163,9 +163,9 @@ svn_cl__copy(apr_getopt_t *os,
              "or revision properties"));
     }
 
-  if (ctx->log_msg_func4)
-    SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state,
-                                       NULL, ctx->config, pool));
+  if (ctx->log_msg_func3)
+    SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
+                                       NULL, ctx, pool));
 
   err = svn_client_copy6(sources, dst_path, TRUE,
                          opt_state->parents, opt_state->ignore_externals,
@@ -174,8 +174,8 @@ svn_cl__copy(apr_getopt_t *os,
                          NULL,
                          ctx, pool);
 
-  if (ctx->log_msg_func4)
-    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err, pool));
+  if (ctx->log_msg_func3)
+    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
   else if (err)
     return svn_error_trace(err);
 

Modified: subversion/branches/log-message-templates/subversion/svn/delete-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/delete-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/delete-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/delete-cmd.c Tue Sep  9 12:27:21
2014
@@ -61,7 +61,7 @@ svn_cl__delete(apr_getopt_t *os,
 
   if (! is_url)
     {
-      ctx->log_msg_func4 = NULL;
+      ctx->log_msg_func3 = NULL;
       if (opt_state->message || opt_state->filedata || opt_state->revprop_table)
         {
           return svn_error_create
@@ -72,8 +72,8 @@ svn_cl__delete(apr_getopt_t *os,
     }
   else
     {
-      SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state,
-                                         NULL, ctx->config, pool));
+      SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
+                                         NULL, ctx, pool));
     }
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
@@ -86,8 +86,8 @@ svn_cl__delete(apr_getopt_t *os,
   if (err)
     err = svn_cl__may_need_force(err);
 
-  if (ctx->log_msg_func4)
-    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err, pool));
+  if (ctx->log_msg_func3)
+    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
   else if (err)
     return svn_error_trace(err);
 

Modified: subversion/branches/log-message-templates/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/import-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/import-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/import-cmd.c Tue Sep  9 12:27:21
2014
@@ -109,11 +109,11 @@ svn_cl__import(apr_getopt_t *os,
   if (opt_state->depth == svn_depth_unknown)
     opt_state->depth = svn_depth_infinity;
 
-  SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state,
-                                     NULL, ctx->config, pool));
+  SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
+                                     NULL, ctx, pool));
 
   SVN_ERR(svn_cl__cleanup_log_msg
-          (ctx->log_msg_baton4,
+          (ctx->log_msg_baton3,
            svn_client_import5(path,
                               url,
                               opt_state->depth,

Modified: subversion/branches/log-message-templates/subversion/svn/mkdir-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/mkdir-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/mkdir-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/mkdir-cmd.c Tue Sep  9 12:27:21
2014
@@ -60,7 +60,7 @@ svn_cl__mkdir(apr_getopt_t *os,
 
   if (! svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *)))
     {
-      ctx->log_msg_func4 = NULL;
+      ctx->log_msg_func3 = NULL;
       if (opt_state->message || opt_state->filedata || opt_state->revprop_table)
         {
           return svn_error_create
@@ -71,8 +71,8 @@ svn_cl__mkdir(apr_getopt_t *os,
     }
   else
     {
-      SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state,
-                                         NULL, ctx->config, pool));
+      SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
+                                         NULL, ctx, pool));
     }
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
@@ -82,8 +82,8 @@ svn_cl__mkdir(apr_getopt_t *os,
                           (opt_state->quiet ? NULL : svn_cl__print_commit_info),
                           NULL, ctx, pool);
 
-  if (ctx->log_msg_func4)
-    err = svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err, pool);
+  if (ctx->log_msg_func3)
+    err = svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool);
 
   if (err)
     {

Modified: subversion/branches/log-message-templates/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/move-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/move-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/move-cmd.c Tue Sep  9 12:27:21
2014
@@ -70,7 +70,7 @@ svn_cl__move(apr_getopt_t *os,
 
   if (! svn_path_is_url(dst_path))
     {
-      ctx->log_msg_func4 = NULL;
+      ctx->log_msg_func3 = NULL;
       if (opt_state->message || opt_state->filedata || opt_state->revprop_table)
         return svn_error_create
           (SVN_ERR_CL_UNNECESSARY_LOG_MESSAGE, NULL,
@@ -78,9 +78,9 @@ svn_cl__move(apr_getopt_t *os,
              "or revision properties"));
     }
 
-  if (ctx->log_msg_func4)
-    SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4), opt_state,
-                                       NULL, ctx->config, pool));
+  if (ctx->log_msg_func3)
+    SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
+                                       NULL, ctx, pool));
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
 
@@ -97,7 +97,7 @@ svn_cl__move(apr_getopt_t *os,
     err = svn_cl__may_need_force(err);
 
   if (ctx->log_msg_func3)
-    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4, err, pool));
+    SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
   else if (err)
     return svn_error_trace(err);
 

Modified: subversion/branches/log-message-templates/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/propedit-cmd.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/propedit-cmd.c Tue Sep  9 12:27:21
2014
@@ -298,9 +298,9 @@ svn_cl__propedit(apr_getopt_t *os,
               svn_cl__check_boolean_prop_val(pname_utf8, edited_propval->data,
                                              subpool);
 
-              if (ctx->log_msg_func4)
-                SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton4),
-                                                   opt_state, NULL, ctx->config,
+              if (ctx->log_msg_func3)
+                SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3),
+                                                   opt_state, NULL, ctx,
                                                    subpool));
               if (svn_path_is_url(target))
                 {
@@ -327,8 +327,8 @@ svn_cl__propedit(apr_getopt_t *os,
                                                  ctx, subpool);
                 }
 
-              if (ctx->log_msg_func4)
-                SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton4,
+              if (ctx->log_msg_func3)
+                SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3,
                                                 err, pool));
               else if (err)
                 return svn_error_trace(err);

Modified: subversion/branches/log-message-templates/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/svn.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/svn.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/svn.c Tue Sep  9 12:27:21 2014
@@ -2826,8 +2826,8 @@ sub_main(int *exit_code, int argc, const
                         SVN_CONFIG_OPTION_NO_UNLOCK, TRUE);
 
   /* Set the log message callback function.  Note that individual
-     subcommands will populate the ctx->log_msg_baton4. */
-  ctx->log_msg_func4 = svn_cl__get_log_message;
+     subcommands will populate the ctx->log_msg_baton3. */
+  ctx->log_msg_func3 = svn_cl__get_log_message;
 
   /* Set up the notifier.
 

Modified: subversion/branches/log-message-templates/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/log-message-templates/subversion/svn/util.c?rev=1623786&r1=1623785&r2=1623786&view=diff
==============================================================================
--- subversion/branches/log-message-templates/subversion/svn/util.c (original)
+++ subversion/branches/log-message-templates/subversion/svn/util.c Tue Sep  9 12:27:21 2014
@@ -174,7 +174,7 @@ svn_cl__merge_file_externally(const char
 }
 
 
-/* A svn_client_ctx_t's log_msg_baton4, for use with
+/* A svn_client_ctx_t's log_msg_baton3, for use with
    svn_cl__make_log_msg_baton(). */
 struct log_msg_baton
 {
@@ -184,7 +184,7 @@ struct log_msg_baton
   const char *base_dir; /* the base directory for an external edit. UTF-8! */
   const char *tmpfile_left; /* the tmpfile left by an external edit. UTF-8! */
   svn_boolean_t non_interactive; /* if true, don't pop up an editor */
-  apr_hash_t *config; /* client configuration hash */
+  svn_client_ctx_t *ctx; /* client context */
   svn_boolean_t keep_locks; /* Keep repository locks? */
   apr_pool_t *pool; /* a pool. */
 };
@@ -194,7 +194,7 @@ svn_error_t *
 svn_cl__make_log_msg_baton(void **baton,
                            svn_cl__opt_state_t *opt_state,
                            const char *base_dir /* UTF-8! */,
-                           apr_hash_t *config,
+                           svn_client_ctx_t *ctx,
                            apr_pool_t *pool)
 {
   struct log_msg_baton *lmb = apr_palloc(pool, sizeof(*lmb));
@@ -222,9 +222,10 @@ svn_cl__make_log_msg_baton(void **baton,
     {
       lmb->message_encoding = opt_state->encoding;
     }
-  else if (config)
+  else if (ctx->config)
     {
-      svn_config_t *cfg = svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG);
+      svn_config_t *cfg = svn_hash_gets(ctx->config,
+                                        SVN_CONFIG_CATEGORY_CONFIG);
       svn_config_get(cfg, &(lmb->message_encoding),
                      SVN_CONFIG_SECTION_MISCELLANY,
                      SVN_CONFIG_OPTION_LOG_ENCODING,
@@ -233,7 +234,7 @@ svn_cl__make_log_msg_baton(void **baton,
 
   lmb->base_dir = base_dir ? base_dir : "";
   lmb->tmpfile_left = NULL;
-  lmb->config = config;
+  lmb->ctx = ctx;
   lmb->keep_locks = opt_state->no_unlock;
   lmb->non_interactive = opt_state->non_interactive;
   lmb->pool = pool;
@@ -327,15 +328,17 @@ svn_error_t *
 svn_cl__get_log_message(const char **log_msg,
                         const char **tmp_file,
                         const apr_array_header_t *commit_items,
-                        apr_hash_t *log_message_templates,
                         void *baton,
                         apr_pool_t *pool)
 {
   svn_stringbuf_t *default_msg = NULL;
   struct log_msg_baton *lmb = baton;
   svn_stringbuf_t *message = NULL;
+  apr_hash_t *log_message_templates;
 
   /* Set default message.  */
+  SVN_ERR(svn_client_get_log_message_templates_for_commit_items(
+            &log_message_templates, commit_items, lmb->ctx, pool, pool));
   if (log_message_templates)
     {
       svn_stringbuf_t *template_text;
@@ -466,7 +469,7 @@ svn_cl__get_log_message(const char **log
           err = svn_cmdline__edit_string_externally(&msg_string, &lmb->tmpfile_left,
                                                     lmb->editor_cmd, lmb->base_dir,
                                                     msg_string, "svn-commit",
-                                                    lmb->config, TRUE,
+                                                    lmb->ctx->config, TRUE,
                                                     lmb->message_encoding,
                                                     pool);
         }



Mime
View raw message