Author: stsp
Date: Thu Jul  5 12:09:13 2012
New Revision: 1357569

URL: http://svn.apache.org/viewvc?rev=1357569&view=rev
Log:
Don't lose the "Failure occurred processing one or more externals definitions"
error message if an unrelated error occurs. For instance, errors returned
from the conflict resolver would mask the "externals error" message.

* subversion/svn/switch-cmd.c
  (svn_cl__switch): Don't return the "externals processing" error directly,
   but merge it with any other potential errors from later function calls.

* subversion/svn/update-cmd.c
  (svn_cl__update): As previous.

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

Modified: subversion/trunk/subversion/svn/switch-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/switch-cmd.c?rev=1357569&r1=1357568&r2=1357569&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/switch-cmd.c (original)
+++ subversion/trunk/subversion/svn/switch-cmd.c Thu Jul  5 12:09:13 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;
@@ -182,23 +183,30 @@ 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 (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));
+      err = svn_cl__resolve_conflicts(
+              svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+                                                    scratch_pool),
+              depth, ctx, 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"));
-
-  return SVN_NO_ERROR;
+  return svn_error_compose_create(externals_err, err);
 }

Modified: subversion/trunk/subversion/svn/update-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/update-cmd.c?rev=1357569&r1=1357568&r2=1357569&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/update-cmd.c (original)
+++ subversion/trunk/subversion/svn/update-cmd.c Thu Jul  5 12:09:13 2012
@@ -112,6 +112,8 @@ svn_cl__update(apr_getopt_t *os,
   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,
@@ -169,30 +171,37 @@ 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 (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));
+      err = svn_cl__resolve_conflicts(
+              svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+                                                    scratch_pool),
+              depth, ctx, 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"));
-
-  return SVN_NO_ERROR;
+  return svn_error_compose_create(externals_err, err);
 }


Reply via email to