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 2010/10/01 15:16:53 UTC
svn commit: r1003529 - /subversion/trunk/subversion/libsvn_client/copy.c
Author: julianfoad
Date: Fri Oct 1 13:16:53 2010
New Revision: 1003529
URL: http://svn.apache.org/viewvc?rev=1003529&view=rev
Log:
* subversion/libsvn_client/copy.c
(try_copy): Move and comment a bit of code, for clarity.
Modified:
subversion/trunk/subversion/libsvn_client/copy.c
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1003529&r1=1003528&r2=1003529&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Fri Oct 1 13:16:53 2010
@@ -2027,29 +2027,28 @@ try_copy(const apr_array_header_t *sourc
if (is_move)
{
- if (srcs_are_urls == dst_is_url)
+ /* Disallow moves between the working copy and the repository. */
+ if (srcs_are_urls != dst_is_url)
{
- for (i = 0; i < copy_pairs->nelts; i++)
- {
- svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
- svn_client__copy_pair_t *);
-
- if (strcmp(pair->src_abspath_or_url,
- pair->dst_abspath_or_url) == 0)
- return svn_error_createf
- (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Cannot move path '%s' into itself"),
- svn_dirent_local_style(pair->src_abspath_or_url, pool));
- }
- }
- else
- {
- /* Disallow moves between the working copy and the repository. */
return svn_error_create
(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Moves between the working copy and the repository are not "
"supported"));
}
+
+ /* Disallow moving any path onto or into itself. */
+ for (i = 0; i < copy_pairs->nelts; i++)
+ {
+ svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
+ svn_client__copy_pair_t *);
+
+ if (strcmp(pair->src_abspath_or_url,
+ pair->dst_abspath_or_url) == 0)
+ return svn_error_createf
+ (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("Cannot move path '%s' into itself"),
+ svn_dirent_local_style(pair->src_abspath_or_url, pool));
+ }
}
else
{