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

svn commit: r953904 - in /subversion/branches/1.6.x-issue3654: ./ CHANGES subversion/libsvn_client/merge.c subversion/tests/cmdline/merge_tests.py

Author: pburba
Date: Fri Jun 11 23:15:45 2010
New Revision: 953904

URL: http://svn.apache.org/viewvc?rev=953904&view=rev
Log:
On the 1.6.x-issue3654 branch: Fix issue 3654 on 1.6.x by merging r876855
from ^/subversion/branches/subtree-mergeinfo@876855.

* src-branch-1.6.x
* CHANGES
  Mereginfo recording only.

* subversion/libsvn_client/merge.c

  (get_mergeinfo_walk_cb): This is the core of this backport.  It removes
   the very limited case in which subtree mergeinfo is not updated to
   describe a merge in 1.6.x.
   See http://subversion.tigris.org/issues/show_bug.cgi?id=3654

* subversion/tests/cmdline/merge_tests.py

  (added_subtrees_with_mergeinfo_break_reintegrate): Remove comment about
   XFail status.

  (test_list): remove XFail from
   added_subtrees_with_mergeinfo_break_reintegrate.


Modified:
    subversion/branches/1.6.x-issue3654/   (props changed)
    subversion/branches/1.6.x-issue3654/CHANGES   (props changed)
    subversion/branches/1.6.x-issue3654/subversion/libsvn_client/merge.c
    subversion/branches/1.6.x-issue3654/subversion/tests/cmdline/merge_tests.py

Propchange: subversion/branches/1.6.x-issue3654/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 11 23:15:45 2010
@@ -64,6 +64,7 @@
 /subversion/branches/log-g-performance:870941-871032
 /subversion/branches/merge-skips-obstructions:874525-874615
 /subversion/branches/reintegrate-improvements:873853-874164
+/subversion/branches/subtree-mergeinfo:876855
 /subversion/branches/svn-mergeinfo-enhancements:870119-870195,870197-870288
 /subversion/branches/svnpatch-diff:871905,871986
 /subversion/branches/svnserve-logging:869828-870893

Propchange: subversion/branches/1.6.x-issue3654/CHANGES
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 11 23:15:45 2010
@@ -63,6 +63,7 @@
 /subversion/branches/log-g-performance/CHANGES:870941-871032
 /subversion/branches/merge-skips-obstructions/CHANGES:874525-874615
 /subversion/branches/reintegrate-improvements/CHANGES:873853-874164
+/subversion/branches/subtree-mergeinfo/CHANGES:876855
 /subversion/branches/svn-mergeinfo-enhancements/CHANGES:870119-870195,870197-870288
 /subversion/branches/svnpatch-diff/CHANGES:871905,871986
 /subversion/branches/svnserve-logging/CHANGES:869828-870893

Modified: subversion/branches/1.6.x-issue3654/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-issue3654/subversion/libsvn_client/merge.c?rev=953904&r1=953903&r2=953904&view=diff
==============================================================================
--- subversion/branches/1.6.x-issue3654/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.6.x-issue3654/subversion/libsvn_client/merge.c Fri Jun 11 23:15:45 2010
@@ -4856,13 +4856,12 @@ struct get_mergeinfo_walk_baton
 
    Given PATH, its corresponding ENTRY, and WB, where WB is the WALK_BATON
    of type "struct get_mergeinfo_walk_baton *":  If PATH is switched,
-   has explicit working svn:mergeinfo from the corresponding merge source and
-   this walk is being done as part of a forward merge or has *any* explicit
-   working svn:mergeinfo and this walk is being done as part of a reverse
-   merge, is missing a child due to a sparse checkout, is absent from disk,
-   is scheduled for deletion, then create a svn_client__merge_path_t *
-   representing *PATH, allocated in BATON->POOL, and
-   push it onto the WB->CHILDREN_WITH_MERGEINFO array. */
+   has explicit working svn:mergeinfo, is missing a child due to a sparse
+   checkout, is absent from disk, is scheduled for deletion, or if the walk
+   is being done as part of a reverse merge, then create a
+   svn_client__merge_path_t *representing *PATH, allocated in
+   WB->CHILDREN_WITH_MERGEINFO->POOL, and push it onto the
+   WB->CHILDREN_WITH_MERGEINFO array. */
 static svn_error_t *
 get_mergeinfo_walk_cb(const char *path,
                       const svn_wc_entry_t *entry,
@@ -4871,9 +4870,8 @@ get_mergeinfo_walk_cb(const char *path,
 {
   struct get_mergeinfo_walk_baton *wb = walk_baton;
   const svn_string_t *propval;
-  svn_mergeinfo_t mergehash;
   svn_boolean_t switched = FALSE;
-  svn_boolean_t has_mergeinfo_from_merge_src = FALSE;
+  svn_boolean_t has_mergeinfo = FALSE;
   svn_boolean_t path_is_merge_target =
     !svn_path_compare_paths(path, wb->merge_target_path);
   const char *parent_path = svn_path_dirname(path, pool);
@@ -4902,111 +4900,9 @@ get_mergeinfo_walk_cb(const char *path,
     {
       SVN_ERR(svn_wc_prop_get(&propval, SVN_PROP_MERGEINFO, path,
                               wb->base_access, pool));
-      /* We always include the merge target regardless of its mergeinfo.
-         So we don't need to check that PATH's mergeinfo corresponds to
-         the merge source. */
-      if (propval && !path_is_merge_target)
-        {
-          svn_stringbuf_t *merge_src_child_path =
-            svn_stringbuf_create(wb->merge_src_canon_path, pool);
-
-          /* When the merge target is '' or '.' WB->MERGE_TARGET_PATH is
-             an empty string and PATH will always be relative.  In this case
-             we can safely combine WB->MERGE_SRC_CANON_PATH and PATH with
-             svn_path_add_compent() which will supply the missing '/' separator.
-
-             Otherwise WB->MERGE_TARGET_PATH is relative or absolute and
-             we remove the common root component between WB->MERGE_TARGET_PATH
-             and PATH from PATH before combining it with
-             WB->MERGE_SRC_CANON_PATH.  The +1 is required because if we are
-             here that means WB->MERGE_TARGET_PATH is a proper ancestor of
-             PATH and we must skip the path separator -- svn_path_add_compent()
-             will add missing separators, but won't remove existing ones -- to
-             avoid a merge_src_child_path with "//" in it. */
-          if (strlen(wb->merge_target_path))
-            svn_path_add_component(merge_src_child_path,
-                                   path + strlen(wb->merge_target_path) + 1);
-          else
-            svn_path_add_component(merge_src_child_path,
-                                   path);
-          SVN_ERR(svn_mergeinfo_parse(&mergehash, propval->data, pool));
-          if (wb->revision1 > wb->revision2 /* Reverse merge. */
-              || propval->len == 0 /* empty mergeinfo */
-              || apr_hash_get(mergehash, merge_src_child_path->data,
-                              APR_HASH_KEY_STRING))
-            {
-              /* The easy way: PATH already has mergeinfo
-                 from this source or has empty mergeinfo... */
-              has_mergeinfo_from_merge_src = TRUE;
-            }
-          else
-            {
-              /* ...the slightly harder way: See if PATH exists in the
-                 merge source at the revisions being merged. If it doesn't
-                 exist there is no way this subtree can be affected by the
-                 merge so we can safely leave it, and its mergeinfo, alone. */
-              svn_error_t *err;
-              const char *original_ra_url = NULL;
-              const char *mergeinfo_url =
-                svn_path_url_add_component2(wb->source_root_url,
-                                            /* Skip leading '/'. */
-                                            merge_src_child_path->data + 1,
-                                            pool);
-              svn_opt_revision_t *start_revision, *end_revision;
-              const char *start_url, *end_url;
-              svn_opt_revision_t peg_rev, rev1_opt, rev2_opt;
-
-              peg_rev.value.number = wb->revision1 < wb->revision2
-                ? wb->revision2 : wb->revision1;
-              peg_rev.kind = svn_opt_revision_number;
-
-              rev1_opt.kind = svn_opt_revision_number;
-              rev1_opt.value.number = wb->revision1;
-
-              rev2_opt.kind = svn_opt_revision_number;
-              rev2_opt.value.number = wb->revision2;
-
-              /* Instead of passing NULL to svn_client__repos_locations() and
-                 causing another session to open, reparent WB->RA_SESSION
-                 and use that. */
-              SVN_ERR(svn_client__ensure_ra_session_url(&original_ra_url,
-                                                        wb->ra_session,
-                                                        mergeinfo_url, pool));
-
-              /* Does PATH exist in the merge source? */
-              err = svn_client__repos_locations(&start_url, &start_revision,
-                                                &end_url, &end_revision,
-                                                wb->ra_session, mergeinfo_url,
-                                                &peg_rev, &rev1_opt, &rev2_opt,
-                                                wb->ctx, pool);
-              if (err)
-                {
-                  /* We might see any of these errors depending on the RA
-                     access method, but they all mean that PATH doesn't exist
-                     in the merge source.
-
-                     ### TODO: Make svn_client__repos_locations() more
-                     ###       consistent in the error it returns(?)
-                     */
-                  if (err->apr_err == SVN_ERR_FS_NOT_FOUND
-                      || err->apr_err == SVN_ERR_CLIENT_UNRELATED_RESOURCES)
-                    svn_error_clear(err);
-                  else
-                    return err;
-                 }
-              else /* PATH does exist in the merge source*/
-                {
-                  has_mergeinfo_from_merge_src = TRUE;
-                }
+      if (propval)
+        has_mergeinfo = TRUE;
 
-              /* Reparent the session to its original URL if necessary. */
-              if (original_ra_url)
-                {
-                  SVN_ERR(svn_ra_reparent(wb->ra_session,
-                                          original_ra_url, pool));
-                }
-            } /* the slightly harder way */
-        }
       /* Regardless of whether PATH has explicit mergeinfo or not, we must
          determine if PATH is switched.  This is so get_mergeinfo_paths()
          can later tweak PATH's parent to reflect a missing child (implying it
@@ -5021,7 +4917,7 @@ get_mergeinfo_walk_cb(const char *path,
      depth is immediates, and/or are file children of the merge target if
      depth is files. */
   if (path_is_merge_target
-      || has_mergeinfo_from_merge_src
+      || has_mergeinfo
       || entry->schedule == svn_wc_schedule_delete
       || switched
       || entry->depth == svn_depth_empty
@@ -5263,9 +5159,7 @@ insert_parent_and_sibs_of_sw_absent_del_
    Create an svn_client__merge_path_t * for any path which meets one or more
    of the following criteria:
 
-     1) do_directory_merge() is processing a forward merge and path has
-        working svn:mergeinfo from corresponding merge source or has empty
-        mergeinfo.
+     1) Path has working svn:mergeinfo.
      2) Path is switched.
      3) Path is a subtree of the merge target (i.e. is not equal to
         MERGE_CMD_BATON->TARGET) and has no mergeinfo of its own but its

Modified: subversion/branches/1.6.x-issue3654/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x-issue3654/subversion/tests/cmdline/merge_tests.py?rev=953904&r1=953903&r2=953904&view=diff
==============================================================================
--- subversion/branches/1.6.x-issue3654/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.6.x-issue3654/subversion/tests/cmdline/merge_tests.py Fri Jun 11 23:15:45 2010
@@ -16509,16 +16509,6 @@ def added_subtrees_with_mergeinfo_break_
   # should work.  The only text change should be the change made to
   # A_COPY/B/lambda in r17 after the new A_COPY was created.
   #
-  # Currently this fails with:
-  #
-  #  >svn merge ^^/A_COPY A --reintegrate
-  #  svn: Reintegrate can only be used if revisions 2 through 13 were
-  #  previously merged from file:///D:/SVN/src-trunk/Release/subversion/
-  #  tests/cmdline/svn-test-work/repositories/merge_reintegrate_tests-13/A
-  #  to the reintegrate source, but this is not the case:
-  #    A_COPY/C/nu
-  #      Missing ranges: /A/C/nu:9,11
-  #
   # Marking this test as XFail until this issue is fixed.
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
   expected_output = wc.State(A_path, {
@@ -16818,7 +16808,7 @@ test_list = [ None,
               SkipUnless(handle_gaps_in_implicit_mergeinfo,
                          server_has_mergeinfo),
               reintegrate_with_self_referential_mergeinfo,
-              XFail(added_subtrees_with_mergeinfo_break_reintegrate),
+              added_subtrees_with_mergeinfo_break_reintegrate,
              ]
 
 if __name__ == '__main__':