You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/07/04 17:51:56 UTC

svn commit: r1357317 - in /subversion/trunk/subversion: libsvn_client/switch.c svn/switch-cmd.c

Author: stsp
Date: Wed Jul  4 15:51:55 2012
New Revision: 1357317

URL: http://svn.apache.org/viewvc?rev=1357317&view=rev
Log:
Make 'svn switch' print the conflict summary before showing output from the
conflict resolver, and also restrict post-switch interactive resolution 
to paths which got new conflicts flagged during the switch operation.

Corresponds to changes made for 'svn update' in r1357298 and r1357313.

* subversion/libsvn_client/switch.c
  (switch_internal): Always invoke the conflict callback provided by the
   client context. Stop invoking the conflict resolver before returning.

* subversion/svn/switch-cmd.c
  (svn_cl__switch): Force conflicts to be postponed during the switch
   operation, and run the resolver on any paths which got conflicts flagged
   during the switch.

Modified:
    subversion/trunk/subversion/libsvn_client/switch.c
    subversion/trunk/subversion/svn/switch-cmd.c

Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1357317&r1=1357316&r2=1357317&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Wed Jul  4 15:51:55 2012
@@ -237,7 +237,7 @@ switch_internal(svn_revnum_t *result_rev
                                     server_supports_depth,
                                     diff3_cmd, preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
-                                    NULL, NULL, /* postpone conflicts */
+                                    ctx->conflict_func2, ctx->conflict_baton2,
                                     NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
@@ -323,22 +323,6 @@ switch_internal(svn_revnum_t *result_rev
   if (result_rev)
     *result_rev = revnum;
 
-  if (ctx->conflict_func2)
-    {
-      /* Resolve conflicts within the switched target. */
-      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_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,
-                                        pool));
-    }
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/switch-cmd.c?rev=1357317&r1=1357316&r2=1357317&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/switch-cmd.c (original)
+++ subversion/trunk/subversion/svn/switch-cmd.c Wed Jul  4 15:51:55 2012
@@ -102,6 +102,8 @@ svn_cl__switch(apr_getopt_t *os,
   svn_depth_t depth;
   svn_boolean_t depth_is_sticky;
   struct svn_cl__check_externals_failed_notify_baton nwb;
+  svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
+  void *conflict_baton2 = ctx->conflict_baton2;
 
   /* This command should discover (or derive) exactly two cmdline
      arguments: a local path to update ("target"), and a new url to
@@ -156,6 +158,11 @@ 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. */
+  ctx->conflict_func2 = NULL;
+  ctx->conflict_baton2 = NULL;
+
   /* Do the 'switch' update. */
   err = svn_client_switch3(NULL, target, switch_url, &peg_revision,
                            &(opt_state->start_revision), depth,
@@ -178,6 +185,16 @@ svn_cl__switch(apr_getopt_t *os,
   if (! opt_state->quiet)
     SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
 
+  if (conflict_func2 && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+    {
+      ctx->conflict_func2 = conflict_func2;
+      ctx->conflict_baton2 = conflict_baton2;
+      SVN_ERR(svn_cl__resolve_conflicts(
+                svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+                                                      scratch_pool),
+                depth, ctx, scratch_pool));
+    }
+
   if (nwb.had_externals_error)
     return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
                             _("Failure occurred processing one or more "