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 2009/12/21 12:16:12 UTC

svn commit: r892767 - in /subversion/trunk/subversion/svn: main.c merge-cmd.c

Author: julianfoad
Date: Mon Dec 21 11:16:11 2009
New Revision: 892767

URL: http://svn.apache.org/viewvc?rev=892767&view=rev
Log:
Move some command-line argument checking for the "svn merge" command from
"main.c" to "merge-cmd.c", because it is specific to that one command.

* subversion/svn/main.c
  (main): Fix two comments. Move the check for revisions being specified
    with the "--reintegrate" option from here ...

* subversion/svn/merge-cmd.c
  (svn_cl__merge): ... to here.

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

Modified: subversion/trunk/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=892767&r1=892766&r2=892767&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Mon Dec 21 11:16:11 2009
@@ -1786,7 +1786,7 @@
         }
     }
 
-  /* Only merge supports multiple revisions/revision ranges. */
+  /* Only merge and log support multiple revisions/revision ranges. */
   if (subcommand->cmd_func != svn_cl__merge
       && subcommand->cmd_func != svn_cl__log)
     {
@@ -1800,17 +1800,6 @@
         }
     }
 
-  /* Merge doesn't support specifying a revision range
-     when using --reintegrate. */
-  if (subcommand->cmd_func == svn_cl__merge
-      && opt_state.revision_ranges->nelts
-      && opt_state.reintegrate)
-    {
-      err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                             _("-r and -c can't be used with --reintegrate"));
-      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-    }
-
   /* Disallow simultaneous use of both --depth and --set-depth. */
   if ((opt_state.depth != svn_depth_unknown)
       && (opt_state.set_depth != svn_depth_unknown))
@@ -1850,7 +1839,7 @@
       return svn_cmdline_handle_exit_error(err, pool, "svn: ");
     }
 
-  /* Ensure that 'revision_ranges' has at least one item, and that
+  /* Ensure that 'revision_ranges' has at least one item, and make
      'start_revision' and 'end_revision' match that item. */
   if (opt_state.revision_ranges->nelts == 0)
     {

Modified: subversion/trunk/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/merge-cmd.c?rev=892767&r1=892766&r2=892767&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Mon Dec 21 11:16:11 2009
@@ -56,6 +56,15 @@
     peg_revision2;
   apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
 
+  /* Merge doesn't support specifying a revision or revision range
+     when using --reintegrate. */
+  if (opt_state->reintegrate
+      && opt_state->start_revision.kind != svn_opt_revision_unspecified)
+    {
+      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                              _("-r and -c can't be used with --reintegrate"));
+    }
+
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
                                                       ctx, pool));