You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/05/13 20:18:17 UTC
svn commit: r1482014 [3/3] - in /subversion/branches/1.8.x-r1477876: ./
subversion/include/ subversion/libsvn_client/ subversion/libsvn_fs_fs/
subversion/libsvn_ra_serf/ subversion/libsvn_repos/ subversion/libsvn_subr/
subversion/po/ subversion/svn/ su...
Modified: subversion/branches/1.8.x-r1477876/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svn/cl.h?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svn/cl.h (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svn/cl.h Mon May 13 18:18:16 2013
@@ -331,6 +331,23 @@ svn_cl__check_cancel(void *baton);
typedef struct svn_cl__interactive_conflict_baton_t
svn_cl__interactive_conflict_baton_t;
+/* Conflict stats for operations such as update and merge. */
+typedef struct svn_cl__conflict_stats_t svn_cl__conflict_stats_t;
+
+/* Return a new, initialized, conflict stats structure, allocated in
+ * POOL. */
+svn_cl__conflict_stats_t *
+svn_cl__conflict_stats_create(apr_pool_t *pool);
+
+/* Update CONFLICT_STATS to reflect that a conflict on PATH_LOCAL of kind
+ * CONFLICT_KIND is resolved. (There is no support for updating the
+ * 'skipped paths' stats, since skips cannot be 'resolved'.) */
+void
+svn_cl__conflict_stats_resolved(svn_cl__conflict_stats_t *conflict_stats,
+ const char *path_local,
+ svn_wc_conflict_kind_t conflict_kind);
+
+
/* Create and return an baton for use with svn_cl__conflict_func_interactive
* in *B, allocated from RESULT_POOL, and initialised with the values
* ACCEPT_WHICH, CONFIG, EDITOR_CMD, CANCEL_FUNC and CANCEL_BATON. */
@@ -340,6 +357,7 @@ svn_cl__get_conflict_func_interactive_ba
svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
+ svn_cl__conflict_stats_t *conflict_stats,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool);
@@ -516,6 +534,7 @@ svn_cl__merge_file(const char *base_path
svn_error_t *
svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
void **notify_baton_p,
+ svn_cl__conflict_stats_t *conflict_stats,
apr_pool_t *pool);
/* Make the notifier for use with BATON print the appropriate summary
@@ -551,13 +570,7 @@ svn_cl__check_externals_failed_notify_wr
const svn_wc_notify_t *n,
apr_pool_t *pool);
-/* Reset to zero the conflict stats accumulated in BATON, which is the
- * notifier baton from svn_cl__get_notifier().
- */
-svn_error_t *
-svn_cl__notifier_reset_conflict_stats(void *baton);
-
-/* Print the conflict stats accumulated in BATON, which is the
+/* Print the conflict stats accumulated in BATON, which is the
* notifier baton from svn_cl__get_notifier().
* Return any error encountered during printing.
*/
@@ -565,7 +578,7 @@ svn_error_t *
svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool);
-/*** Log message callback stuffs. ***/
+/*** Log message callback stuffs. ***/
/* Allocate in POOL a baton for use with svn_cl__get_log_message().
Modified: subversion/branches/1.8.x-r1477876/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svn/conflict-callbacks.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svn/conflict-callbacks.c Mon May 13 18:18:16 2013
@@ -55,6 +55,7 @@ struct svn_cl__interactive_conflict_bato
svn_cmdline_prompt_baton_t *pb;
const char *path_prefix;
svn_boolean_t quit;
+ svn_cl__conflict_stats_t *conflict_stats;
};
svn_error_t *
@@ -63,6 +64,7 @@ svn_cl__get_conflict_func_interactive_ba
svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
+ svn_cl__conflict_stats_t *conflict_stats,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool)
@@ -79,6 +81,7 @@ svn_cl__get_conflict_func_interactive_ba
(*b)->pb = pb;
SVN_ERR(svn_dirent_get_absolute(&(*b)->path_prefix, "", result_pool));
(*b)->quit = FALSE;
+ (*b)->conflict_stats = conflict_stats;
return SVN_NO_ERROR;
}
@@ -1024,12 +1027,13 @@ handle_obstructed_add(svn_wc_conflict_re
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description2_t *desc,
- void *baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+/* The body of svn_cl__conflict_func_interactive(). */
+static svn_error_t *
+conflict_func_interactive(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_cl__interactive_conflict_baton_t *b = baton;
svn_error_t *err;
@@ -1204,3 +1208,28 @@ svn_cl__conflict_func_interactive(svn_wc
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_cl__interactive_conflict_baton_t *b = baton;
+
+ SVN_ERR(conflict_func_interactive(result, desc, baton,
+ result_pool, scratch_pool));
+
+ /* If we are resolving a conflict, adjust the summary of conflicts. */
+ if ((*result)->choice != svn_wc_conflict_choose_postpone)
+ {
+ const char *local_path
+ = svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath, scratch_pool);
+
+ svn_cl__conflict_stats_resolved(b->conflict_stats, local_path,
+ desc->kind);
+ }
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/1.8.x-r1477876/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svn/notify.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svn/notify.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svn/notify.c Mon May 13 18:18:16 2013
@@ -56,37 +56,74 @@ struct notify_baton
svn_boolean_t had_print_error; /* Used to not keep printing error messages
when we've already had one print error. */
- /* Conflict stats for update and merge. */
+ svn_cl__conflict_stats_t *conflict_stats;
+
+ /* The cwd, for use in decomposing absolute paths. */
+ const char *path_prefix;
+};
+
+/* Conflict stats for operations such as update and merge. */
+struct svn_cl__conflict_stats_t
+{
apr_pool_t *stats_pool;
apr_hash_t *text_conflicts, *prop_conflicts, *tree_conflicts;
int text_conflicts_resolved, prop_conflicts_resolved, tree_conflicts_resolved;
int skipped_paths;
-
- /* The cwd, for use in decomposing absolute paths. */
- const char *path_prefix;
};
+svn_cl__conflict_stats_t *
+svn_cl__conflict_stats_create(apr_pool_t *pool)
+{
+ svn_cl__conflict_stats_t *conflict_stats
+ = apr_palloc(pool, sizeof(*conflict_stats));
+
+ conflict_stats->stats_pool = pool;
+ conflict_stats->text_conflicts = apr_hash_make(pool);
+ conflict_stats->prop_conflicts = apr_hash_make(pool);
+ conflict_stats->tree_conflicts = apr_hash_make(pool);
+ conflict_stats->text_conflicts_resolved = 0;
+ conflict_stats->prop_conflicts_resolved = 0;
+ conflict_stats->tree_conflicts_resolved = 0;
+ conflict_stats->skipped_paths = 0;
+ return conflict_stats;
+}
/* Add the PATH (as a key, with a meaningless value) into the HASH in NB. */
static void
store_path(struct notify_baton *nb, apr_hash_t *hash, const char *path)
{
- svn_hash_sets(hash, apr_pstrdup(nb->stats_pool, path), "");
+ svn_hash_sets(hash, apr_pstrdup(nb->conflict_stats->stats_pool, path), "");
}
-svn_error_t *
-svn_cl__notifier_reset_conflict_stats(void *baton)
+void
+svn_cl__conflict_stats_resolved(svn_cl__conflict_stats_t *conflict_stats,
+ const char *path_local,
+ svn_wc_conflict_kind_t conflict_kind)
{
- struct notify_baton *nb = baton;
-
- apr_hash_clear(nb->text_conflicts);
- apr_hash_clear(nb->prop_conflicts);
- apr_hash_clear(nb->tree_conflicts);
- nb->text_conflicts_resolved = 0;
- nb->prop_conflicts_resolved = 0;
- nb->tree_conflicts_resolved = 0;
- nb->skipped_paths = 0;
- return SVN_NO_ERROR;
+ switch (conflict_kind)
+ {
+ case svn_wc_conflict_kind_text:
+ if (svn_hash_gets(conflict_stats->text_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->text_conflicts, path_local, NULL);
+ conflict_stats->text_conflicts_resolved++;
+ }
+ break;
+ case svn_wc_conflict_kind_property:
+ if (svn_hash_gets(conflict_stats->prop_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->prop_conflicts, path_local, NULL);
+ conflict_stats->prop_conflicts_resolved++;
+ }
+ break;
+ case svn_wc_conflict_kind_tree:
+ if (svn_hash_gets(conflict_stats->tree_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->tree_conflicts, path_local, NULL);
+ conflict_stats->tree_conflicts_resolved++;
+ }
+ break;
+ }
}
static const char *
@@ -111,17 +148,17 @@ svn_error_t *
svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool)
{
struct notify_baton *nb = baton;
- int n_text = apr_hash_count(nb->text_conflicts);
- int n_prop = apr_hash_count(nb->prop_conflicts);
- int n_tree = apr_hash_count(nb->tree_conflicts);
- int n_text_r = nb->text_conflicts_resolved;
- int n_prop_r = nb->prop_conflicts_resolved;
- int n_tree_r = nb->tree_conflicts_resolved;
+ int n_text = apr_hash_count(nb->conflict_stats->text_conflicts);
+ int n_prop = apr_hash_count(nb->conflict_stats->prop_conflicts);
+ int n_tree = apr_hash_count(nb->conflict_stats->tree_conflicts);
+ int n_text_r = nb->conflict_stats->text_conflicts_resolved;
+ int n_prop_r = nb->conflict_stats->prop_conflicts_resolved;
+ int n_tree_r = nb->conflict_stats->tree_conflicts_resolved;
if (n_text > 0 || n_text_r > 0
|| n_prop > 0 || n_prop_r > 0
|| n_tree > 0 || n_tree_r > 0
- || nb->skipped_paths > 0)
+ || nb->conflict_stats->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_("Summary of conflicts:\n")));
@@ -158,10 +195,10 @@ svn_cl__notifier_print_conflict_stats(vo
remaining_str(scratch_pool, n_tree),
resolved_str(scratch_pool, n_tree_r)));
}
- if (nb->skipped_paths > 0)
+ if (nb->conflict_stats->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_(" Skipped paths: %d\n"),
- nb->skipped_paths));
+ nb->conflict_stats->skipped_paths));
return SVN_NO_ERROR;
}
@@ -191,7 +228,7 @@ notify(void *baton, const svn_wc_notify_
switch (n->action)
{
case svn_wc_notify_skip:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if (n->content_state == svn_wc_notify_state_missing)
{
if ((err = svn_cmdline_printf
@@ -214,28 +251,28 @@ notify(void *baton, const svn_wc_notify_
}
break;
case svn_wc_notify_update_skip_obstruction:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- An obstructing working copy was found\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_update_skip_working_only:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Has no versioned parent\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_update_skip_access_denied:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Access denied\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_skip_conflicted:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Node remains in conflict\n"),
path_local)))
@@ -284,7 +321,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
goto print_error;
}
@@ -299,7 +336,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else
@@ -307,7 +344,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -337,23 +374,6 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_resolved:
- /* All conflicts on this path are resolved, so remove path from
- each of the text-, prop- and tree-conflict lists. */
- if (svn_hash_gets(nb->text_conflicts, path_local))
- {
- svn_hash_sets(nb->text_conflicts, path_local, NULL);
- nb->text_conflicts_resolved++;
- }
- if (svn_hash_gets(nb->prop_conflicts, path_local))
- {
- svn_hash_sets(nb->prop_conflicts, path_local, NULL);
- nb->prop_conflicts_resolved++;
- }
- if (svn_hash_gets(nb->tree_conflicts, path_local))
- {
- svn_hash_sets(nb->tree_conflicts, path_local, NULL);
- nb->tree_conflicts_resolved++;
- }
if ((err = svn_cmdline_printf(pool,
_("Resolved conflicted state of '%s'\n"),
path_local)))
@@ -390,7 +410,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -403,7 +423,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_changed)
@@ -602,7 +622,7 @@ notify(void *baton, const svn_wc_notify_
{
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -615,7 +635,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -992,7 +1012,7 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_tree_conflict:
- store_path(nb, nb->tree_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->tree_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, " C %s\n", path_local)))
goto print_error;
break;
@@ -1140,6 +1160,7 @@ notify(void *baton, const svn_wc_notify_
svn_error_t *
svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
void **notify_baton_p,
+ svn_cl__conflict_stats_t *conflict_stats,
apr_pool_t *pool)
{
struct notify_baton *nb = apr_pcalloc(pool, sizeof(*nb));
@@ -1151,14 +1172,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->is_wc_to_repos_copy = FALSE;
nb->in_external = FALSE;
nb->had_print_error = FALSE;
- nb->stats_pool = pool;
- nb->text_conflicts = apr_hash_make(pool);
- nb->prop_conflicts = apr_hash_make(pool);
- nb->tree_conflicts = apr_hash_make(pool);
- nb->text_conflicts_resolved = 0;
- nb->prop_conflicts_resolved = 0;
- nb->tree_conflicts_resolved = 0;
- nb->skipped_paths = 0;
+ nb->conflict_stats = conflict_stats;
SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
*notify_func_p = notify;
Modified: subversion/branches/1.8.x-r1477876/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svn/resolve-cmd.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svn/resolve-cmd.c Mon May 13 18:18:16 2013
@@ -52,9 +52,6 @@ svn_cl__resolve(apr_getopt_t *os,
int i;
apr_pool_t *iterpool;
svn_boolean_t had_error = FALSE;
- svn_wc_conflict_resolver_func2_t conflict_func2;
- void *conflict_baton2;
- svn_cl__interactive_conflict_baton_t *b;
switch (opt_state->accept_which)
{
@@ -106,21 +103,6 @@ svn_cl__resolve(apr_getopt_t *os,
SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
- /* Store old state */
- conflict_func2 = ctx->conflict_func2;
- conflict_baton2 = ctx->conflict_baton2;
-
- /* This subcommand always uses the interactive resolver function. */
- ctx->conflict_func2 = svn_cl__conflict_func_interactive;
- SVN_ERR(svn_cl__get_conflict_func_interactive_baton(&b,
- opt_state->accept_which,
- ctx->config,
- opt_state->editor_cmd,
- ctx->cancel_func,
- ctx->cancel_baton,
- scratch_pool));
- ctx->conflict_baton2 = b;
-
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -140,10 +122,6 @@ svn_cl__resolve(apr_getopt_t *os,
}
svn_pool_destroy(iterpool);
- /* Restore state */
- ctx->conflict_func2 = conflict_func2;
- ctx->conflict_baton2 = conflict_baton2;
-
if (had_error)
return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
_("Failure occurred resolving one or more "
Modified: subversion/branches/1.8.x-r1477876/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svn/svn.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svn/svn.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svn/svn.c Mon May 13 18:18:16 2013
@@ -1729,6 +1729,8 @@ sub_main(int argc, const char *argv[], a
svn_boolean_t descend = TRUE;
svn_boolean_t interactive_conflicts = FALSE;
svn_boolean_t force_interactive = FALSE;
+ svn_cl__conflict_stats_t *conflict_stats
+ = svn_cl__conflict_stats_create(pool);
svn_boolean_t use_notifier = TRUE;
svn_boolean_t reading_file_from_stdin = FALSE;
apr_hash_t *changelists;
@@ -2759,7 +2761,7 @@ sub_main(int argc, const char *argv[], a
if (use_notifier)
{
SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- pool));
+ conflict_stats, pool));
}
/* Set up our cancellation support. */
@@ -2855,7 +2857,7 @@ sub_main(int argc, const char *argv[], a
SVN_INT_ERR(svn_cl__get_conflict_func_interactive_baton(
&b,
opt_state.accept_which,
- ctx->config, opt_state.editor_cmd,
+ ctx->config, opt_state.editor_cmd, conflict_stats,
ctx->cancel_func, ctx->cancel_baton, pool));
ctx->conflict_baton2 = b;
}
Modified: subversion/branches/1.8.x-r1477876/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svnmucc/svnmucc.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svnmucc/svnmucc.c Mon May 13 18:18:16 2013
@@ -952,7 +952,7 @@ usage(apr_pool_t *pool, int exit_val)
" NAME[=VALUE]\n"
" --non-interactive : do no interactive prompting (default is to\n"
" prompt only if standard input is a terminal)\n"
- " --force-interactive : do interactive propmting even if standard\n"
+ " --force-interactive : do interactive prompting even if standard\n"
" input is not a terminal\n"
" --trust-server-cert : accept SSL server certificates from unknown\n"
" certificate authorities without prompting (but\n"
Modified: subversion/branches/1.8.x-r1477876/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svnserve/serve.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svnserve/serve.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svnserve/serve.c Mon May 13 18:18:16 2013
@@ -276,7 +276,8 @@ svn_error_t *load_pwdb_config(server_bat
pwdb_path = svn_dirent_internal_style(pwdb_path, pool);
pwdb_path = svn_dirent_join(server->base, pwdb_path, pool);
- err = svn_config_read2(&server->pwdb, pwdb_path, TRUE, FALSE, pool);
+ err = svn_config_read3(&server->pwdb, pwdb_path, TRUE,
+ FALSE, FALSE, pool);
if (err)
{
log_server_error(err, server, conn, pool);
@@ -3286,9 +3287,10 @@ static svn_error_t *find_repos(const cha
{
b->base = svn_repos_conf_dir(b->repos, pool);
- SVN_ERR(svn_config_read2(&b->cfg, svn_repos_svnserve_conf(b->repos, pool),
+ SVN_ERR(svn_config_read3(&b->cfg, svn_repos_svnserve_conf(b->repos, pool),
FALSE, /* must_exist */
FALSE, /* section_names_case_sensitive */
+ FALSE, /* option_names_case_sensitive */
pool));
SVN_ERR(load_pwdb_config(b, conn, pool));
SVN_ERR(load_authz_config(b, conn, repos_root, pool));
Modified: subversion/branches/1.8.x-r1477876/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/svnserve/svnserve.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/svnserve/svnserve.c Mon May 13 18:18:16 2013
@@ -755,9 +755,10 @@ int main(int argc, const char *argv[])
{
params.base = svn_dirent_dirname(config_filename, pool);
- SVN_INT_ERR(svn_config_read2(¶ms.cfg, config_filename,
+ SVN_INT_ERR(svn_config_read3(¶ms.cfg, config_filename,
TRUE, /* must_exist */
FALSE, /* section_names_case_sensitive */
+ FALSE, /* option_names_case_sensitive */
pool));
}
Modified: subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/cache-test.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/cache-test.c Mon May 13 18:18:16 2013
@@ -155,8 +155,8 @@ test_memcache_basic(const svn_test_opts_
if (opts->config_file)
{
- SVN_ERR(svn_config_read2(&config, opts->config_file,
- TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&config, opts->config_file,
+ TRUE, FALSE, FALSE, pool));
SVN_ERR(svn_cache__make_memcache_from_config(&memcache, config, pool));
}
@@ -223,8 +223,8 @@ test_memcache_long_key(const svn_test_op
if (opts->config_file)
{
- SVN_ERR(svn_config_read2(&config, opts->config_file,
- TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&config, opts->config_file,
+ TRUE, FALSE, FALSE, pool));
SVN_ERR(svn_cache__make_memcache_from_config(&memcache, config, pool));
}
Modified: subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.c Mon May 13 18:18:16 2013
@@ -109,7 +109,7 @@ test_text_retrieval(apr_pool_t *pool)
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
/* Test values retrieved from our ConfigParser instance against
values retrieved using svn_config. */
@@ -160,7 +160,7 @@ test_boolean_retrieval(apr_pool_t *pool)
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
for (i = 0; true_keys[i] != NULL; i++)
{
@@ -220,7 +220,7 @@ test_has_section_case_insensitive(apr_po
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, FALSE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
return fail(pool, "Failed to find section1");
@@ -250,7 +250,7 @@ test_has_section_case_sensitive(apr_pool
SVN_ERR(init_params(pool));
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
- SVN_ERR(svn_config_read2(&cfg, cfg_file, TRUE, TRUE, pool));
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
return fail(pool, "Failed to find section1");
@@ -271,6 +271,48 @@ test_has_section_case_sensitive(apr_pool
}
static svn_error_t *
+test_has_option_case_sensitive(apr_pool_t *pool)
+{
+ svn_config_t *cfg;
+ const char *cfg_file;
+ apr_int64_t value;
+ int i;
+
+ static struct test_dataset {
+ const char *option;
+ apr_int64_t value;
+ } const test_data[] = {
+ { "a", 1 },
+ { "A", 2 },
+ { "B", 3 },
+ { "b", 4 }
+ };
+ static const int test_data_size = sizeof(test_data)/sizeof(*test_data);
+
+ if (!srcdir)
+ SVN_ERR(init_params(pool));
+
+ cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
+ SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, TRUE, pool));
+
+ for (i = 0; i < test_data_size; ++i)
+ {
+ SVN_ERR(svn_config_get_int64(cfg, &value, "case-sensitive-option",
+ test_data[i].option, -1));
+ if (test_data[i].value != value)
+ return fail(pool,
+ apr_psprintf(pool,
+ "case-sensitive-option.%s != %"
+ APR_INT64_T_FMT" but %"APR_INT64_T_FMT,
+ test_data[i].option,
+ test_data[i].value,
+ value));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
test_stream_interface(apr_pool_t *pool)
{
svn_config_t *cfg;
@@ -283,7 +325,7 @@ test_stream_interface(apr_pool_t *pool)
cfg_file = apr_pstrcat(pool, srcdir, "/", "config-test.cfg", (char *)NULL);
SVN_ERR(svn_stream_open_readonly(&stream, cfg_file, pool, pool));
- SVN_ERR(svn_config_parse(&cfg, stream, TRUE, pool));
+ SVN_ERR(svn_config_parse(&cfg, stream, TRUE, TRUE, pool));
/* nominal test to make sure cfg is populated with something since
* svn_config_parse will happily return an empty cfg if the stream is
@@ -313,6 +355,8 @@ struct svn_test_descriptor_t test_funcs[
"test svn_config_has_section (case insensitive)"),
SVN_TEST_PASS2(test_has_section_case_sensitive,
"test svn_config_has_section (case sensitive)"),
+ SVN_TEST_PASS2(test_has_option_case_sensitive,
+ "test case-sensitive option name lookup"),
SVN_TEST_PASS2(test_stream_interface,
"test svn_config_parse"),
SVN_TEST_NULL
Modified: subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.cfg
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.cfg?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.cfg (original)
+++ subversion/branches/1.8.x-r1477876/subversion/tests/libsvn_subr/config-test.cfg Mon May 13 18:18:16 2013
@@ -55,3 +55,9 @@ false2 = no
false3 = oFf
false4 = 0
bad_false = nyet!
+
+[case-sensitive-option]
+a = 1
+A = 2
+B = 3
+b = 4
Modified: subversion/branches/1.8.x-r1477876/tools/server-side/mod_dontdothat/mod_dontdothat.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1477876/tools/server-side/mod_dontdothat/mod_dontdothat.c?rev=1482014&r1=1482013&r2=1482014&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1477876/tools/server-side/mod_dontdothat/mod_dontdothat.c (original)
+++ subversion/branches/1.8.x-r1477876/tools/server-side/mod_dontdothat/mod_dontdothat.c Mon May 13 18:18:16 2013
@@ -584,7 +584,8 @@ dontdothat_insert_filters(request_rec *r
/* XXX is there a way to error out from this point? Would be nice... */
- err = svn_config_read2(&config, cfg->config_file, TRUE, FALSE, r->pool);
+ err = svn_config_read3(&config, cfg->config_file, TRUE,
+ FALSE, TRUE, r->pool);
if (err)
{
char buff[256];