> -----Original Message-----
> From: stsp_at_apache.org [mailto:stsp_at_apache.org]
> Sent: donderdag 28 januari 2016 09:41
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1727276 - in /subversion/trunk/subversion:
> libsvn_client/resolved.c svn/conflict-callbacks.c
>
> Author: stsp
> Date: Thu Jan 28 08:41:14 2016
> New Revision: 1727276
>
> URL: http://svn.apache.org/viewvc?rev=1727276&view=rev
> Log:
> Make libsvn_client describe all currently available tree conflict options.
>
> * subversion/libsvn_client/resolved.c
> (tree_conflict_options): Remove this static table of options, now unused.
> (svn_client_conflict_tree_get_resolution_options): Build an array of options
> and include the special options for update-move-away and edit-deleted-dir
> cases if appropriate. The result corresponds to what 'svn' already offers.
>
> * subversion/svn/conflict-callbacks.c
> (tree_conflict_options_update_moved_away,
> tree_conflict_options_update_edit_deleted_dir): Set long option
> descriptions
> to NULL so descriptions provided by libsvn_client are used instead.
>
> Modified:
> subversion/trunk/subversion/libsvn_client/resolved.c
> subversion/trunk/subversion/svn/conflict-callbacks.c
>
> Modified: subversion/trunk/subversion/libsvn_client/resolved.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/re
> solved.c?rev=1727276&r1=1727275&r2=1727276&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_client/resolved.c (original)
> +++ subversion/trunk/subversion/libsvn_client/resolved.c Thu Jan 28
> 08:41:14 2016
> @@ -906,27 +906,6 @@ static const svn_client_conflict_option_
>
> };
>
> -/* Resolver options for a tree conflict */
> -static const svn_client_conflict_option_t tree_conflict_options[] =
> -{
> - {
> - svn_client_conflict_option_postpone,
> - N_("skip this conflict and leave it unresolved"),
> - NULL,
> - resolve_tree_conflict
> - },
> -
> - {
> - /* ### Use 'working text' for now since libsvn_wc does not know another
> - * ### choice to resolve to working yet. */
> - svn_client_conflict_option_working_text,
> - N_("accept current working copy state"),
> - NULL,
> - resolve_tree_conflict
> - },
> -
> -};
> -
> static svn_error_t *
> assert_text_conflict(svn_client_conflict_t *conflict, apr_pool_t
> *scratch_pool)
> {
> @@ -1032,17 +1011,56 @@ svn_client_conflict_tree_get_resolution_
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool)
> {
> - int i;
> + svn_client_conflict_option_t *option;
>
> SVN_ERR(assert_tree_conflict(conflict, scratch_pool));
>
> - *options = apr_array_make(result_pool,
> ARRAY_LEN(tree_conflict_options),
> + *options = apr_array_make(result_pool, 2,
> sizeof(svn_client_conflict_option_t *));
> - for (i = 0; i < ARRAY_LEN(tree_conflict_options); i++)
> +
> + /* Add postpone option. */
> + option = apr_pcalloc(result_pool, sizeof(*option));
> + option->id = svn_client_conflict_option_postpone;
> + option->description = N_("skip this conflict and leave it unresolved");
I think description should now use _() to localize the option here, instead of in the callee.
I was assuming the N_() in the array was that it wasn't evaluated there, but added to the localization strings anyway... to allow later code to use the localized variants via the api.
We currently don't provide access to our gettext instance via our api, so I have no idea how localization should work when we are used as a library and don't provide the localized values.
Bert
Received on 2016-01-28 12:01:19 CET