You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/27 23:49:13 UTC

svn commit: r990282 - /subversion/trunk/subversion/libsvn_client/copy.c

Author: hwright
Date: Fri Aug 27 21:49:13 2010
New Revision: 990282

URL: http://svn.apache.org/viewvc?rev=990282&view=rev
Log:
Shuffle around some verification code shared by the copy/move implementation.

* subversion/libsvn_client/copy.c
  (verify_wc_srcs_and_dsts): New.
  (wc_to_wc_copy): Remove.
  (try_copy): Move conditional on is_move to here.

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=990282&r1=990281&r2=990282&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Fri Aug 27 21:49:13 2010
@@ -445,12 +445,10 @@ do_wc_to_wc_moves(const apr_array_header
 
 
 static svn_error_t *
-wc_to_wc_copy(const apr_array_header_t *copy_pairs,
-              const char *dst_path,
-              svn_boolean_t is_move,
-              svn_boolean_t make_parents,
-              svn_client_ctx_t *ctx,
-              apr_pool_t *pool)
+verify_wc_srcs_and_dsts(const apr_array_header_t *copy_pairs,
+                        svn_boolean_t make_parents,
+                        svn_client_ctx_t *ctx,
+                        apr_pool_t *pool)
 {
   int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
@@ -507,11 +505,7 @@ wc_to_wc_copy(const apr_array_header_t *
 
   svn_pool_destroy(iterpool);
 
-  /* Copy or move all targets. */
-  if (is_move)
-    return do_wc_to_wc_moves(copy_pairs, dst_path, ctx, pool);
-  else
-    return do_wc_to_wc_copies(copy_pairs, ctx, pool);
+  return SVN_NO_ERROR;
 }
 
 
@@ -2155,9 +2149,14 @@ try_copy(const apr_array_header_t *sourc
   /* Now, call the right handler for the operation. */
   if ((! srcs_are_urls) && (! dst_is_url))
     {
-      return svn_error_return(
-        wc_to_wc_copy(copy_pairs, dst_path_in, is_move, make_parents, ctx,
-                      pool));
+      SVN_ERR(verify_wc_srcs_and_dsts(copy_pairs, make_parents, ctx, pool));
+
+      /* Copy or move all targets. */
+      if (is_move)
+        return svn_error_return(do_wc_to_wc_moves(copy_pairs, dst_path_in, ctx,
+                                                  pool));
+      else
+        return svn_error_return(do_wc_to_wc_copies(copy_pairs, ctx, pool));
     }
   else if ((! srcs_are_urls) && (dst_is_url))
     {