You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by vm...@apache.org on 2012/12/23 07:03:17 UTC
svn commit: r1425415 [12/13] - in /subversion/branches/javahl-ra: ./
build/generator/templates/ notes/ notes/directory-index/
subversion/bindings/swig/python/svn/ subversion/bindings/swig/ruby/test/
subversion/include/ subversion/include/private/ subve...
Modified: subversion/branches/javahl-ra/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/cl.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/cl.h (original)
+++ subversion/branches/javahl-ra/subversion/svn/cl.h Sun Dec 23 06:03:14 2012
@@ -239,6 +239,9 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
const char *search_pattern; /* pattern argument for --search */
svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+
+ svn_wc_conflict_resolver_func2_t conflict_func;
+ void *conflict_baton;
} svn_cl__opt_state_t;
@@ -573,6 +576,18 @@ svn_cl__merge_file_externally(const char
svn_boolean_t *remains_in_conflict,
apr_pool_t *pool);
+/* Like svn_cl__merge_file_externally, but using a built-in merge tool
+ * with help from an external editor specified by EDITOR_CMD. */
+svn_error_t *
+svn_cl__merge_file(const char *base_path,
+ const char *their_path,
+ const char *my_path,
+ const char *merged_path,
+ const char *wc_path,
+ const char *editor_cmd,
+ apr_hash_t *config,
+ svn_boolean_t *remains_in_conflict,
+ apr_pool_t *scratch_pool);
/*** Notification functions to display results on the terminal. */
@@ -603,6 +618,14 @@ svn_cl__notifier_mark_export(void *baton
svn_error_t *
svn_cl__notifier_mark_wc_to_repos_copy(void *baton);
+/* Return TRUE if any conflicts were detected during notification. */
+svn_boolean_t
+svn_cl__notifier_check_conflicts(void *baton);
+
+/* Return a sorted array of conflicted paths detected during notification. */
+apr_array_header_t *
+svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool);
+
/* Baton for use with svn_cl__check_externals_failed_notify_wrapper(). */
struct svn_cl__check_externals_failed_notify_baton
{
@@ -850,6 +873,15 @@ svn_cl__check_related_source_and_target(
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* Run the conflict resolver for all targets in the TARGETS list with
+ * the specified DEPTH. */
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c Sun Dec 23 06:03:14 2012
@@ -191,15 +191,19 @@ open_editor(svn_boolean_t *performed_edi
b->config, pool);
if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("No editor found.")));
svn_error_clear(err);
}
else if (err && (err->apr_err == SVN_ERR_EXTERNAL_PROGRAM))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("Error running editor.")));
svn_error_clear(err);
}
@@ -241,14 +245,16 @@ launch_resolver(svn_boolean_t *performed
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
err->message ? err->message :
- _("No merge tool found.\n")));
+ _("No merge tool found, "
+ "try '(m) merge' instead.\n")));
svn_error_clear(err);
}
else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
err->message ? err->message :
- _("Error running merge tool.")));
+ _("Error running merge tool, "
+ "try '(m) merge' instead.")));
svn_error_clear(err);
}
else if (err)
@@ -482,7 +488,7 @@ svn_cl__conflict_handler(svn_wc_conflict
if (diff_allowed)
{
prompt = apr_pstrcat(subpool, prompt,
- _(", (df) diff-full, (e) edit"),
+ _(", (df) diff-full, (e) edit, (m) merge"),
(char *)NULL);
if (knows_something)
@@ -538,6 +544,8 @@ svn_cl__conflict_handler(svn_wc_conflict
"\n"
" (p) postpone - mark the conflict to be "
"resolved later\n"
+ " (m) merge - use internal merge tool to "
+ "resolve conflict\n"
" (l) launch - launch external tool to "
"resolve conflict\n"
" (s) show all - show this list\n\n")));
@@ -657,6 +665,38 @@ svn_cl__conflict_handler(svn_wc_conflict
if (performed_edit)
knows_something = TRUE;
}
+ else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-M") == 0)
+ {
+ if (desc->kind != svn_wc_conflict_kind_text)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option; can only "
+ "resolve text conflicts with "
+ "the internal merge tool."
+ "\n\n")));
+ continue;
+ }
+
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
+ {
+ svn_boolean_t remains_in_conflict;
+
+ SVN_ERR(svn_cl__merge_file(desc->base_abspath,
+ desc->their_abspath,
+ desc->my_abspath,
+ desc->merged_file,
+ desc->local_abspath,
+ b->editor_cmd,
+ b->config,
+ &remains_in_conflict,
+ subpool));
+ knows_something = !remains_in_conflict;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option.\n\n")));
+ }
else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
{
if (desc->kind == svn_wc_conflict_kind_property)
@@ -814,3 +854,57 @@ svn_cl__conflict_handler(svn_wc_conflict
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ int i;
+ apr_pool_t *iterpool;
+
+ iterpool = svn_pool_create(scratch_pool);
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+ svn_error_t *err = SVN_NO_ERROR;
+ const char *local_abspath;
+ svn_wc_conflict_resolver_func2_t conflict_func2;
+ void *conflict_baton2;
+
+ svn_pool_clear(iterpool);
+
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+
+
+ /* Store old state */
+ conflict_func2 = ctx->conflict_func2;
+ conflict_baton2 = ctx->conflict_baton2;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
+ err = svn_client_resolve(local_abspath, depth,
+ svn_wc_conflict_choose_unspecified,
+ ctx, iterpool);
+
+ /* Restore state */
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+
+ if (err)
+ {
+ if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
+ && (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ }
+ }
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/javahl-ra/subversion/svn/export-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/export-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/export-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/export-cmd.c Sun Dec 23 06:03:14 2012
@@ -114,9 +114,15 @@ svn_cl__export(apr_getopt_t *os,
"the directory or use --force to overwrite"));
if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ {
+ svn_error_t *externals_err;
+
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+ return svn_error_compose_create(externals_err, err);
+ }
return svn_error_trace(err);
}
Modified: subversion/branches/javahl-ra/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/log-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/log-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/log-cmd.c Sun Dec 23 06:03:14 2012
@@ -123,7 +123,7 @@ display_diff(const svn_log_entry_t *log_
end_revision.kind = svn_opt_revision_number;
end_revision.value.number = log_entry->revision;
- SVN_ERR(svn_stream_puts(outstream, _("\n")));
+ SVN_ERR(svn_stream_puts(outstream, "\n"));
SVN_ERR(svn_client_diff_peg6(diff_options,
target_path_or_url,
target_peg_revision,
Modified: subversion/branches/javahl-ra/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/main.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/main.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/main.c Sun Dec 23 06:03:14 2012
@@ -2712,6 +2712,13 @@ main(int argc, const char *argv[])
we can change this. */
svn_handle_error2(err, stderr, TRUE, "svn: ");
+ /* The new svn behavior is to postpone everything until after the operation
+ completed */
+ ctx->conflict_func = NULL;
+ ctx->conflict_baton = NULL;
+ ctx->conflict_func2 = NULL;
+ ctx->conflict_baton2 = NULL;
+
if ((opt_state.accept_which == svn_cl__accept_unspecified
&& (!interactive_conflicts || opt_state.non_interactive))
|| opt_state.accept_which == svn_cl__accept_postpone)
@@ -2719,10 +2726,8 @@ main(int argc, const char *argv[])
/* If no --accept option at all and we're non-interactive, we're
leaving the conflicts behind, so don't need the callback. Same if
the user said to postpone. */
- ctx->conflict_func = NULL;
- ctx->conflict_baton = NULL;
- ctx->conflict_func2 = NULL;
- ctx->conflict_baton2 = NULL;
+ opt_state.conflict_func = NULL;
+ opt_state.conflict_baton = NULL;
}
else
{
@@ -2748,16 +2753,14 @@ main(int argc, const char *argv[])
pool, "svn: ");
}
- ctx->conflict_func = NULL;
- ctx->conflict_baton = NULL;
- ctx->conflict_func2 = svn_cl__conflict_handler;
+ opt_state.conflict_func = svn_cl__conflict_handler;
SVN_INT_ERR(svn_cl__conflict_baton_make(&conflict_baton2,
opt_state.accept_which,
ctx->config,
opt_state.editor_cmd,
pb,
pool));
- ctx->conflict_baton2 = conflict_baton2;
+ opt_state.conflict_baton = conflict_baton2;
}
/* And now we finally run the subcommand. */
Modified: subversion/branches/javahl-ra/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/merge-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/merge-cmd.c Sun Dec 23 06:03:14 2012
@@ -152,7 +152,8 @@ svn_cl__merge(apr_getopt_t *os,
apr_array_header_t *targets;
const char *sourcepath1 = NULL, *sourcepath2 = NULL, *targetpath = "";
svn_boolean_t two_sources_specified = TRUE;
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *merge_err = SVN_NO_ERROR;
svn_opt_revision_t first_range_start, first_range_end, peg_revision1,
peg_revision2;
apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
@@ -390,6 +391,9 @@ svn_cl__merge(apr_getopt_t *os,
"with --reintegrate"));
}
+ /* Postpone conflict resolution during the merge operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
#ifdef SVN_WITH_SYMMETRIC_MERGE
if (opt_state->symmetric_merge)
{
@@ -409,16 +413,16 @@ svn_cl__merge(apr_getopt_t *os,
ctx, pool),
_("Source and target must be different but related branches"));
- err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- allow_local_mods,
- allow_switched_subtrees,
- options, ctx, pool);
+ merge_err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ allow_local_mods,
+ allow_switched_subtrees,
+ options, ctx, pool);
}
else
#endif
@@ -429,8 +433,8 @@ svn_cl__merge(apr_getopt_t *os,
ctx, pool),
_("Source and target must be different but related branches"));
- err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
- opt_state->dry_run, options, ctx, pool);
+ merge_err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
+ opt_state->dry_run, options, ctx, pool);
}
else if (! two_sources_specified)
{
@@ -454,19 +458,19 @@ svn_cl__merge(apr_getopt_t *os,
_("Source and target must be different but related branches"));
}
- err = svn_client_merge_peg4(sourcepath1,
- ranges_to_merge,
- &peg_revision1,
- targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- options,
- ctx,
- pool);
+ merge_err = svn_client_merge_peg4(sourcepath1,
+ ranges_to_merge,
+ &peg_revision1,
+ targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ options,
+ ctx,
+ pool);
}
else
{
@@ -474,36 +478,47 @@ svn_cl__merge(apr_getopt_t *os,
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Merge sources must both be "
"either paths or URLs"));
- err = svn_client_merge4(sourcepath1,
- &first_range_start,
- sourcepath2,
- &first_range_end,
- targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- options,
- ctx,
- pool);
+ merge_err = svn_client_merge4(sourcepath1,
+ &first_range_start,
+ sourcepath2,
+ &first_range_end,
+ targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ options,
+ ctx,
+ pool);
}
if (! opt_state->quiet)
- SVN_ERR(svn_cl__print_conflict_stats(ctx->notify_baton2, pool));
+ err = svn_cl__print_conflict_stats(ctx->notify_baton2, pool);
+
+ if (!err
+ && opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(ctx->notify_baton2))
+ {
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(ctx->notify_baton2, pool),
+ opt_state->depth, opt_state, ctx, pool);
+ }
- if (err)
+ if (merge_err)
{
- if(err->apr_err == SVN_ERR_CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING)
+ if (merge_err->apr_err ==
+ SVN_ERR_CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING)
{
err = svn_error_quick_wrap(
- err,
+ svn_error_compose_create(merge_err, err),
_("Merge tracking not possible, use --ignore-ancestry or\n"
"fix invalid mergeinfo in target with 'svn propset'"));
}
- else if (! opt_state->reintegrate)
+ else
{
+ err = svn_error_compose_create(merge_err, err);
return svn_cl__may_need_force(err);
}
}
Modified: subversion/branches/javahl-ra/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/notify.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/notify.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/notify.c Sun Dec 23 06:03:14 2012
@@ -35,6 +35,7 @@
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
+#include "svn_sorts.h"
#include "cl.h"
#include "svn_private_config.h"
@@ -57,6 +58,7 @@ struct notify_baton
unsigned int prop_conflicts;
unsigned int tree_conflicts;
unsigned int skipped_paths;
+ apr_hash_t *conflicted_paths;
/* The cwd, for use in decomposing absolute paths. */
const char *path_prefix;
@@ -100,6 +102,16 @@ svn_cl__print_conflict_stats(void *notif
return SVN_NO_ERROR;
}
+/* Add a conflicted path to the list of conflicted paths stored
+ * in the notify baton. */
+static void
+add_conflicted_path(struct notify_baton *nb, const char *path)
+{
+ apr_hash_set(nb->conflicted_paths,
+ apr_pstrdup(apr_hash_pool_get(nb->conflicted_paths), path),
+ APR_HASH_KEY_STRING, "");
+}
+
/* This implements `svn_wc_notify_func2_t'.
* NOTE: This function can't fail, so we just ignore any print errors. */
static void
@@ -213,6 +225,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
goto print_error;
}
@@ -228,6 +241,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else
@@ -236,6 +250,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -302,6 +317,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -315,6 +331,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_changed)
@@ -508,6 +525,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -521,6 +539,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -898,6 +917,7 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_tree_conflict:
nb->tree_conflicts++;
+ add_conflicted_path(nb, n->path);
if ((err = svn_cmdline_printf(pool, " C %s\n", path_local)))
goto print_error;
break;
@@ -1038,6 +1058,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->prop_conflicts = 0;
nb->tree_conflicts = 0;
nb->skipped_paths = 0;
+ nb->conflicted_paths = apr_hash_make(pool);
SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
*notify_func_p = notify;
@@ -1086,3 +1107,35 @@ svn_cl__check_externals_failed_notify_wr
nwb->wrapped_func(nwb->wrapped_baton, n, pool);
}
+svn_boolean_t
+svn_cl__notifier_check_conflicts(void *baton)
+{
+ struct notify_baton *nb = baton;
+
+ return (nb->text_conflicts || nb->prop_conflicts || nb->tree_conflicts);
+}
+
+apr_array_header_t *
+svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool)
+{
+ struct notify_baton *nb = baton;
+ apr_array_header_t *sorted_array;
+ apr_array_header_t *result_array;
+ int i;
+
+ sorted_array = svn_sort__hash(nb->conflicted_paths,
+ svn_sort_compare_items_as_paths,
+ apr_hash_pool_get(nb->conflicted_paths));
+ result_array = apr_array_make(result_pool, sorted_array->nelts,
+ sizeof(const char *));
+ for (i = 0; i < sorted_array->nelts; i++)
+ {
+ svn_sort__item_t item;
+
+ item = APR_ARRAY_IDX(sorted_array, i, svn_sort__item_t);
+ APR_ARRAY_PUSH(result_array, const char *) = apr_pstrdup(result_pool,
+ item.key);
+ }
+
+ return result_array;
+}
Modified: subversion/branches/javahl-ra/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/resolve-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/resolve-cmd.c Sun Dec 23 06:03:14 2012
@@ -55,6 +55,8 @@ 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;
switch (opt_state->accept_which)
{
@@ -77,7 +79,7 @@ svn_cl__resolve(apr_getopt_t *os,
conflict_choice = svn_wc_conflict_choose_mine_full;
break;
case svn_cl__accept_unspecified:
- if (ctx->conflict_func2 == NULL)
+ if (opt_state->conflict_func == NULL)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("missing --accept option"));
conflict_choice = svn_wc_conflict_choose_unspecified;
@@ -106,6 +108,14 @@ 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;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -125,6 +135,10 @@ 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/javahl-ra/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/switch-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/switch-cmd.c Sun Dec 23 06:03:14 2012
@@ -93,7 +93,8 @@ svn_cl__switch(apr_getopt_t *os,
void *baton,
apr_pool_t *scratch_pool)
{
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
@@ -156,6 +157,9 @@ svn_cl__switch(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the switch operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
/* Do the 'switch' update. */
err = svn_client_switch3(NULL, target, switch_url, &peg_revision,
&(opt_state->start_revision), depth,
@@ -175,13 +179,29 @@ svn_cl__switch(apr_getopt_t *os,
return err;
}
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ {
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/javahl-ra/subversion/svn/update-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/update-cmd.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/update-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/update-cmd.c Sun Dec 23 06:03:14 2012
@@ -110,6 +110,10 @@ svn_cl__update(apr_getopt_t *os,
svn_boolean_t depth_is_sticky;
struct svn_cl__check_externals_failed_notify_baton nwb;
apr_array_header_t *result_revs;
+ svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
+ void *conflict_baton2 = ctx->conflict_baton2;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -154,6 +158,9 @@ svn_cl__update(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the update operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
SVN_ERR(svn_client_update4(&result_revs, targets,
&(opt_state->start_revision),
depth, depth_is_sticky,
@@ -162,20 +169,38 @@ svn_cl__update(apr_getopt_t *os,
opt_state->parents,
ctx, scratch_pool));
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
{
- SVN_ERR(print_update_summary(targets, result_revs, scratch_pool));
+ err = print_update_summary(targets, result_revs, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
/* ### Layering problem: This call assumes that the baton we're
* passing is the one that was originally provided by
* svn_cl__get_notifier(), but that isn't promised. */
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
}
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/javahl-ra/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svnadmin/main.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svnadmin/main.c (original)
+++ subversion/branches/javahl-ra/subversion/svnadmin/main.c Sun Dec 23 06:03:14 2012
@@ -191,7 +191,8 @@ enum svnadmin__cmdline_options_t
svnadmin__wait,
svnadmin__pre_1_4_compatible,
svnadmin__pre_1_5_compatible,
- svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
};
/* Option codes and descriptions.
@@ -280,6 +281,10 @@ static const apr_getopt_option_t options
N_("use format compatible with Subversion versions\n"
" earlier than 1.6")},
+ {"pre-1.8-compatible", svnadmin__pre_1_8_compatible, 0,
+ N_("use format compatible with Subversion versions\n"
+ " earlier than 1.8")},
+
{"memory-cache-size", 'M', 1,
N_("size of the extra in-memory cache in MB used to\n"
" minimize redundant operations. Default: 16.\n"
@@ -305,7 +310,8 @@ static const svn_opt_subcommand_desc2_t
"Create a new, empty repository at REPOS_PATH.\n"),
{svnadmin__bdb_txn_nosync, svnadmin__bdb_log_keep,
svnadmin__config_dir, svnadmin__fs_type, svnadmin__pre_1_4_compatible,
- svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
} },
{"deltify", subcommand_deltify, {0}, N_
@@ -475,6 +481,7 @@ struct svnadmin_opt_state
svn_boolean_t pre_1_4_compatible; /* --pre-1.4-compatible */
svn_boolean_t pre_1_5_compatible; /* --pre-1.5-compatible */
svn_boolean_t pre_1_6_compatible; /* --pre-1.6-compatible */
+ svn_boolean_t pre_1_8_compatible; /* --pre-1.8-compatible */
svn_opt_revision_t start_revision, end_revision; /* -r X[:Y] */
svn_boolean_t help; /* --help or -? */
svn_boolean_t version; /* --version */
@@ -625,6 +632,11 @@ subcommand_create(apr_getopt_t *os, void
APR_HASH_KEY_STRING,
"1");
+ if (opt_state->pre_1_8_compatible)
+ apr_hash_set(fs_config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE,
+ APR_HASH_KEY_STRING,
+ "1");
+
SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
NULL, NULL, NULL, fs_config, pool));
svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
@@ -1896,6 +1908,9 @@ main(int argc, const char *argv[])
case svnadmin__pre_1_6_compatible:
opt_state.pre_1_6_compatible = TRUE;
break;
+ case svnadmin__pre_1_8_compatible:
+ opt_state.pre_1_8_compatible = TRUE;
+ break;
case svnadmin__fs_type:
err = svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool);
if (err)
Modified: subversion/branches/javahl-ra/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svnlook/main.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svnlook/main.c (original)
+++ subversion/branches/javahl-ra/subversion/svnlook/main.c Sun Dec 23 06:03:14 2012
@@ -1282,6 +1282,30 @@ print_tree(svn_fs_root_t *root,
}
+/* Set *BASE_REV to the revision on which the target root specified in
+ C is based, or to SVN_INVALID_REVNUM when C represents "revision
+ 0" (because that revision isn't based on another revision). */
+static svn_error_t *
+get_base_rev(svn_revnum_t *base_rev, svnlook_ctxt_t *c, apr_pool_t *pool)
+{
+ if (c->is_revision)
+ {
+ *base_rev = c->rev_id - 1;
+ }
+ else
+ {
+ *base_rev = svn_fs_txn_base_revision(c->txn);
+
+ if (! SVN_IS_VALID_REVNUM(*base_rev))
+ return svn_error_createf
+ (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+ _("Transaction '%s' is not based on a revision; how odd"),
+ c->txn_name);
+ }
+ return SVN_NO_ERROR;
+}
+
+
/*** Subcommand handlers. ***/
@@ -1388,16 +1412,9 @@ do_dirs_changed(svnlook_ctxt_t *c, apr_p
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
@@ -1493,16 +1510,9 @@ do_changed(svnlook_ctxt_t *c, apr_pool_t
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
@@ -1521,16 +1531,9 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
svn_repos_node_t *tree;
SVN_ERR(get_root(&root, c, pool));
- if (c->is_revision)
- base_rev_id = c->rev_id - 1;
- else
- base_rev_id = svn_fs_txn_base_revision(c->txn);
-
- if (! SVN_IS_VALID_REVNUM(base_rev_id))
- return svn_error_createf
- (SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("Transaction '%s' is not based on a revision; how odd"),
- c->txn_name);
+ SVN_ERR(get_base_rev(&base_rev_id, c, pool));
+ if (base_rev_id == SVN_INVALID_REVNUM)
+ return SVN_NO_ERROR;
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py Sun Dec 23 06:03:14 2012
@@ -2983,6 +2983,7 @@ def delete_conflicts_one_of_many(sbox):
verify_file_deleted("failed to remove conflict file",
sbox.ospath('A/D/G/rho.mine'))
+
########################################################################
# Run the tests
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py Sun Dec 23 06:03:14 2012
@@ -2915,7 +2915,33 @@ def commit_danglers(sbox):
expected_error,
wc_dir, '--cl', 'L')
-
+#----------------------------------------------------------------------
+# Test for issue 4203: Commit of moved dir with modified file in
+# dir/subdir should bump LastChangedRev of subdir in originating WC
+@XFail()
+@Issue(4203)
+def commit_moved_dir_with_nested_mod_in_subdir(sbox):
+ "commit of moved dir with nested mod in subdir"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_move('A/B','A/B_copied')
+
+ B_copied = sbox.ospath('A/B_copied')
+ E_copied = sbox.ospath('A/B_copied/E')
+ alpha_copied = sbox.ospath('A/B_copied/E/alpha')
+
+ svntest.main.file_write(alpha_copied, "xxxx")
+
+ svntest.main.run_svn(None, 'commit', wc_dir, '-mm')
+
+ expected = {'Revision' : '2',
+ 'Last Changed Rev' : '2',
+ }
+ svntest.actions.run_and_verify_info([expected], E_copied)
+
+
########################################################################
# Run the tests
@@ -2986,6 +3012,7 @@ test_list = [ None,
commit_incomplete,
commit_add_subadd,
commit_danglers,
+ commit_moved_dir_with_nested_mod_in_subdir,
]
if __name__ == '__main__':
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py Sun Dec 23 06:03:14 2012
@@ -5694,6 +5694,54 @@ def copy_to_unversioned_parent(sbox):
sbox.ospath('A/B'),
sbox.ospath('Unversioned/B2'))
+def copy_text_conflict(sbox):
+ "copy with a text conflict should not copy markers"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ mu_path = sbox.ospath('A/mu')
+ svntest.main.file_append(mu_path, 'appended mu text')
+
+ sbox.simple_commit()
+ svntest.main.file_append(mu_path, 'appended mu text')
+
+ sbox.simple_update(revision='1')
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+ sbox.ospath('A'),
+ sbox.ospath('A_copied'))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='C ')
+ expected_status.add({
+ # The markers in A
+ 'A/mu.mine' : Item(status='? '),
+ 'A/mu.r1' : Item(status='? '),
+ 'A/mu.r2' : Item(status='? '),
+ # And what is copied (without markers)
+ 'A_copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A_copied/C' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E/alpha': Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/omega': Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/gamma' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/mu' : Item(status='M ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
########################################################################
# Run the tests
@@ -5809,6 +5857,7 @@ test_list = [ None,
wc_wc_copy_incomplete,
three_nested_moves,
copy_to_unversioned_parent,
+ copy_text_conflict,
]
if __name__ == '__main__':
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh Sun Dec 23 06:03:14 2012
@@ -219,13 +219,18 @@ fi
[ -r "$MOD_AUTHZ_SVN" ] \
|| fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
-LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
-export LD_LIBRARY_PATH
+BUILDDIR_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs"
case "`uname`" in
- Darwin*) LDD='otool -L'
+ Darwin*)
+ LDD='otool -L'
+ DYLD_LIBRARY_PATH="$BUILDDIR_LIBRARY_PATH:$DYLD_LIBRARY_PATH"
+ export DYLD_LIBRARY_PATH
;;
- *) LDD='ldd'
+ *)
+ LDD='ldd'
+ LD_LIBRARY_PATH="$BUILDDIR_LIBRARY_PATH:$LD_LIBRARY_PATH"
+ export LD_LIBRARY_PATH
;;
esac
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py Sun Dec 23 06:03:14 2012
@@ -2881,7 +2881,29 @@ def commit_then_immediates_update(sbox):
expected_status,
None, None, None, None, None, False,
"--depth=immediates", wc_dir)
+
+def revert_depth_files(sbox):
+ "depth immediate+files should revert deleted files"
+
+ sbox.build(read_only = True)
+
+ expected_output = "Reverted '" + re.escape(sbox.ospath('A/mu')) + "'"
+ # Apply an unrelated delete one level to deep
+ sbox.simple_rm('A/D/gamma')
+
+ sbox.simple_rm('A/mu')
+ # Expect reversion of just 'mu'
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'revert', '--depth=immediates', sbox.ospath('A'))
+
+ # Apply an unrelated directory delete
+ sbox.simple_rm('A/D')
+
+ sbox.simple_rm('A/mu')
+ # Expect reversion of just 'mu'
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'revert', '--depth=files', sbox.ospath('A'))
#----------------------------------------------------------------------
@@ -2932,6 +2954,7 @@ test_list = [ None,
sparse_update_with_dash_dash_parents,
update_below_depth_empty,
commit_then_immediates_update,
+ revert_depth_files,
]
if __name__ == "__main__":
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/merge_reintegrate_tests.py Sun Dec 23 06:03:14 2012
@@ -1002,18 +1002,18 @@ def reintegrate_with_subtree_mergeinfo(s
# reflects that the same revisions have been applied across all of A_COPY,
# then the reintegrate merge should succeed. We'll try that case first.
#
- # A_COPY_3 4--------9---
+ # A_COPY_3 4-------[9]--
# / \
- # / \c.
+ # / \
# A -1--------5-6-7-8---10-------------------WC--
- # \ \ (D) \ /r.
- # \ \ (mu) \s. /
+ # \ \ (D) \ /reint.
+ # \ \ (mu) \ /
# A_COPY 2-\--------------------12---13--14------
- # \ /c.
+ # \ /
# \ /
- # A_COPY_2 3--------------11---
+ # A_COPY_2 3-------------[11]--
#
- # Key: c. = cherry-pick, s. = sync, r. = reintegrate.
+ # Key: [#] = cherry-picked revision; (foo) = merge of subtree 'foo'
# Note: These diagrams show an overview and do not capture every detail.
# r9 - Make a text change to A_COPY_3/D/gamma
@@ -1189,16 +1189,16 @@ def reintegrate_with_subtree_mergeinfo(s
# merge should fail, but should provide a helpful message as to where the
# problems are.
#
- # A_COPY_3 4--------9---
+ # A_COPY_3 4-------[9]--
# / \
- # / \c. [-8]___
+ # / \ [-8]___
# A -1---------5-6-7-8---10----------------\-------WC--
- # \ \ (D) \ \ /r.
- # \ \ (mu) \s. \c. /
+ # \ \ (D) \ \ /reint.
+ # \ \ (mu) \ \ /
# A_COPY 2-\--------------------12---13--14--15--------
- # \ /c. (D)
+ # \ / (D)
# \ /
- # A_COPY_2 3--------------11---
+ # A_COPY_2 3-------------[11]--
# First revert the previous reintegrate merge
svntest.actions.run_and_verify_svn(None, None, [],
@@ -1269,16 +1269,16 @@ def reintegrate_with_subtree_mergeinfo(s
# of 'trunk' was previously merged to 'branch'
#
# Step: A B C D E
- # A_COPY_3 ----9---
+ # A_COPY_3 ---[9]--
# / \ (D/g.->
- # / \c. [-8]___ D/g.m.) (D/g.m.)
+ # / \ [-8]___ D/g.m.) (D/g.m.)
# A ------------10----------------\------16-------18--------WC
- # \\ (D) \ \ \ \ /r.
- # \\ (mu) \s. \c. \s. \s. /
+ # \\ (D) \ \ \ \ /reint.
+ # \\ (mu) \ \ \ \ /
# A_COPY -\--------------12---13--14--15-------17-------19------
- # \ /c. (D)
+ # \ / (D)
# \ /
- # A_COPY_2 ---------11---
+ # A_COPY_2 --------[11]--
# r16 - A) REPOS-to-REPOS rename of A/D/gamma to A/D/gamma_moved. Since
# r874258 WC-to-WC moves won't create mergeinfo on the dest if the source
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tests.py Sun Dec 23 06:03:14 2012
@@ -50,7 +50,8 @@ from svntest.actions import inject_confl
def expected_merge_output(rev_ranges, additional_lines=None, foreign=False,
elides=False, two_url=False, target=None,
- text_conflicts=0, prop_conflicts=0, tree_conflicts=0):
+ text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
+ resolved=[]):
"""Generate an (inefficient) regex representing the expected merge
output and mergeinfo notifications from REV_RANGES and ADDITIONAL_LINES.
@@ -72,7 +73,10 @@ def expected_merge_output(rev_ranges, ad
notifications; if None, it is not checked.
TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
- each kind of conflict to expect."""
+ each kind of conflict to expect.
+
+ RESOLVED contains a list of target paths of which conflicts are resolved
+ during merging"""
if rev_ranges is None:
lines = [svntest.main.merge_notify_line(None, None, False, foreign)]
@@ -111,6 +115,9 @@ def expected_merge_output(rev_ranges, ad
additional_lines = additional_lines.replace("\\", "\\\\")
lines.append(str(additional_lines))
+ for rslv in resolved:
+ lines.append("Resolved conflicted state of '%s'" % re.escape(rslv))
+
if text_conflicts or prop_conflicts or tree_conflicts:
lines.append("Summary of conflicts:\n")
if text_conflicts:
@@ -12532,7 +12539,8 @@ def svn_copy(s_rev, path1, path2):
'-r', s_rev, path1, path2)
def svn_merge(rev_range, source, target, lines=None, elides=[],
- text_conflicts=0, prop_conflicts=0, tree_conflicts=0, args=[]):
+ text_conflicts=0, prop_conflicts=0, tree_conflicts=0, args=[],
+ resolved=[]):
"""Merge a single change from path SOURCE to path TARGET and verify the
output and that there is no error. (The changes made are not verified.)
@@ -12547,7 +12555,10 @@ def svn_merge(rev_range, source, target,
TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
each kind of conflict to expect.
- ARGS are additional arguments passed to svn merge."""
+ ARGS are additional arguments passed to svn merge.
+
+ RESOLVED contains a list of targets of which conflicts are resolved
+ during merging"""
source = local_path(source)
target = local_path(target)
@@ -12568,7 +12579,8 @@ def svn_merge(rev_range, source, target,
elides=elides,
text_conflicts=text_conflicts,
prop_conflicts=prop_conflicts,
- tree_conflicts=tree_conflicts)
+ tree_conflicts=tree_conflicts,
+ resolved=resolved)
svntest.actions.run_and_verify_svn(None, exp_out, [],
'merge', rev_arg, source, target, *args)
@@ -13110,7 +13122,10 @@ def merge_two_edits_to_same_prop(sbox):
# Merge the first change, then the second, to source.
svn_merge(rev3, A_COPY_path, A_path, [
" C %s\n" % mu_path,
- ], prop_conflicts=1, args=['--allow-mixed-revisions'])
+ ], prop_conflicts=1,
+ args=['--allow-mixed-revisions',
+ '--accept=theirs-conflict'],
+ resolved=[mu_path])
svn_merge(rev4, A_COPY_path, A_path, [
" C %s\n" % mu_path,
], prop_conflicts=1, args=['--allow-mixed-revisions'])
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/merge_tree_conflict_tests.py Sun Dec 23 06:03:14 2012
@@ -1738,8 +1738,7 @@ def merge_replace_causes_tree_conflict(s
expected_status.tweak('A', status=' M')
expected_status.tweak('A/D/G/pi', 'A/mu', status='M ', treeconflict='C')
expected_status.tweak('A/D/H', status=' M', treeconflict='C')
- ### A/B/E gets both a property and tree conflict flagged. Is this OK?
- expected_status.tweak('A/B/E', status=' C', treeconflict='C')
+ expected_status.tweak('A/B/E', status=' M', treeconflict='C')
actions.run_and_verify_status(wc_dir, expected_status)
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/special_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/special_tests.py Sun Dec 23 06:03:14 2012
@@ -948,6 +948,32 @@ def replace_symlinks(sbox):
os.chmod(wc(p), 0775)
sbox.simple_add(p)
sbox.simple_commit() # r2
+ sbox.simple_update()
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 2)
+ expected_status.add({
+ 'A/D/Y' : Item(status=' ', wc_rev=2),
+ 'A/D/G/Z' : Item(status=' ', wc_rev=2),
+ 'A/D/G/rho.sh' : Item(status=' ', wc_rev=2),
+ 'A/D/Hx' : Item(status=' ', wc_rev=2),
+ 'A/D/Hx/Z' : Item(status=' ', wc_rev=2),
+ 'A/D/Hx/chi' : Item(status=' ', wc_rev=2),
+ 'A/D/Hx/psi.sh' : Item(status=' ', wc_rev=2),
+ 'A/D/H/psi.sh' : Item(status=' ', wc_rev=2),
+ 'A/D/H/Z' : Item(status=' ', wc_rev=2),
+ 'A/D/Gx' : Item(status=' ', wc_rev=2),
+ 'A/D/Gx/Z' : Item(status=' ', wc_rev=2),
+ 'A/D/Gx/pi' : Item(status=' ', wc_rev=2),
+ 'A/D/Gx/rho.sh' : Item(status=' ', wc_rev=2),
+ 'A/D/gamma.sh' : Item(status=' ', wc_rev=2),
+ 'A/B/E/beta.sh' : Item(status=' ', wc_rev=2),
+ 'Ax' : Item(status=' ', wc_rev=2),
+ 'Ax/mu' : Item(status=' ', wc_rev=2),
+ 'Ax/mu.sh' : Item(status=' ', wc_rev=2),
+ 'A/mu.sh' : Item(status=' ', wc_rev=2),
+ 'iota.sh' : Item(status=' ', wc_rev=2),
+ })
+ expected_status_r2 = expected_status
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
# Failing git-svn test: 'new symlink is added to a file that was
# also just made executable', i.e., in the same revision.
@@ -1011,14 +1037,38 @@ def replace_symlinks(sbox):
### TODO Replace a normal {file, exec, dir, dir} with a symlink to
### {dir, dir, file, exec}. And the same symlink-to-normal.
- ### Commit fails as of r1226697 with either "svn: E145001: Entry
- ### '.../A/D/Gx/Z' has unexpectedly changed special status" or "svn:
- ### E155010: The node '.../Ax/mu' was not found".
+ expected_status.tweak('A/D/G/pi',
+ 'A/D/G/rho.sh',
+ 'A/D/H/psi.sh',
+ 'A/D/H/chi',
+ 'A/mu',
+ 'A/mu.sh',
+ status='RM')
+ expected_status.tweak('A/B/E/beta.sh',
+ 'A/B/E/alpha',
+ status=' M')
+ expected_status.tweak('Ax/mu',
+ 'Ax/mu.sh',
+ status='MM')
+ expected_status.add({
+ 'A/B/E/sym-alpha' : Item(status='A ', wc_rev=0),
+ 'A/B/E/sym-beta.sh' : Item(status='A ', wc_rev=0),
+ })
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
sbox.simple_commit() # r3
+ sbox.simple_update()
+
+ expected_status.tweak(status=' ', wc_rev=3)
+ expected_status_r3 = expected_status
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
- # Try updating from HEAD-1 to HEAD.
+ # Try updating from HEAD-1 to HEAD. This is currently XFAIL as the
+ # update to HEAD-1 produces a tree conflict.
run_svn(None, 'up', '-r2', sbox.wc_dir)
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
sbox.simple_update()
+ svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
@Issue(4102)
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/svnlook_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/svnlook_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/svnlook_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/svnlook_tests.py Sun Dec 23 06:03:14 2012
@@ -643,7 +643,7 @@ svnlook_bin=%s
fp = open(os.path.join(sys.argv[1], 'hooks.log'), 'wb')
def output_command(fp, cmd, opt):
command = [svnlook_bin, cmd, '-t', sys.argv[2], sys.argv[1]] + opt
- process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
+ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, bufsize=-1)
(output, errors) = process.communicate()
status = process.returncode
fp.write(output)
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/main.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/main.py Sun Dec 23 06:03:14 2012
@@ -371,7 +371,7 @@ def _quote_arg(arg):
# Quoting suitable for most Unix shells.
return "'" + arg.replace("'", "'\\''") + "'"
-def open_pipe(command, bufsize=0, stdin=None, stdout=None, stderr=None):
+def open_pipe(command, bufsize=-1, stdin=None, stdout=None, stderr=None):
"""Opens a subprocess.Popen pipe to COMMAND using STDIN,
STDOUT, and STDERR. BUFSIZE is passed to subprocess.Popen's
argument of the same name.
@@ -444,7 +444,7 @@ def wait_on_pipe(waiter, binary_mode, st
logger.info("CMD: %s exited with %d" % (command_string, exit_code))
return stdout_lines, stderr_lines, exit_code
-def spawn_process(command, bufsize=0, binary_mode=0, stdin_lines=None,
+def spawn_process(command, bufsize=-1, binary_mode=0, stdin_lines=None,
*varargs):
"""Run any binary, supplying input text, logging the command line.
BUFSIZE dictates the pipe buffer size used in communication with the
@@ -477,7 +477,7 @@ def spawn_process(command, bufsize=0, bi
return exit_code, stdout_lines, stderr_lines
-def run_command_stdin(command, error_expected, bufsize=0, binary_mode=0,
+def run_command_stdin(command, error_expected, bufsize=-1, binary_mode=0,
stdin_lines=None, *varargs):
"""Run COMMAND with VARARGS; input STDIN_LINES (a list of strings
which should include newline characters) to program via stdin - this
Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py Sun Dec 23 06:03:14 2012
@@ -3916,10 +3916,10 @@ def update_accept_conflicts(sbox):
["Updating '%s':\n" % (mu_path_backup),
'C %s\n' % (mu_path_backup,),
'Updated to revision 2.\n',
- "Resolved conflicted state of '%s'\n"
- % (mu_path_backup),
'Summary of conflicts:\n',
- ' Text conflicts: 1\n'],
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (mu_path_backup)],
[],
'update', '--accept=base',
mu_path_backup)
@@ -3930,10 +3930,10 @@ def update_accept_conflicts(sbox):
["Updating '%s':\n" % (alpha_path_backup),
'C %s\n' % (alpha_path_backup,),
'Updated to revision 2.\n',
- "Resolved conflicted state of '%s'\n"
- % (alpha_path_backup),
'Summary of conflicts:\n',
- ' Text conflicts: 1\n'],
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (alpha_path_backup)],
[],
'update', '--accept=mine-full',
alpha_path_backup)
@@ -3944,10 +3944,10 @@ def update_accept_conflicts(sbox):
["Updating '%s':\n" % (beta_path_backup),
'C %s\n' % (beta_path_backup,),
'Updated to revision 2.\n',
- "Resolved conflicted state of '%s'\n"
- % (beta_path_backup),
'Summary of conflicts:\n',
- ' Text conflicts: 1\n'],
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (beta_path_backup)],
[],
'update', '--accept=theirs-full',
beta_path_backup)
@@ -3960,10 +3960,10 @@ def update_accept_conflicts(sbox):
["Updating '%s':\n" % (pi_path_backup),
'C %s\n' % (pi_path_backup,),
'Updated to revision 2.\n',
- "Resolved conflicted state of '%s'\n"
- % (pi_path_backup),
'Summary of conflicts:\n',
- ' Text conflicts: 1\n'],
+ ' Text conflicts: 1\n',
+ "Resolved conflicted state of '%s'\n"
+ % (pi_path_backup)],
"system(.*) returned.*", 0,
'update', '--accept=edit',
pi_path_backup)
@@ -5520,6 +5520,7 @@ def update_to_HEAD_plus_1(sbox):
None, None,
None, None, None, wc_dir, '-r', '2')
+@XFail()
def update_moved_dir_leaf_del(sbox):
"update locally moved dir with leaf del"
sbox.build()
@@ -5554,6 +5555,7 @@ def update_moved_dir_leaf_del(sbox):
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_edited_leaf_del(sbox):
"update locally moved dir with edited leaf del"
sbox.build()
@@ -5592,6 +5594,7 @@ def update_moved_dir_edited_leaf_del(sbo
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_file_add(sbox):
"update locally moved dir with incoming file"
sbox.build()
@@ -5634,6 +5637,7 @@ def update_moved_dir_file_add(sbox):
None, None, None,
None, None, 1)
+@XFail()
def update_moved_dir_dir_add(sbox):
"update locally moved dir with incoming dir"
sbox.build()
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_diff/diff-diff3-test.c Sun Dec 23 06:03:14 2012
@@ -2405,7 +2405,7 @@ test_wrap(apr_pool_t *pool)
char rdata[(1<<17) + 4+3+3+1];
svn_string_t left, right;
svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
- diff_opts->ignore_space = TRUE;
+ diff_opts->ignore_space = svn_diff_file_ignore_space_change;
/* Two long lines. */
memset(ldata, '@', 1<<17);
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_fs_fs/fs-pack-test.c Sun Dec 23 06:03:14 2012
@@ -30,6 +30,7 @@
#include "svn_pools.h"
#include "svn_props.h"
#include "svn_fs.h"
+#include "private/svn_string_private.h"
#include "../svn_test_fs.h"
@@ -199,6 +200,77 @@ create_packed_filesystem(const char *dir
return svn_fs_pack(dir, pack_notify, &pnb, NULL, NULL, pool);
}
+/* Create a packed FSFS filesystem for revprop tests at REPO_NAME with
+ * MAX_REV revisions and the given SHARD_SIZE and OPTS. Return it in *FS.
+ * Use POOL for allocations.
+ */
+static svn_error_t *
+prepare_revprop_repo(svn_fs_t **fs,
+ const char *repo_name,
+ int max_rev,
+ int shard_size,
+ const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root;
+ const char *conflict;
+ svn_revnum_t after_rev;
+ apr_pool_t *subpool;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(create_packed_filesystem(repo_name, opts, max_rev, shard_size, pool));
+ SVN_ERR(svn_fs_open(fs, repo_name, NULL, pool));
+
+ subpool = svn_pool_create(pool);
+ /* Do a commit to trigger packing. */
+ SVN_ERR(svn_fs_begin_txn(&txn, *fs, max_rev, subpool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
+ SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota", subpool));
+ SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
+ SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
+ svn_pool_destroy(subpool);
+
+ /* Pack the repository. */
+ SVN_ERR(svn_fs_pack(repo_name, NULL, NULL, NULL, NULL, pool));
+
+ return SVN_NO_ERROR;
+}
+
+/* For revision REV, return a short log message allocated in POOL.
+ */
+static svn_string_t *
+default_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+ return svn_string_createf(pool, "Default message for rev %ld", rev);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+large_log(svn_revnum_t rev, apr_size_t length, apr_pool_t *pool)
+{
+ svn_stringbuf_t *temp = svn_stringbuf_create_ensure(100000, pool);
+ int i, count = (int)(length - 50) / 6;
+
+ svn_stringbuf_appendcstr(temp, "A ");
+ for (i = 0; i < count; ++i)
+ svn_stringbuf_appendcstr(temp, "very, ");
+
+ svn_stringbuf_appendcstr(temp,
+ apr_psprintf(pool, "very long message for rev %ld, indeed", rev));
+
+ return svn_stringbuf__morph_into_string(temp);
+}
+
+/* For revision REV, return a long log message allocated in POOL.
+ */
+static svn_string_t *
+huge_log(svn_revnum_t rev, apr_pool_t *pool)
+{
+ return large_log(rev, 90000, pool);
+}
+
/*** Tests ***/
@@ -404,18 +476,13 @@ commit_packed_fs(const svn_test_opts_t *
/* ------------------------------------------------------------------------ */
#define REPO_NAME "test-repo-get-set-revprop-packed-fs"
#define SHARD_SIZE 4
-#define MAX_REV 1
+#define MAX_REV 10
static svn_error_t *
get_set_revprop_packed_fs(const svn_test_opts_t *opts,
apr_pool_t *pool)
{
svn_fs_t *fs;
- svn_fs_txn_t *txn;
- svn_fs_root_t *txn_root;
- const char *conflict;
- svn_revnum_t after_rev;
svn_string_t *prop_value;
- apr_pool_t *subpool;
/* Bail (with success) on known-untestable scenarios */
if ((strcmp(opts->fs_type, "fsfs") != 0)
@@ -423,30 +490,179 @@ get_set_revprop_packed_fs(const svn_test
return SVN_NO_ERROR;
/* Create the packed FS and open it. */
- SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE, pool));
- SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
-
- subpool = svn_pool_create(pool);
- /* Do a commit to trigger packing. */
- SVN_ERR(svn_fs_begin_txn(&txn, fs, MAX_REV, subpool));
- SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
- SVN_ERR(svn_test__set_file_contents(txn_root, "iota", "new-iota", subpool));
- SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
- SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
- svn_pool_clear(subpool);
-
- /* Pack the repository. */
- SVN_ERR(svn_fs_pack(REPO_NAME, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
- /* Try to get revprop for revision 0. */
+ /* Try to get revprop for revision 0
+ * (non-packed due to special handling). */
SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
pool));
- /* Try to change revprop for revision 0. */
+ /* Try to change revprop for revision 0
+ * (non-packed due to special handling). */
SVN_ERR(svn_fs_change_rev_prop(fs, 0, SVN_PROP_REVISION_AUTHOR,
svn_string_create("tweaked-author", pool),
pool));
+ /* verify */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 0, SVN_PROP_REVISION_AUTHOR,
+ pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author");
+
+ /* Try to get packed revprop for revision 5. */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+ pool));
+
+ /* Try to change packed revprop for revision 5. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_AUTHOR,
+ svn_string_create("tweaked-author2", pool),
+ pool));
+
+ /* verify */
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, 5, SVN_PROP_REVISION_AUTHOR,
+ pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, "tweaked-author2");
+
+ return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-large-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 11
+static svn_error_t *
+get_set_large_revprop_packed_fs(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_string_t *prop_value;
+ svn_revnum_t rev;
+
+ /* Bail (with success) on known-untestable scenarios */
+ if ((strcmp(opts->fs_type, "fsfs") != 0)
+ || (opts->server_minor_version && (opts->server_minor_version < 7)))
+ return SVN_NO_ERROR;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
+
+ /* Set commit messages to different, large values that fill the pack
+ * files but do not exceed the pack size limit. */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+ large_log(rev, 15000, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 15000, pool)->data);
+ }
+
+ /* Put a larger revprop into the last, some middle and the first revision
+ * of a pack. This should cause the packs to split in the middle. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+ /* rev 0 is not packed */
+ large_log(3, 37000, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+ large_log(5, 25000, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+ large_log(8, 25000, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+
+ if (rev == 3)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 37000, pool)->data);
+ else if (rev == 5 || rev == 8)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 25000, pool)->data);
+ else
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ large_log(rev, 15000, pool)->data);
+ }
+
+ return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef MAX_REV
+#undef SHARD_SIZE
+
+/* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-get-set-huge-revprop-packed-fs"
+#define SHARD_SIZE 4
+#define MAX_REV 10
+static svn_error_t *
+get_set_huge_revprop_packed_fs(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_fs_t *fs;
+ svn_string_t *prop_value;
+ svn_revnum_t rev;
+
+ /* Bail (with success) on known-untestable scenarios */
+ if ((strcmp(opts->fs_type, "fsfs") != 0)
+ || (opts->server_minor_version && (opts->server_minor_version < 7)))
+ return SVN_NO_ERROR;
+
+ /* Create the packed FS and open it. */
+ SVN_ERR(prepare_revprop_repo(&fs, REPO_NAME, MAX_REV, SHARD_SIZE, opts,
+ pool));
+
+ /* Set commit messages to different values */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ SVN_ERR(svn_fs_change_rev_prop(fs, rev, SVN_PROP_REVISION_LOG,
+ default_log(rev, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+ SVN_TEST_STRING_ASSERT(prop_value->data, default_log(rev, pool)->data);
+ }
+
+ /* Put a huge revprop into the last, some middle and the first revision
+ * of a pack. They will cause the pack files to split accordingly. */
+ SVN_ERR(svn_fs_change_rev_prop(fs, 3, SVN_PROP_REVISION_LOG,
+ huge_log(3, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 5, SVN_PROP_REVISION_LOG,
+ huge_log(5, pool),
+ pool));
+ SVN_ERR(svn_fs_change_rev_prop(fs, 8, SVN_PROP_REVISION_LOG,
+ huge_log(8, pool),
+ pool));
+
+ /* verify */
+ for (rev = 0; rev <= MAX_REV; ++rev)
+ {
+ SVN_ERR(svn_fs_revision_prop(&prop_value, fs, rev,
+ SVN_PROP_REVISION_LOG, pool));
+
+ if (rev == 3 || rev == 5 || rev == 8)
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ huge_log(rev, pool)->data);
+ else
+ SVN_TEST_STRING_ASSERT(prop_value->data,
+ default_log(rev, pool)->data);
+ }
+
return SVN_NO_ERROR;
}
#undef REPO_NAME
@@ -533,6 +749,10 @@ struct svn_test_descriptor_t test_funcs[
"commit to a packed FSFS filesystem"),
SVN_TEST_OPTS_PASS(get_set_revprop_packed_fs,
"get/set revprop while packing FSFS filesystem"),
+ SVN_TEST_OPTS_PASS(get_set_large_revprop_packed_fs,
+ "get/set large packed revprops in FSFS"),
+ SVN_TEST_OPTS_PASS(get_set_huge_revprop_packed_fs,
+ "get/set huge packed revprops in FSFS"),
SVN_TEST_OPTS_PASS(recover_fully_packed,
"recover a fully packed filesystem"),
SVN_TEST_NULL
Propchange: subversion/branches/javahl-ra/subversion/tests/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Dec 23 06:03:14 2012
@@ -38,3 +38,5 @@ subst_translate-test
spillbuf-test
named_atomic-test
named_atomic-proc-test
+io-test
+io-test-temp
Modified: subversion/branches/javahl-ra/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/libsvn_subr/skel-test.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/branches/javahl-ra/subversion/tests/libsvn_subr/skel-test.c Sun Dec 23 06:03:14 2012
@@ -873,6 +873,11 @@ unparse_list(apr_pool_t *pool)
if (! skel_equal(top, reparsed))
return fail(pool, "failed to reparse list of lists");
+
+ reparsed = svn_skel__dup(reparsed, TRUE, pool);
+
+ if (! skel_equal(top, reparsed))
+ return fail(pool, "failed to dup list of lists");
}
return SVN_NO_ERROR;