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 2011/10/27 21:26:18 UTC
svn commit: r1189954 - /subversion/trunk/subversion/svn/merge-cmd.c
Author: julianfoad
Date: Thu Oct 27 19:26:17 2011
New Revision: 1189954
URL: http://svn.apache.org/viewvc?rev=1189954&view=rev
Log:
Remove unreachable code.
* subversion/svn/merge-cmd.c
(svn_cl__merge): Remove code purporting to handle a no-targets merge
command. There is always at least one target, otherwise we'd have
thrown an error earlier in the function.
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=1189954&r1=1189953&r2=1189954&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/merge-cmd.c (original)
+++ subversion/trunk/subversion/svn/merge-cmd.c Thu Oct 27 19:26:17 2011
@@ -175,28 +175,21 @@ svn_cl__merge(apr_getopt_t *os,
_("Too many arguments given"));
/* Set the default value for unspecified paths and peg revision. */
- if (targets->nelts == 0)
- {
- peg_revision1.kind = svn_opt_revision_head;
- }
- else
- {
- /* targets->nelts is 1 ("svn merge SOURCE") or 2 ("svn merge
- SOURCE WCPATH") here. */
- sourcepath2 = sourcepath1;
-
- if (peg_revision1.kind == svn_opt_revision_unspecified)
- peg_revision1.kind = svn_path_is_url(sourcepath1)
- ? svn_opt_revision_head : svn_opt_revision_working;
-
- if (targets->nelts == 2)
- {
- targetpath = APR_ARRAY_IDX(targets, 1, const char *);
- if (svn_path_is_url(targetpath))
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Cannot specify a revision range "
- "with two URLs"));
- }
+ /* targets->nelts is 1 ("svn merge SOURCE") or 2 ("svn merge
+ SOURCE WCPATH") here. */
+ sourcepath2 = sourcepath1;
+
+ if (peg_revision1.kind == svn_opt_revision_unspecified)
+ peg_revision1.kind = svn_path_is_url(sourcepath1)
+ ? svn_opt_revision_head : svn_opt_revision_working;
+
+ if (targets->nelts == 2)
+ {
+ targetpath = APR_ARRAY_IDX(targets, 1, const char *);
+ if (svn_path_is_url(targetpath))
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Cannot specify a revision range "
+ "with two URLs"));
}
}
else /* using @rev syntax */
@@ -300,10 +293,6 @@ svn_cl__merge(apr_getopt_t *os,
if (! two_sources_specified) /* TODO: Switch order of if */
{
- /* If we don't have a source, use the target as the source. */
- if (! sourcepath1)
- sourcepath1 = targetpath;
-
/* If we don't have at least one valid revision range, pick a
good one that spans the entire set of revisions on our
source. */