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 2013/01/22 18:45:50 UTC

svn commit: r1437069 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/deprecated.c libsvn_client/merge.c svn/merge-cmd.c

Author: julianfoad
Date: Tue Jan 22 17:45:50 2013
New Revision: 1437069

URL: http://svn.apache.org/viewvc?rev=1437069&view=rev
Log:
Separate the two meanings of 'ignore_ancestry' in the libsvn_client merge
APIs. The two new flags are 'ignore_mergeinfo' and 'diff_ignore_ancestry'.

* subversion/include/svn_client.h
  (svn_client_merge5, svn_client_merge_peg5): New, with separate flags.
  (svn_client_merge4, svn_client_merge_peg4): Deprecated.

* subversion/libsvn_client/merge.c
  (svn_client_merge5, svn_client_merge_peg5): New, with separate flags.

* subversion/libsvn_client/deprecated.c
  (svn_client_merge4, svn_client_merge_peg4): Re-implement as wrappers.

* subversion/svn/merge-cmd.c
  (merge_reintegrate, svn_cl__merge): Update callers.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/deprecated.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/svn/merge-cmd.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1437069&r1=1437068&r2=1437069&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Tue Jan 22 17:45:50 2013
@@ -3502,7 +3502,7 @@ svn_client_find_automatic_merge_no_wc(
  * the WC at @a target_wcpath.  The @a merge structure would typically come
  * from calling svn_client_find_automatic_merge().
  *
- * The other parameters are as in svn_client_merge4().
+ * The other parameters are as in svn_client_merge5().
  *
  * @since New in 1.8.
  */
@@ -3588,16 +3588,14 @@ svn_client_automatic_merge_get_locations
  *
  * If @a depth is #svn_depth_unknown, use the depth of @a target_wcpath.
  *
- * @a ignore_ancestry has both of the following meanings:
+ * If @a ignore_mergeinfo is true, disable merge tracking, by treating the
+ * two sources as unrelated even if they actually have a common ancestor.
  *
- *   (1) Disable merge tracking, by treating the two sources as unrelated
- *   even if they actually have a common ancestor.
- *
- *   (2) Diff unrelated nodes as if related.  If @a ignore_ancestry is true,
- *   the 'left' and 'right' versions of a node (if they are the same kind)
- *   will be diffed as if they were related even if they are not related.
- *   Otherwise, unrelated items will be diffed as a deletion of one thing
- *   and the addition of another.
+ * If @a diff_ignore_ancestry is true, diff unrelated nodes as if related:
+ * that is, diff the 'left' and 'right' versions of a node as if they were
+ * related (if they are the same kind) even if they are not related.
+ * Otherwise, diff unrelated items as a deletion of one thing and the
+ * addition of another.
  *
  * If @a force_delete is false and the merge involves deleting a file whose
  * content differs from the source-left version, or a locally modified
@@ -3628,8 +3626,33 @@ svn_client_automatic_merge_get_locations
  * The authentication baton cached in @a ctx is used to communicate with the
  * repository.
  *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_merge5(const char *source1,
+                  const svn_opt_revision_t *revision1,
+                  const char *source2,
+                  const svn_opt_revision_t *revision2,
+                  const char *target_wcpath,
+                  svn_depth_t depth,
+                  svn_boolean_t ignore_mergeinfo,
+                  svn_boolean_t diff_ignore_ancestry,
+                  svn_boolean_t force_delete,
+                  svn_boolean_t record_only,
+                  svn_boolean_t dry_run,
+                  svn_boolean_t allow_mixed_rev,
+                  const apr_array_header_t *merge_options,
+                  svn_client_ctx_t *ctx,
+                  apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_merge5(), but the single @a ignore_ancestry
+ * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
  * @since New in 1.7.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_merge4(const char *source1,
                   const svn_opt_revision_t *revision1,
@@ -3757,10 +3780,10 @@ svn_client_find_reintegrate_merge(const 
  * pristine, unswitched working copy -- in other words, it must
  * reflect a single revision tree, the "target".  The mergeinfo on @a
  * source_path_or_url must reflect that all of the target has been merged into it.
- * Then this behaves like a merge with svn_client_merge4() from the
+ * Then this behaves like a merge with svn_client_merge5() from the
  * target's URL to the source.
  *
- * All other options are handled identically to svn_client_merge4().
+ * All other options are handled identically to svn_client_merge5().
  * The depth of the merge is always #svn_depth_infinity.
  *
  * @since New in 1.5.
@@ -3787,10 +3810,34 @@ svn_client_merge_reintegrate(const char 
  * list of provided ranges has an `unspecified' or unrecognized
  * `kind', return #SVN_ERR_CLIENT_BAD_REVISION.
  *
- * All other options are handled identically to svn_client_merge4().
+ * All other options are handled identically to svn_client_merge5().
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_merge_peg5(const char *source_path_or_url,
+                      const apr_array_header_t *ranges_to_merge,
+                      const svn_opt_revision_t *source_peg_revision,
+                      const char *target_wcpath,
+                      svn_depth_t depth,
+                      svn_boolean_t ignore_mergeinfo,
+                      svn_boolean_t diff_ignore_ancestry,
+                      svn_boolean_t force_delete,
+                      svn_boolean_t record_only,
+                      svn_boolean_t dry_run,
+                      svn_boolean_t allow_mixed_rev,
+                      const apr_array_header_t *merge_options,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_merge_peg5(), but the single @a ignore_ancestry
+ * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry.
  *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
  * @since New in 1.7.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_merge_peg4(const char *source_path_or_url,
                       const apr_array_header_t *ranges_to_merge,

Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1437069&r1=1437068&r2=1437069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Tue Jan 22 17:45:50 2013
@@ -1630,6 +1630,34 @@ svn_client_log(const apr_array_header_t 
 /*** From merge.c ***/
 
 svn_error_t *
+svn_client_merge4(const char *source1,
+                  const svn_opt_revision_t *revision1,
+                  const char *source2,
+                  const svn_opt_revision_t *revision2,
+                  const char *target_wcpath,
+                  svn_depth_t depth,
+                  svn_boolean_t ignore_ancestry,
+                  svn_boolean_t force_delete,
+                  svn_boolean_t record_only,
+                  svn_boolean_t dry_run,
+                  svn_boolean_t allow_mixed_rev,
+                  const apr_array_header_t *merge_options,
+                  svn_client_ctx_t *ctx,
+                  apr_pool_t *pool)
+{
+  SVN_ERR(svn_client_merge5(source1, revision1,
+                            source2, revision2,
+                            target_wcpath,
+                            depth,
+                            ignore_ancestry /*ignore_mergeinfo*/,
+                            ignore_ancestry /*diff_ignore_ancestry*/,
+                            force_delete, record_only,
+                            dry_run, allow_mixed_rev,
+                            merge_options, ctx, pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_client_merge3(const char *source1,
                   const svn_opt_revision_t *revision1,
                   const char *source2,
@@ -1690,6 +1718,34 @@ svn_client_merge(const char *source1,
 }
 
 svn_error_t *
+svn_client_merge_peg4(const char *source_path_or_url,
+                      const apr_array_header_t *ranges_to_merge,
+                      const svn_opt_revision_t *source_peg_revision,
+                      const char *target_wcpath,
+                      svn_depth_t depth,
+                      svn_boolean_t ignore_ancestry,
+                      svn_boolean_t force_delete,
+                      svn_boolean_t record_only,
+                      svn_boolean_t dry_run,
+                      svn_boolean_t allow_mixed_rev,
+                      const apr_array_header_t *merge_options,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *pool)
+{
+  SVN_ERR(svn_client_merge_peg5(source_path_or_url,
+                                ranges_to_merge,
+                                source_peg_revision,
+                                target_wcpath,
+                                depth,
+                                ignore_ancestry /*ignore_mergeinfo*/,
+                                ignore_ancestry /*diff_ignore_ancestry*/,
+                                force_delete, record_only,
+                                dry_run, allow_mixed_rev,
+                                merge_options, ctx, pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_client_merge_peg3(const char *source,
                       const apr_array_header_t *ranges_to_merge,
                       const svn_opt_revision_t *peg_revision,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1437069&r1=1437068&r2=1437069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Jan 22 17:45:50 2013
@@ -8448,7 +8448,7 @@ remove_noop_subtree_ranges(const merge_s
    paths and the values are the new mergeinfos for each.  Allocate additions
    to RESULT_CATALOG in pool which RESULT_CATALOG was created in.
 
-   Handle DEPTH as documented for svn_client_merge4().
+   Handle DEPTH as documented for svn_client_merge5().
 
    If ABORT_ON_CONFLICTS is TRUE raise an SVN_ERR_WC_FOUND_CONFLICT error
    if any merge conflicts occur.
@@ -9450,7 +9450,7 @@ open_target_wc(merge_target_t **target_p
 
 /*** Public APIs ***/
 
-/* The body of svn_client_merge4(), which see for details.
+/* The body of svn_client_merge5(), which see for details.
  *
  * If SOURCE1 @ REVISION1 is related to SOURCE2 @ REVISION2 then use merge
  * tracking (subject to other constraints -- see HONOR_MERGEINFO());
@@ -9660,13 +9660,14 @@ get_target_and_lock_abspath(const char *
 }
 
 svn_error_t *
-svn_client_merge4(const char *source1,
+svn_client_merge5(const char *source1,
                   const svn_opt_revision_t *revision1,
                   const char *source2,
                   const svn_opt_revision_t *revision2,
                   const char *target_wcpath,
                   svn_depth_t depth,
-                  svn_boolean_t ignore_ancestry,
+                  svn_boolean_t ignore_mergeinfo,
+                  svn_boolean_t diff_ignore_ancestry,
                   svn_boolean_t force_delete,
                   svn_boolean_t record_only,
                   svn_boolean_t dry_run,
@@ -9699,13 +9700,15 @@ svn_client_merge4(const char *source1,
   if (!dry_run)
     SVN_WC__CALL_WITH_WRITE_LOCK(
       merge_locked(source1, revision1, source2, revision2,
-                   target_abspath, depth, ignore_ancestry, ignore_ancestry,
+                   target_abspath, depth, ignore_mergeinfo,
+                   diff_ignore_ancestry,
                    force_delete, record_only, dry_run,
                    allow_mixed_rev, merge_options, ctx, pool),
       ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
   else
     SVN_ERR(merge_locked(source1, revision1, source2, revision2,
-                   target_abspath, depth, ignore_ancestry, ignore_ancestry,
+                   target_abspath, depth, ignore_mergeinfo,
+                   diff_ignore_ancestry,
                    force_delete, record_only, dry_run,
                    allow_mixed_rev, merge_options, ctx, pool));
 
@@ -10874,7 +10877,7 @@ svn_client_merge_reintegrate(const char 
 }
 
 
-/* The body of svn_client_merge_peg4(), which see for details.
+/* The body of svn_client_merge_peg5(), which see for details.
  *
  * IGNORE_MERGEINFO and DIFF_IGNORE_ANCESTRY are as in do_merge().
  */
@@ -10945,12 +10948,13 @@ merge_peg_locked(const char *source_path
 }
 
 svn_error_t *
-svn_client_merge_peg4(const char *source_path_or_url,
+svn_client_merge_peg5(const char *source_path_or_url,
                       const apr_array_header_t *ranges_to_merge,
                       const svn_opt_revision_t *source_peg_revision,
                       const char *target_wcpath,
                       svn_depth_t depth,
-                      svn_boolean_t ignore_ancestry,
+                      svn_boolean_t ignore_mergeinfo,
+                      svn_boolean_t diff_ignore_ancestry,
                       svn_boolean_t force_delete,
                       svn_boolean_t record_only,
                       svn_boolean_t dry_run,
@@ -10972,14 +10976,16 @@ svn_client_merge_peg4(const char *source
     SVN_WC__CALL_WITH_WRITE_LOCK(
       merge_peg_locked(source_path_or_url, source_peg_revision,
                        ranges_to_merge,
-                       target_abspath, depth, ignore_ancestry, ignore_ancestry,
+                       target_abspath, depth, ignore_mergeinfo,
+                       diff_ignore_ancestry,
                        force_delete, record_only, dry_run,
                        allow_mixed_rev, merge_options, ctx, pool),
       ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
   else
     SVN_ERR(merge_peg_locked(source_path_or_url, source_peg_revision,
                        ranges_to_merge,
-                       target_abspath, depth, ignore_ancestry, ignore_ancestry,
+                       target_abspath, depth, ignore_mergeinfo,
+                       diff_ignore_ancestry,
                        force_delete, record_only, dry_run,
                        allow_mixed_rev, merge_options, ctx, pool));
 

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=1437069&r1=1437068&r2=1437069&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Tue Jan 22 17:45:50 2013
@@ -90,9 +90,10 @@ merge_reintegrate(const char *source_pat
       /* Do the merge.  Set 'allow_mixed_rev' to true, not because we want
        * to allow a mixed-rev WC but simply to bypass the check, as it was
        * already checked in svn_client_find_reintegrate_merge(). */
-      SVN_ERR(svn_client_merge4(url1, &revision1, url2, &revision2,
+      SVN_ERR(svn_client_merge5(url1, &revision1, url2, &revision2,
                                 target_wcpath, svn_depth_infinity,
-                                FALSE /* ignore_ancestry */,
+                                FALSE /* ignore_mergeinfo */,
+                                FALSE /* diff_ignore_ancestry */,
                                 FALSE /* force_delete */,
                                 FALSE /* record_only */,
                                 dry_run, TRUE /* allow_mixed_rev */,
@@ -532,12 +533,13 @@ svn_cl__merge(apr_getopt_t *os,
 
       if (opt_state->verbose)
         SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
-      merge_err = svn_client_merge_peg4(sourcepath1,
+      merge_err = svn_client_merge_peg5(sourcepath1,
                                         ranges_to_merge,
                                         &peg_revision1,
                                         targetpath,
                                         opt_state->depth,
                                         opt_state->ignore_ancestry,
+                                        opt_state->ignore_ancestry,
                                         opt_state->force, /* force_delete */
                                         opt_state->record_only,
                                         opt_state->dry_run,
@@ -555,13 +557,14 @@ svn_cl__merge(apr_getopt_t *os,
 
       if (opt_state->verbose)
         SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
-      merge_err = svn_client_merge4(sourcepath1,
+      merge_err = svn_client_merge5(sourcepath1,
                                     &first_range_start,
                                     sourcepath2,
                                     &first_range_end,
                                     targetpath,
                                     opt_state->depth,
                                     opt_state->ignore_ancestry,
+                                    opt_state->ignore_ancestry,
                                     opt_state->force, /* force_delete */
                                     opt_state->record_only,
                                     opt_state->dry_run,