You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/01/29 18:12:36 UTC

svn commit: r1655750 - /subversion/branches/pin-externals/subversion/libsvn_client/copy.c

Author: stsp
Date: Thu Jan 29 17:12:36 2015
New Revision: 1655750

URL: http://svn.apache.org/r1655750
Log:
On the pin-externals branch, checkout externals from the correct revisions
during a repos->WC copy. Before this change, the externals properties were
pinned after externals were already checked out.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy_single): Ignore externals during the internal checkout
   of the copied directory. Update all externals after pinning them.

Modified:
    subversion/branches/pin-externals/subversion/libsvn_client/copy.c

Modified: subversion/branches/pin-externals/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/copy.c?rev=1655750&r1=1655749&r2=1655750&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/copy.c Thu Jan 29 17:12:36 2015
@@ -2133,6 +2133,14 @@ repos_to_wc_copy_single(svn_boolean_t *t
             ctx->notify_func2 = notification_adjust_func;
             ctx->notify_baton2 = &nb;
 
+            /* Avoid a chicken-and-egg problem:
+             * If pinning externals we'll need to adjust externals
+             * properties before checking out any externals.
+             * But copy needs to happen before pinning because else there
+             * are no svn:externals properties to pin. */
+            if (pin_externals)
+              ignore_externals = TRUE;
+
             err = svn_client__checkout_internal(&pair->src_revnum, timestamp_sleep,
                                                 pair->src_original,
                                                 tmp_abspath,
@@ -2192,6 +2200,8 @@ repos_to_wc_copy_single(svn_boolean_t *t
           apr_hash_index_t *hi;
           apr_pool_t *iterpool;
           const char *repos_root_url;
+          apr_hash_t *new_externals;
+          apr_hash_t *new_depths;
 
           SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url, pool));
           SVN_ERR(resolve_pinned_externals(&pinned_externals, pair,
@@ -2219,6 +2229,21 @@ repos_to_wc_copy_single(svn_boolean_t *t
                                        NULL, NULL, /* no extra notification */
                                        iterpool));
             }
+
+          /* Now update all externals in the newly created copy. */
+          SVN_ERR(svn_wc__externals_gather_definitions(&new_externals,
+                                                       &new_depths,
+                                                       ctx->wc_ctx,
+                                                       dst_abspath,
+                                                       svn_depth_infinity,
+                                                       iterpool, iterpool));
+          SVN_ERR(svn_client__handle_externals(new_externals,
+                                               new_depths,
+                                               repos_root_url, dst_abspath,
+                                               svn_depth_infinity,
+                                               timestamp_sleep,
+                                               ra_session,
+                                               ctx, iterpool));
           svn_pool_destroy(iterpool);
         }
     } /* end directory case */