You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/06/29 17:06:35 UTC

svn commit: r959004 - /subversion/trunk/subversion/svn/merge-cmd.c

Author: cmpilato
Date: Tue Jun 29 15:06:35 2010
New Revision: 959004

URL: http://svn.apache.org/viewvc?rev=959004&view=rev
Log:
Flag another case of invalid merge input.

* subversion/svn/merge-cmd.c
  (svn_cl__merge): Move some input validation up a bit, and now check
    for folks trying to use --reintegrate with two merge sources, too.

Modified:
    subversion/trunk/subversion/svn/merge-cmd.c

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=959004&r1=959003&r2=959004&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Tue Jun 29 15:06:35 2010
@@ -280,6 +280,25 @@ svn_cl__merge(apr_getopt_t *os,
   else
     options = NULL;
 
+  /* More input validation. */
+  if (opt_state->reintegrate)
+    {
+      if (opt_state->depth != svn_depth_unknown)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--depth cannot be used with "
+                                  "--reintegrate"));
+
+      if (opt_state->force)
+        return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                _("--force cannot be used with "
+                                  "--reintegrate"));
+
+      if (two_sources_specified)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--reintegrate can only be used with "
+                                  "a single merge source"));
+    }
+
   if (! two_sources_specified) /* TODO: Switch order of if */
     {
       /* If we don't have a source, use the target as the source. */
@@ -301,23 +320,11 @@ svn_cl__merge(apr_getopt_t *os,
         }
 
       if (opt_state->reintegrate)
-        {
-          if (opt_state->depth != svn_depth_unknown)
-            return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                    _("--depth cannot be used with "
-                                      "--reintegrate"));
-
-          if (opt_state->force)
-            return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                    _("--force cannot be used with "
-                                      "--reintegrate"));
-
-          err = svn_client_merge_reintegrate(sourcepath1,
-                                             &peg_revision1,
-                                             targetpath,
-                                             opt_state->dry_run,
-                                             options, ctx, pool);
-        }
+        err = svn_client_merge_reintegrate(sourcepath1,
+                                           &peg_revision1,
+                                           targetpath,
+                                           opt_state->dry_run,
+                                           options, ctx, pool);
       else
         err = svn_client_merge_peg3(sourcepath1,
                                     ranges_to_merge,