Split the reintegrate merge libsvn_client API into smaller pieces. Use this
in 'svn' to tell the user what the equivalent two-URL merge command would
be, or to tell the user that there is nothing to merge.

* subversion/include/svn_client.h
  (svn_client_ensure_wc_is_suitable_merge_target,
   svn_client_find_reintegrate_merge,
   svn_client_do_reintegrate_merge): New functions.

* subversion/libsvn_client/merge.c
  (find_reintegrate_merge, do_reintegrate_merge): New functions, extracted
    ...
  (merge_reintegrate_locked): ... from here.
  (svn_client_ensure_wc_is_suitable_merge_target,
   svn_client_find_reintegrate_merge,
   svn_client_do_reintegrate_merge): New wrapper functions.

* subversion/svn/merge-cmd.c
  (SVN_USE_DOS_PATHS, get_repos_relpath, quoted_repos_relpath): New macro
    and functions for printing a repository relpath in the style the user
    would need to write it on the command line.
  (get_target_and_lock_abspath, merge_reintegrate_locked,
   merge_reintegrate): New functions, implementing the reintegrate merge in
   terms of the new libsvn_client API functions.
  (svn_cl__merge): Call merge_reintegrate() instead of
    svn_client_merge_reintegrate().
--This line, and those below, will be ignored--

Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h	(revision 1211697)
+++ subversion/include/svn_client.h	(working copy)
@@ -3563,6 +3563,103 @@ svn_client_merge_peg(const char *source,
                      apr_pool_t *pool);
 
 
+/**
+ * Perform checks to determine whether of the working copy at TARGET_ABSPATH
+ * can safely be used as a merge target. Checks are performed according to
+ * the ALLOW_MIXED_REV, ALLOW_LOCAL_MODS, and ALLOW_SWITCHED_SUBTREES
+ * parameters. If any checks fail, raise SVN_ERR_CLIENT_NOT_READY_TO_MERGE.
+ *
+ * E.g. if all the ALLOW_* parameters are FALSE, TARGET_ABSPATH must
+ * be a single-revision, pristine, unswitched working copy.
+ * In other words, it must reflect a subtree of the repostiory as found
+ * at single revision -- although sparse checkouts are permitted.
+ *
+ * ### TODO: Optionally check for sparse checkouts.
+ */
+svn_error_t *
+svn_client_ensure_wc_is_suitable_merge_target(
+                                const char *target_abspath,
+                                svn_boolean_t allow_mixed_rev,
+                                svn_boolean_t allow_local_mods,
+                                svn_boolean_t allow_switched_subtrees,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *scratch_pool);
+
+/**
+ * Determine the URLs and revisions needed to perform a reintegrate merge
+ * from @a source_path_or_url at @a source_peg_revision into the working
+ * copy at @a target_abspath.  Open RA sessions to the source and target
+ * URLs.
+ *
+ * Set @a *source_ra_session_p and @a *target_ra_session_p to the new RA
+ * sessions.  Set @a *url1_p, @a *rev1_p, @a *url2_p and @a *rev2_p to the
+ * target and source URLs and revisions.  ### Inconsistent naming.
+ * Set @a *yc_ancestor_rev_p to the revision of the youngest common ancestor of
+ * the source and target.  ### TODO: Give YC URL as well for completeness?
+ *
+ * If no merge should be performed, set @a *url1_p to NULL and @a *rev1_p
+ * to #SVN_INVALID_REVNUM.
+ *
+ * The authentication baton cached in @a ctx is used to communicate with the
+ * repository.
+ *
+ * Allocate all the results in @a result_pool.  Use @a scratch_pool for
+ * temporary allocations.
+ */
+svn_error_t *
+svn_client_find_reintegrate_merge(svn_ra_session_t **source_ra_session_p,
+                                  svn_ra_session_t **target_ra_session_p,
+                                  const char **url1_p,
+                                  svn_revnum_t *rev1_p,
+                                  const char **url2_p,
+                                  svn_revnum_t *rev2_p,
+                                  svn_revnum_t *yc_ancestor_rev_p,
+                                  /* inputs */
+                                  const char *source_path_or_url,
+                                  const svn_opt_revision_t *source_peg_revision,
+                                  const char *target_abspath,
+                                  svn_client_ctx_t *ctx,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
+
+/**
+ * Perform a reintegration merge of the difference between @a url1 at @a rev1
+ * and @a url2 at @a rev2 into @a target_wcpath.  @a source_ra_session and
+ * @a target_ra_session must be sessions opened to the source URL (@a url2)
+ * and the target URL (url1) respectively.  ### Inconsistent naming.
+ *
+ * @a yc_ancestor_rev is the revision of the youngest common ancestor of
+ * the source and target.  ### TODO: Take YC URL as well for completeness?
+ *
+ * @a target_wcpath must be a single-revision, #svn_depth_infinity,
+ * pristine, unswitched working copy -- in other words, it must reflect a
+ * single revision tree, the "target".  ### depth=infinity is not checked?
+ *
+ * The mergeinfo on the source branch must reflect that all of the target
+ * has been merged into it.
+ * Then this behaves like a merge with svn_client_merge4() from the
+ * target's URL to the source.
+ *
+ * @a dry_run and @a merge_options are handled identically to
+ * svn_client_merge4().  The depth of the merge is always #svn_depth_infinity.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_do_reintegrate_merge(svn_ra_session_t *source_ra_session,
+                                svn_ra_session_t *target_ra_session,
+                                const char *url1,
+                                svn_revnum_t rev1,
+                                const char *url2,
+                                svn_revnum_t rev2,
+                                svn_revnum_t yc_ancestor_rev,
+                                const char *target_wcpath,
+                                svn_boolean_t dry_run,
+                                const apr_array_header_t *merge_options,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *scratch_pool);
+
+
 /** Set @a suggestions to an ordered array of @c const char *
  * potential merge sources (expressed as full repository URLs) for @a
  * path_or_url at @a peg_revision.  @a path_or_url is a working copy
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c	(revision 1211697)
+++ subversion/libsvn_client/merge.c	(working copy)
@@ -10500,14 +10500,38 @@ calculate_left_hand_side(const char **ur
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_client_ensure_wc_is_suitable_merge_target(const char *target_abspath,
+                                              svn_boolean_t allow_mixed_rev,
+                                              svn_boolean_t allow_local_mods,
+                                              svn_boolean_t allow_switched_subtrees,
+                                              svn_client_ctx_t *ctx,
+                                              apr_pool_t *scratch_pool)
+{
+  SVN_ERR(ensure_wc_is_suitable_merge_target(target_abspath, ctx,
+                                             allow_mixed_rev,
+                                             allow_local_mods,
+                                             allow_switched_subtrees,
+                                             scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+/* The body of svn_client_find_reintegrate_merge(), which see for details. */
 static svn_error_t *
-merge_reintegrate_locked(const char *source_path_or_url,
-                         const svn_opt_revision_t *source_peg_revision,
-                         const char *target_abspath,
-                         svn_boolean_t dry_run,
-                         const apr_array_header_t *merge_options,
-                         svn_client_ctx_t *ctx,
-                         apr_pool_t *scratch_pool)
+find_reintegrate_merge(svn_ra_session_t **source_ra_session_p,
+                       svn_ra_session_t **target_ra_session_p,
+                       const char **url1_p,
+                       svn_revnum_t *rev1_p,
+                       const char **url2_p,
+                       svn_revnum_t *rev2_p,
+                       svn_revnum_t *yc_ancestor_rev_p,
+                       /* inputs */
+                       const char *source_path_or_url,
+                       const svn_opt_revision_t *source_peg_revision,
+                       const char *target_abspath,
+                       svn_client_ctx_t *ctx,
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
 {
   url_uuid_t wc_repos_root, source_repos_root;
   svn_ra_session_t *target_ra_session;
@@ -10519,7 +10543,6 @@ merge_reintegrate_locked(const char *sou
   svn_revnum_t rev1, rev2;
   svn_mergeinfo_t unmerged_to_source_mergeinfo_catalog;
   svn_mergeinfo_t merged_to_source_mergeinfo_catalog;
-  svn_boolean_t use_sleep = FALSE;
   svn_error_t *err;
   apr_hash_t *subtrees_with_mergeinfo;
   const char *target_url;
@@ -10546,12 +10569,12 @@ merge_reintegrate_locked(const char *sou
   /* Determine the working copy target's repository root URL. */
   SVN_ERR(svn_client_get_repos_root(&wc_repos_root.url, &wc_repos_root.uuid,
                                     target_abspath,
-                                    ctx, scratch_pool, scratch_pool));
+                                    ctx, result_pool, scratch_pool));
 
   /* Determine the source's repository root URL. */
   SVN_ERR(svn_client_get_repos_root(&source_repos_root.url,
                                     &source_repos_root.uuid, url2,
-                                    ctx, scratch_pool, scratch_pool));
+                                    ctx, result_pool, scratch_pool));
 
   /* source_repos_root and wc_repos_root are required to be the same,
      as mergeinfo doesn't come into play for cross-repository merging. */
@@ -10562,15 +10585,10 @@ merge_reintegrate_locked(const char *sou
                            svn_dirent_local_style(target_abspath, scratch_pool),
                            TRUE /* strict_urls */, scratch_pool));
 
-  /* A reintegrate merge requires the merge target to reflect a subtree
-   * of the repository as found at a single revision. */
-  SVN_ERR(ensure_wc_is_suitable_merge_target(target_abspath, ctx,
-                                             FALSE, FALSE, FALSE,
-                                             scratch_pool));
   SVN_ERR(svn_wc__node_get_base_rev(&target_base_rev, ctx->wc_ctx,
                                     target_abspath, scratch_pool));
 
-  /* As the WC tree is "pure", use its last-updated-to revision as
+  /* As the WC tree is assumed "pure", use its last-updated-to revision as
      the default revision for the left side of our merge, since that's
      what the repository sub-tree is required to be up to date with
      (with regard to the WC). */
@@ -10604,13 +10622,13 @@ merge_reintegrate_locked(const char *sou
   SVN_ERR(svn_client__ra_session_from_path(&source_ra_session, &rev2, &url2,
                                            url2, NULL, source_peg_revision,
                                            source_peg_revision,
-                                           ctx, scratch_pool));
+                                           ctx, result_pool));
   SVN_ERR(svn_wc__node_get_url(&target_url, ctx->wc_ctx, target_abspath,
                                scratch_pool, scratch_pool));
   SVN_ERR(svn_client__open_ra_session_internal(&target_ra_session, NULL,
                                                target_url,
                                                NULL, NULL, FALSE, FALSE,
-                                               ctx, scratch_pool));
+                                               ctx, result_pool));
 
   SVN_ERR(calculate_left_hand_side(&url1, &rev1,
                                    &merged_to_source_mergeinfo_catalog,
@@ -10625,12 +10643,21 @@ merge_reintegrate_locked(const char *sou
                                    source_ra_session,
                                    target_ra_session,
                                    ctx,
-                                   scratch_pool, scratch_pool));
+                                   result_pool, scratch_pool));
 
   /* Did calculate_left_hand_side() decide that there was no merge to
      be performed here?  */
   if (! url1)
-    return SVN_NO_ERROR;
+    {
+      *source_ra_session_p = source_ra_session;
+      *target_ra_session_p = target_ra_session;
+      *url1_p = NULL;
+      *rev1_p = SVN_INVALID_REVNUM;
+      *url2_p = NULL;
+      *rev2_p = SVN_INVALID_REVNUM;
+      *yc_ancestor_rev_p = SVN_INVALID_REVNUM;
+      return SVN_NO_ERROR;
+    }
 
   /* If the target was moved after the source was branched from it,
      it is possible that the left URL differs from the target's current
@@ -10687,6 +10714,70 @@ merge_reintegrate_locked(const char *sou
 
   /* Left side: trunk@youngest-trunk-rev-merged-to-branch-at-specified-peg-rev
    * Right side: branch@specified-peg-revision */
+  *source_ra_session_p = source_ra_session;
+  *target_ra_session_p = target_ra_session;
+  *url1_p = url1;
+  *rev1_p = rev1;
+  *url2_p = url2;
+  *rev2_p = rev2;
+  *yc_ancestor_rev_p = yc_ancestor_rev;
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_client_find_reintegrate_merge(svn_ra_session_t **source_ra_session_p,
+                                  svn_ra_session_t **target_ra_session_p,
+                                  const char **url1_p,
+                                  svn_revnum_t *rev1_p,
+                                  const char **url2_p,
+                                  svn_revnum_t *rev2_p,
+                                  svn_revnum_t *yc_ancestor_rev_p,
+                                  /* inputs */
+                                  const char *source_path_or_url,
+                                  const svn_opt_revision_t *source_peg_revision,
+                                  const char *target_abspath,
+                                  svn_client_ctx_t *ctx,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
+{
+  SVN_ERR(find_reintegrate_merge(
+              source_ra_session_p, target_ra_session_p,
+              url1_p, rev1_p, url2_p, rev2_p,
+              yc_ancestor_rev_p,
+              source_path_or_url, source_peg_revision, target_abspath,
+              ctx, result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* */
+static svn_error_t *
+do_reintegrate_merge(svn_ra_session_t *source_ra_session,
+                     svn_ra_session_t *target_ra_session,
+                     const char *url1,
+                     svn_revnum_t rev1,
+                     const char *url2,
+                     svn_revnum_t rev2,
+                     svn_revnum_t yc_ancestor_rev,
+                     const char *target_abspath,
+                     svn_boolean_t dry_run,
+                     const apr_array_header_t *merge_options,
+                     svn_client_ctx_t *ctx,
+                     apr_pool_t *scratch_pool)
+{
+  url_uuid_t source_repos_root, wc_repos_root;
+  svn_boolean_t use_sleep = FALSE;
+  svn_error_t *err;
+
+  /* Determine the working copy target's repository root URL. */
+  SVN_ERR(svn_client_get_repos_root(&wc_repos_root.url, &wc_repos_root.uuid,
+                                    target_abspath,
+                                    ctx, scratch_pool, scratch_pool));
+
+  /* Determine the source's repository root URL. */
+  SVN_ERR(svn_client_get_repos_root(&source_repos_root.url,
+                                    &source_repos_root.uuid, url2,
+                                    ctx, scratch_pool, scratch_pool));
 
   /* Do the real merge! */
   /* ### TODO(reint): Make sure that one isn't the same line ancestor
@@ -10716,6 +10807,68 @@ merge_reintegrate_locked(const char *sou
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_client_do_reintegrate_merge(svn_ra_session_t *source_ra_session,
+                                svn_ra_session_t *target_ra_session,
+                                const char *url1,
+                                svn_revnum_t rev1,
+                                const char *url2,
+                                svn_revnum_t rev2,
+                                svn_revnum_t yc_ancestor_rev,
+                                const char *target_wc_abspath,
+                                svn_boolean_t dry_run,
+                                const apr_array_header_t *merge_options,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *scratch_pool)
+{
+  SVN_ERR(do_reintegrate_merge(
+              source_ra_session, target_ra_session,
+              url1, rev1, url2, rev2, yc_ancestor_rev,
+              target_wc_abspath, dry_run, merge_options,
+              ctx, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* */
+static svn_error_t *
+merge_reintegrate_locked(const char *source_path_or_url,
+                         const svn_opt_revision_t *source_peg_revision,
+                         const char *target_abspath,
+                         svn_boolean_t dry_run,
+                         const apr_array_header_t *merge_options,
+                         svn_client_ctx_t *ctx,
+                         apr_pool_t *scratch_pool)
+{
+  svn_ra_session_t *source_ra_session;
+  svn_ra_session_t *target_ra_session;
+  const char *url1, *url2;
+  svn_revnum_t rev1, rev2;
+  svn_revnum_t yc_ancestor_rev;
+
+  /* A reintegrate merge requires the merge target to reflect a subtree
+   * of the repository as found at a single revision. */
+  SVN_ERR(ensure_wc_is_suitable_merge_target(target_abspath, ctx,
+                                             FALSE, FALSE, FALSE,
+                                             scratch_pool));
+
+  SVN_ERR(find_reintegrate_merge(
+            &source_ra_session, &target_ra_session,
+            &url1, &rev1, &url2, &rev2, &yc_ancestor_rev,
+            source_path_or_url, source_peg_revision, target_abspath,
+            ctx, scratch_pool, scratch_pool));
+
+  if (url1)
+    {
+      SVN_ERR(do_reintegrate_merge(
+                source_ra_session, target_ra_session,
+                url1, rev1, url2, rev2, yc_ancestor_rev,
+                target_abspath,
+                dry_run, merge_options, ctx, scratch_pool));
+    }
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_client_merge_reintegrate(const char *source_path_or_url,
                              const svn_opt_revision_t *source_peg_revision,
Index: subversion/svn/merge-cmd.c
===================================================================
--- subversion/svn/merge-cmd.c	(revision 1211697)
+++ subversion/svn/merge-cmd.c	(working copy)
@@ -34,11 +34,170 @@
 #include "svn_types.h"
 #include "cl.h"
 
+#include "private/svn_wc_private.h"
 #include "svn_private_config.h"
 
 
 /*** Code. ***/
 
+#if defined(WIN32) || defined(__CYGWIN__) || defined(__OS2__)
+#define SVN_USE_DOS_PATHS
+#endif
+
+/* Set *REPOS_RELPATH to the repository path of PATH_OR_URL relative to the
+ * repository root. */
+static svn_error_t *
+get_repos_relpath(const char **repos_relpath,
+                  const char *path_or_url,
+                  svn_client_ctx_t *ctx,
+                  apr_pool_t *pool)
+{
+  const char *abspath_or_url, *url, *repos_url;
+
+  if (svn_path_is_url(path_or_url))
+    abspath_or_url = path_or_url;
+  else
+    SVN_ERR(svn_dirent_get_absolute(&abspath_or_url, path_or_url, pool));
+  SVN_ERR(svn_client_url_from_path2(&url, abspath_or_url,
+                                    ctx, pool, pool));
+  SVN_ERR(svn_client_get_repos_root(&repos_url, NULL, abspath_or_url,
+                                    ctx, pool, pool));
+  *repos_relpath = svn_uri_skip_ancestor(repos_url, url, pool);
+  return SVN_NO_ERROR;
+}
+
+/* Set *REPOS_RELPATH to the repository path of PATH_OR_URL relative to the
+ * repository root, with a "^/" (or "^^/" on Windows) prefix. */
+static svn_error_t *
+quoted_repos_relpath(const char **repos_relpath,
+                     const char *path_or_url,
+                     svn_client_ctx_t *ctx,
+                     apr_pool_t *pool)
+{
+  SVN_ERR(get_repos_relpath(repos_relpath, path_or_url, ctx, pool));
+#ifdef SVN_USE_DOS_PATHS
+  *repos_relpath = apr_psprintf(pool, "^^/%s", *repos_relpath);
+#else
+  *repos_relpath = apr_psprintf(pool, "^/%s", *repos_relpath);
+#endif
+  return SVN_NO_ERROR;
+}
+
+/* Set *TARGET_ABSPATH to the absolute path of, and *LOCK_ABSPATH to
+ the absolute path to lock for, TARGET_WCPATH. */
+static svn_error_t *
+get_target_and_lock_abspath(const char **target_abspath,
+                            const char **lock_abspath,
+                            const char *target_wcpath,
+                            svn_client_ctx_t *ctx,
+                            apr_pool_t *scratch_pool)
+{
+  svn_node_kind_t kind;
+  SVN_ERR(svn_dirent_get_absolute(target_abspath, target_wcpath,
+                                  scratch_pool));
+  SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, *target_abspath, FALSE,
+                           scratch_pool));
+  if (kind == svn_node_dir)
+    *lock_abspath = *target_abspath;
+  else
+    *lock_abspath = svn_dirent_dirname(*target_abspath, scratch_pool);
+
+  return SVN_NO_ERROR;
+}
+
+/* */
+static svn_error_t *
+merge_reintegrate_locked(const char *source_path_or_url,
+                         const svn_opt_revision_t *source_peg_revision,
+                         const char *target_wcpath,
+                         const char *target_wc_abspath,
+                         svn_boolean_t dry_run,
+                         svn_boolean_t quiet,
+                         const apr_array_header_t *merge_options,
+                         svn_client_ctx_t *ctx,
+                         apr_pool_t *scratch_pool)
+{
+  svn_ra_session_t *source_ra_session;
+  svn_ra_session_t *target_ra_session;
+  const char *url1, *url2;
+  svn_revnum_t rev1, rev2;
+  svn_revnum_t yc_ancestor_rev;
+
+  /* A reintegrate merge requires the merge target to reflect a subtree
+   * of the repository as found at a single revision. */
+  SVN_ERR(svn_client_ensure_wc_is_suitable_merge_target(target_wc_abspath,
+                                                        FALSE, FALSE, FALSE,
+                                                        ctx, scratch_pool));
+
+  SVN_ERR(svn_client_find_reintegrate_merge(
+            &source_ra_session, &target_ra_session,
+            &url1, &rev1, &url2, &rev2, &yc_ancestor_rev,
+            source_path_or_url, source_peg_revision, target_wc_abspath,
+            ctx, scratch_pool, scratch_pool));
+
+  if (url1)
+    {
+      if (! quiet)
+        {
+          const char *relpath1, *relpath2;
+
+          SVN_ERR(quoted_repos_relpath(&relpath1, url1, ctx, scratch_pool));
+          SVN_ERR(quoted_repos_relpath(&relpath2, url2, ctx, scratch_pool));
+
+          printf(_("The reintegrate merge will be equivalent to:\n"
+                   "  svn merge %s@%ld %s@%ld %s\n"),
+                 relpath1, rev1, relpath2, rev2,
+                 svn_path_local_style(target_wcpath, scratch_pool));
+        }
+
+      SVN_ERR(svn_client_do_reintegrate_merge(
+                source_ra_session, target_ra_session,
+                url1, rev1, url2, rev2, yc_ancestor_rev,
+                target_wc_abspath,
+                dry_run, merge_options, ctx, scratch_pool));
+    }
+  else
+    {
+      if (! quiet)
+        {
+          printf(_("There is nothing to reintegrate from '%s' into '%s'\n"),
+                 source_path_or_url,
+                 svn_path_local_style(target_wcpath, scratch_pool));
+        }
+    }
+
+  return SVN_NO_ERROR;
+}
+
+/* */
+static svn_error_t *
+merge_reintegrate(const char *source,
+                  const svn_opt_revision_t *peg_revision,
+                  const char *target_wcpath,
+                  svn_boolean_t dry_run,
+                  svn_boolean_t quiet,
+                  const apr_array_header_t *merge_options,
+                  svn_client_ctx_t *ctx,
+                  apr_pool_t *pool)
+{
+  const char *target_wc_abspath, *lock_abspath;
+
+  SVN_ERR(get_target_and_lock_abspath(&target_wc_abspath, &lock_abspath,
+                                      target_wcpath, ctx, pool));
+
+  if (!dry_run)
+    SVN_WC__CALL_WITH_WRITE_LOCK(
+      merge_reintegrate_locked(source, peg_revision,
+                               target_wcpath, target_wc_abspath,
+                               dry_run, quiet, merge_options, ctx, pool),
+      ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
+  else
+    SVN_ERR(merge_reintegrate_locked(source, peg_revision,
+                                     target_wcpath, target_wc_abspath,
+                                     dry_run, quiet, merge_options, ctx, pool));
+
+  return SVN_NO_ERROR;
+}
 
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
@@ -293,11 +452,9 @@ svn_cl__merge(apr_getopt_t *os,
 
   if (opt_state->reintegrate)
     {
-      err = svn_client_merge_reintegrate(sourcepath1,
-                                         &peg_revision1,
-                                         targetpath,
-                                         opt_state->dry_run,
-                                         options, ctx, pool);
+      err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
+                              opt_state->dry_run, opt_state->quiet,
+                              options, ctx, pool);
     }
   else if (! two_sources_specified)
     {
