You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/06/12 15:27:18 UTC

svn commit: r1349322 - /subversion/trunk/subversion/libsvn_client/merge.c

Author: julianfoad
Date: Tue Jun 12 13:27:18 2012
New Revision: 1349322

URL: http://svn.apache.org/viewvc?rev=1349322&view=rev
Log:
Tweak the Symmetric Merge to support subtree mergeinfo in "sync"-style merges
(that is, merging again in the same direction), even when the subtree(s)
needed some revisions prior to the first revision needed by the root path of
the merge.

This fixes merge_tests.py 88 89, leaving only merge_tests.py 78 and
merge_reintegrate_tests.py 10 tests failing now (when 'svn merge' is patched
to use symmetric merge for all sync and reintegrate merges).

* subversion/libsvn_client/merge.c
  (do_symmetric_merge_locked): Pass the YCA as the source-left location for a
    sync-style merge, letting do_merge() do all the work of finding which
    revision ranges need to be merged for each subtree.

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1349322&r1=1349321&r2=1349322&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Jun 12 13:27:18 2012
@@ -11555,19 +11555,16 @@ do_symmetric_merge_locked(const svn_clie
                           apr_pool_t *scratch_pool)
 {
   merge_target_t *target;
-  merge_source_t source;
   svn_boolean_t use_sleep = FALSE;
   svn_error_t *err;
 
   SVN_ERR(open_target_wc(&target, target_abspath, TRUE, TRUE, TRUE,
                          ctx, scratch_pool, scratch_pool));
 
-  source.loc1 = merge->base;
-  source.loc2 = merge->right;
-  source.ancestral = (merge->mid == NULL);
-
   if (merge->mid)
     {
+      merge_source_t source = { merge->base, merge->right,
+                                (merge->mid == NULL) /* ancestral */ };
       svn_ra_session_t *ra_session = NULL;
 
       SVN_ERR(ensure_ra_session_url(&ra_session, source.loc1->url,
@@ -11586,6 +11583,17 @@ do_symmetric_merge_locked(const svn_clie
     }
   else
     {
+      /* Ignoring the base that we found, we pass the YCA instead and let
+         do_merge() work out which subtrees need which revision ranges to
+         be merged.  This enables do_merge() to fill in revision-range
+         gaps that are older than the base that we calculated (which is
+         for the root path of the merge).
+
+         An improvement would be to change find_symmetric_merge() to
+         find the base for each sutree, and then here use the oldest base
+         among all subtrees. */
+      merge_source_t source = { merge->yca, merge->right,
+                                (merge->mid == NULL) /* ancestral */ };
       apr_array_header_t *merge_sources;
 
       merge_sources = apr_array_make(scratch_pool, 1, sizeof(merge_source_t *));