subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1780238 - /subversion/trunk/subversion/svn/merge-cmd.c
Date Wed, 25 Jan 2017 16:59:23 GMT
Author: stsp
Date: Wed Jan 25 16:59:23 2017
New Revision: 1780238

URL: http://svn.apache.org/viewvc?rev=1780238&view=rev
Log:
* subversion/svn/merge-cmd.c
  (svn_cl__merge): If a merge failed due to conflicts, and all conflicts
   get resolved by the conflict resolver, rerun the same merge to continue
   merging outstanding changes. Regression from 1.9.
   This is a bit of an ugly hack (it uses 'goto') but at least restores the
   desired behaviour. It can be prettified later on.

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

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=1780238&r1=1780237&r2=1780238&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Wed Jan 25 16:59:23 2017
@@ -528,6 +528,7 @@ svn_cl__merge(apr_getopt_t *os,
       ctx->conflict_baton2 = b;
     }
 
+retry:
   merge_err = run_merge(two_sources_specified,
                         sourcepath1, peg_revision1,
                         sourcepath2,
@@ -547,8 +548,26 @@ svn_cl__merge(apr_getopt_t *os,
   SVN_ERR(svn_cl__conflict_stats_get_paths(&conflicted_paths, conflict_stats,
                                            pool, pool));
   if (conflicted_paths)
-    SVN_ERR(svn_cl__walk_conflicts(conflicted_paths, conflict_stats,
-                                   opt_state, ctx, pool));
+    {
+      SVN_ERR(svn_cl__walk_conflicts(conflicted_paths, conflict_stats,
+                                     opt_state, ctx, pool));
+      if (merge_err &&
+          svn_error_root_cause(merge_err)->apr_err == SVN_ERR_WC_FOUND_CONFLICT)
+        {
+          svn_error_t *err;
+
+          /* Check if all conflicts were resolved just now. */
+          err = svn_cl__conflict_stats_get_paths(&conflicted_paths,
+                                                 conflict_stats, pool, pool);
+          if (err)
+            merge_err = svn_error_compose_create(merge_err, err);
+          else if (conflicted_paths == NULL)
+            {
+              svn_error_clear(merge_err);
+              goto retry; /* ### conflicts resolved; continue merging */
+            }
+        }
+    }
 
   if (!opt_state->quiet)
     {



Mime
View raw message