Enable symmetric merge as the default merge in 'svn'.  If the --reintegrate
option is given but a non-reintegrate merge is the kind needed, bail out.
Stop recognizing the '--symmetric' option, as that was a temporary
development tool.

### This patch should be extended to delete the '--symmetric' option and to
### update the merge help text.

* subversion/include/private/svn_client_private.h
  (svn_client__symmetric_merge_t): Move structure definition to here ...

* subversion/libsvn_client/merge.c
  (svn_client__symmetric_merge_t): ... from here.
  (do_symmetric_merge_locked): Reject unsupported options in reintegrate
    mode.

* subversion/svn/merge-cmd.c
  (pathrev_equal): New function.
  (symmetric_merge): Bail out if a non-reintegrate kind of merge is needed
    but the '--reintegrate' option was specified. Reject unsupported options
    in reintegrate mode.
  (svn_cl__merge): 

--This line, and those below, will be ignored--

Index: subversion/include/private/svn_client_private.h
===================================================================
--- subversion/include/private/svn_client_private.h	(revision 1368758)
+++ subversion/include/private/svn_client_private.h	(working copy)
@@ -185,7 +185,10 @@ svn_client__wc_node_get_origin(svn_clien
 #ifdef SVN_WITH_SYMMETRIC_MERGE
 
 /* Details of a symmetric merge. */
-typedef struct svn_client__symmetric_merge_t svn_client__symmetric_merge_t;
+typedef struct svn_client__symmetric_merge_t
+{
+  svn_client__pathrev_t *yca, *base, *mid, *right;
+} svn_client__symmetric_merge_t;
 
 /* Find the information needed to merge all unmerged changes from a source
  * branch into a target branch.  The information is the locations of the
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c	(revision 1368758)
+++ subversion/libsvn_client/merge.c	(working copy)
@@ -11149,12 +11149,6 @@ location_on_branch_at_rev(const branch_h
   return NULL;
 }
 
-/* Details of a symmetric merge. */
-struct svn_client__symmetric_merge_t
-{
-  svn_client__pathrev_t *yca, *base, *mid, *right;
-};
-
 /* */
 typedef struct source_and_target_t
 {
@@ -11654,6 +11648,24 @@ do_symmetric_merge_locked(const svn_clie
       svn_ra_session_t *right_ra_session = NULL;
       svn_ra_session_t *target_ra_session = NULL;
 
+      if (record_only)
+        return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the record-only option "
+                                  "cannot be used with this kind of merge"));
+
+      if (depth != svn_depth_unknown)
+        return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the depth option "
+                                  "cannot be used with this kind of merge"));
+
+      if (force)
+        return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the force option "
+                                  "cannot be used with this kind of merge"));
+
       SVN_ERR(ensure_ra_session_url(&base_ra_session, merge->base->url,
                                     ctx, scratch_pool));
       SVN_ERR(ensure_ra_session_url(&right_ra_session, merge->right->url,
Index: subversion/svn/merge-cmd.c
===================================================================
--- subversion/svn/merge-cmd.c	(revision 1368758)
+++ subversion/svn/merge-cmd.c	(working copy)
@@ -85,6 +85,15 @@ merge_reintegrate(const char *source_pat
   return SVN_NO_ERROR;
 }
 
+/*  */
+static svn_boolean_t
+pathrev_equal(const svn_client__pathrev_t *pathrev1,
+              const svn_client__pathrev_t *pathrev2)
+{
+  return (pathrev1->rev == pathrev2->rev
+          && strcmp(pathrev1->url, pathrev2->url) == 0);
+}
+
 /* Throw an error if PATH_OR_URL is a path and REVISION isn't a repository
  * revision. */
 static svn_error_t *
@@ -116,13 +125,15 @@ symmetric_merge(const char *source_path_
                 svn_boolean_t record_only,
                 svn_boolean_t dry_run,
                 svn_boolean_t allow_mixed_rev,
-                svn_boolean_t allow_local_mods,
-                svn_boolean_t allow_switched_subtrees,
+                svn_boolean_t reintegrate,
                 const apr_array_header_t *merge_options,
                 svn_client_ctx_t *ctx,
                 apr_pool_t *scratch_pool)
 {
+  svn_boolean_t allow_local_mods = ! reintegrate;
+  svn_boolean_t allow_switched_subtrees = ! reintegrate;
   svn_client__symmetric_merge_t *merge;
+  svn_boolean_t reintegrate_like;
 
   /* Find the 3-way merges needed (and check suitability of the WC). */
   SVN_ERR(svn_client__find_symmetric_merge(&merge,
@@ -131,5 +142,41 @@ symmetric_merge(const char *source_path_
                                            allow_local_mods, allow_switched_subtrees,
                                            ctx, scratch_pool, scratch_pool));
 
+  reintegrate_like = (merge->mid != NULL);
+
+  if (reintegrate && ! reintegrate_like
+      && ! pathrev_equal(merge->yca, merge->base))
+    {
+      return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The --reintegrate option was given but the "
+                                  "required merge is not reintegrate-like"));
+    }
+  if (reintegrate_like)
+    {
+      if (record_only)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --record-only option "
+                                  "cannot be used with this kind of merge"));
+
+      if (depth != svn_depth_unknown)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --depth option "
+                                  "cannot be used with this kind of merge"));
+
+      if (force)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --force option "
+                                  "cannot be used with this kind of merge"));
+
+      if (allow_mixed_rev)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("The required merge is reintegrate-like, "
+                                  "and the --allow-mixed-revisions option "
+                                  "cannot be used with this kind of merge"));
+    }
+
   /* Perform the 3-way merges */
   SVN_ERR(svn_client__do_symmetric_merge(merge, target_wcpath, depth,
@@ -405,19 +452,11 @@ svn_cl__merge(apr_getopt_t *os,
    * If any conflicts occur we'll run the conflict resolver later. */
 
 #ifdef SVN_WITH_SYMMETRIC_MERGE
-  if (opt_state->symmetric_merge)
+  /* Do a symmetric merge if just one source and no revisions. */
+  if ((! two_sources_specified) && (! opt_state->ignore_ancestry)
+      && first_range_start.kind == svn_opt_revision_unspecified
+      && first_range_end.kind == svn_opt_revision_unspecified)
     {
-      svn_boolean_t allow_local_mods = ! opt_state->reintegrate;
-      svn_boolean_t allow_switched_subtrees = ! opt_state->reintegrate;
-
-      if (two_sources_specified)
-        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("SOURCE2 can't be used with --symmetric"));
-      if (first_range_start.kind != svn_opt_revision_unspecified
-          || first_range_end.kind != svn_opt_revision_unspecified)
-        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                _("a revision range can't be used with --symmetric"));
-
       SVN_ERR_W(svn_cl__check_related_source_and_target(
                   sourcepath1, &peg_revision1, targetpath, &unspecified,
                   ctx, pool),
@@ -430,8 +469,7 @@ svn_cl__merge(apr_getopt_t *os,
                                   opt_state->record_only,
                                   opt_state->dry_run,
                                   opt_state->allow_mixed_rev,
-                                  allow_local_mods,
-                                  allow_switched_subtrees,
+                                  opt_state->reintegrate,
                                   options, ctx, pool);
     }
   else
