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 2016/01/29 17:47:52 UTC

svn commit: r1727615 - /subversion/trunk/subversion/svn/resolve-cmd.c

Author: stsp
Date: Fri Jan 29 16:47:52 2016
New Revision: 1727615

URL: http://svn.apache.org/viewvc?rev=1727615&view=rev
Log:
Make the 'quit' command at the conflict prompt actually quit right away.

This command worked by side-effect of postponing all remaining conflicts
but didn't actually stop the conflict walk.
The QUIT flag passed around in the code was never actually read, just written.

* subversion/svn/resolve-cmd.c
  (conflict_status_walker): Check the conflict resolver QUIT flag and cancel
   the status walk if it is set.
  (walk_conflicts): Check for SVN_ERR_CANCELLED in combination with QUIT and
   don't treat this as an error. Don't write messages about being unable
   to resolve conflicts if the user canceled by hitting Ctrl-C, just exit.

Modified:
    subversion/trunk/subversion/svn/resolve-cmd.c

Modified: subversion/trunk/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/resolve-cmd.c?rev=1727615&r1=1727614&r2=1727615&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/resolve-cmd.c (original)
+++ subversion/trunk/subversion/svn/resolve-cmd.c Fri Jan 29 16:47:52 2016
@@ -121,6 +121,10 @@ conflict_status_walker(void *baton,
 
   svn_pool_destroy(iterpool);
 
+  /* If the has user decided to quit resolution, cancel the status walk. */
+  if (*cswb->quit)
+    return svn_error_create(SVN_ERR_CANCELLED, NULL, NULL);
+
   return SVN_NO_ERROR;
 }
 
@@ -270,17 +274,31 @@ walk_conflicts(svn_client_ctx_t *ctx,
   if (iterpool)
     svn_pool_destroy(iterpool);
 
-  if (err && err->apr_err != SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
-    err = svn_error_createf(
-                SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, err,
-                _("Unable to resolve conflicts on '%s'"),
-                svn_dirent_local_style(local_abspath, scratch_pool));
+  if (err)
+    {
+      if (err->apr_err == SVN_ERR_CANCELLED)
+        {
+          /* If QUIT is set, the user has selected the 'q' option at
+           * the conflict prompt and the status walk was aborted.
+           * This is not an error condition. */
+          if (quit)
+            {
+              svn_error_clear(err);
+              err = SVN_NO_ERROR;
+            }
+        }
+      else if (err->apr_err != SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
+        err = svn_error_createf(
+                    SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, err,
+                    _("Unable to resolve conflicts on '%s'"),
+                    svn_dirent_local_style(local_abspath, scratch_pool));
+
+      SVN_ERR(err);
+    }
 
   ctx->notify_func2 = cswb.notify_func;
   ctx->notify_baton2 = cswb.notify_baton;
 
-  SVN_ERR(err);
-
   /* ### call notify.c code */
   if (ctx->notify_func2)
     ctx->notify_func2(ctx->notify_baton2,