Author: stsp
Date: Wed Jul 4 17:24:09 2012
New Revision: 1357342
URL: http://svn.apache.org/viewvc?rev=1357342&view=rev
Log:
Make 'svn merge' print the conflict summary before showing output from the
conflict resolver, and also restrict post-merge interactive resolution
to paths which got new conflicts flagged during the merge operation.
Corresponds to changes made for 'svn update' in r1357298 and r1357313.
* subversion/libsvn_client/merge.c
(merge_dir_props_changed, merge_file_changed): Invoke the conflict callback
from the client context again.
(merge_locked, merge_peg_locked, do_symmetric_merge_locked): Stop resolving
conflicts before returning.
* subversion/svn/merge-cmd.c
(svn_cl__merge): Postpone conflict resolution during the merge operation.
Run the conflict resolver on any paths which got conflicts flagged during
the merge operation.
Modified:
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/svn/merge-cmd.c
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1357342&r1=1357341&r2=1357342&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Jul 4 17:24:09 2012
@@ -1381,7 +1381,7 @@ merge_dir_props_changed(svn_wc_notify_st
SVN_ERR(svn_wc_merge_props3(state, ctx->wc_ctx, local_abspath,
NULL, NULL, original_props, props,
merge_b->dry_run,
- NULL, NULL, /* postpone conflicts */
+ ctx->conflict_func2, ctx->conflict_baton2,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
}
@@ -1695,7 +1695,7 @@ merge_file_changed(svn_wc_notify_state_t
left, right,
original_props, prop_changes,
merge_b->dry_run,
- NULL, NULL, /* postpone conflicts */
+ ctx->conflict_func2, ctx->conflict_baton2,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
}
@@ -9720,22 +9720,6 @@ merge_locked(const char *source1,
if (err)
return svn_error_trace(err);
- if (ctx->conflict_func2)
- {
- /* Resolve conflicts within the merge target. */
- SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
- depth,
- TRUE /* resolve_text */,
- "" /* resolve_prop (ALL props) */,
- TRUE /* resolve_tree */,
- svn_wc_conflict_choose_unspecified,
- ctx->conflict_func2,
- ctx->conflict_baton2,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2,
- scratch_pool));
- }
-
return SVN_NO_ERROR;
}
@@ -11033,22 +11017,6 @@ merge_peg_locked(const char *source_path
/* We're done with our RA session. */
svn_pool_destroy(sesspool);
- if (ctx->conflict_func2)
- {
- /* Resolve conflicts within the merge target. */
- SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
- depth,
- TRUE /* resolve_text */,
- "" /* resolve_prop (ALL props) */,
- TRUE /* resolve_tree */,
- svn_wc_conflict_choose_unspecified,
- ctx->conflict_func2,
- ctx->conflict_baton2,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2,
- scratch_pool));
- }
-
return svn_error_trace(err);
}
@@ -11702,22 +11670,6 @@ do_symmetric_merge_locked(const svn_clie
SVN_ERR(err);
- if (ctx->conflict_func2)
- {
- /* Resolve conflicts within the merge target. */
- SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
- depth,
- TRUE /* resolve_text */,
- "" /* resolve_prop (ALL props) */,
- TRUE /* resolve_tree */,
- svn_wc_conflict_choose_unspecified,
- ctx->conflict_func2,
- ctx->conflict_baton2,
- ctx->cancel_func, ctx->cancel_baton,
- ctx->notify_func2, ctx->notify_baton2,
- scratch_pool));
- }
-
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=1357342&r1=1357341&r2=1357342&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Wed Jul 4 17:24:09 2012
@@ -157,6 +157,8 @@ svn_cl__merge(apr_getopt_t *os,
peg_revision2;
apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
svn_opt_revision_t unspecified = { svn_opt_revision_unspecified, { 0 } };
+ svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
+ void *conflict_baton2 = ctx->conflict_baton2;
/* Merge doesn't support specifying a revision or revision range
when using --reintegrate. */
@@ -390,6 +392,11 @@ 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. */
+ ctx->conflict_func2 = NULL;
+ ctx->conflict_baton2 = NULL;
+
#ifdef SVN_WITH_SYMMETRIC_MERGE
if (opt_state->symmetric_merge)
{
@@ -493,6 +500,15 @@ svn_cl__merge(apr_getopt_t *os,
if (! opt_state->quiet)
SVN_ERR(svn_cl__print_conflict_stats(ctx->notify_baton2, pool));
+ if (conflict_func2 && svn_cl__notifier_check_conflicts(ctx->notify_baton2))
+ {
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+ SVN_ERR(svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(ctx->notify_baton2,
pool),
+ opt_state->depth, ctx, pool));
+ }
+
if (err)
{
if(err->apr_err == SVN_ERR_CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING)