Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/client.h?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/client.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/client.h Mon 
Feb 16 17:40:07 2015
@@ -1208,6 +1208,41 @@ svn_client__arbitrary_nodes_diff(const c
                                  apr_pool_t *scratch_pool);
 
 
+/* Helper for the remote case of svn_client_propget.
+ *
+ * If PROPS is not null, then get the value of property PROPNAME in
+ * REVNUM, using RA_SESSION.  Store the value ('svn_string_t *') in
+ * PROPS, under the path key "TARGET_PREFIX/TARGET_RELATIVE"
+ * ('const char *').
+ *
+ * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a
+ * depth-first ordered array of svn_prop_inherited_item_t * structures
+ * representing the PROPNAME properties inherited by the target.  If
+ * INHERITABLE_PROPS in not null and no inheritable properties are found,
+ * then set *INHERITED_PROPS to an empty array.
+ *
+ * Recurse according to DEPTH, similarly to svn_client_propget3().
+ *
+ * KIND is the kind of the node at "TARGET_PREFIX/TARGET_RELATIVE".
+ * Yes, caller passes this; it makes the recursion more efficient :-).
+ *
+ * Allocate PROPS and *INHERITED_PROPS in RESULT_POOL, but do all temporary
+ * work in SCRATCH_POOL.  The two pools can be the same; recursive
+ * calls may use a different SCRATCH_POOL, however.
+ */
+svn_error_t *
+svn_client__remote_propget(apr_hash_t *props,
+                           apr_array_header_t **inherited_props,
+                           const char *propname,
+                           const char *target_prefix,
+                           const char *target_relative,
+                           svn_node_kind_t kind,
+                           svn_revnum_t revnum,
+                           svn_ra_session_t *ra_session,
+                           svn_depth_t depth,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/commit.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/commit.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/commit.c Mon 
Feb 16 17:40:07 2015
@@ -242,8 +242,8 @@ post_process_commit_item(svn_wc_committe
   remove_lock = (! keep_locks && (item->state_flags
                                        & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN));
 
-  /* When the node was deleted (or replaced), we need to always remove the 
-     locks, as they're invalidated on the server. We cannot honor the 
+  /* When the node was deleted (or replaced), we need to always remove the
+     locks, as they're invalidated on the server. We cannot honor the
      SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN flag here because it does not tell
      us whether we have locked children. */
   if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
@@ -252,7 +252,7 @@ post_process_commit_item(svn_wc_committe
   return svn_error_trace(
          svn_wc_queue_committed4(queue, wc_ctx, item->path,
                                  loop_recurse,
-                                 0 != (item->state_flags & 
+                                 0 != (item->state_flags &
                                        (SVN_CLIENT_COMMIT_ITEM_ADD
                                         | SVN_CLIENT_COMMIT_ITEM_DELETE
                                         | SVN_CLIENT_COMMIT_ITEM_TEXT_MODS

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_client/commit_util.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/commit_util.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/commit_util.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/commit_util.c 
Mon Feb 16 17:40:07 2015
@@ -1559,7 +1559,7 @@ do_item_commit(void **dir_baton,
     file_pool = pool;
 
   /* Subpools are cheap, but memory isn't */
-  file_pool = svn_pool_create(file_pool); 
+  file_pool = svn_pool_create(file_pool);
 
   /* Call the cancellation function. */
   if (ctx->cancel_func)

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c Mon Feb 
16 17:40:07 2015
@@ -177,12 +177,486 @@ get_copy_pair_ancestors(const apr_array_
   return SVN_NO_ERROR;
 }
 
+/* Quote a string if it would be handled as multiple or different tokens
+   during externals parsing */
+static const char *
+maybe_quote(const char *value,
+            apr_pool_t *result_pool)
+{
+  apr_status_t status;
+  char **argv;
+
+  status = apr_tokenize_to_argv(value, &argv, result_pool);
+
+  if (!status && argv[0] && !argv[1] && strcmp(argv[0], value) == 0)
+    return apr_pstrdup(result_pool, value);
+
+  {
+    svn_stringbuf_t *sb = svn_stringbuf_create_empty(result_pool);
+    const char *c;
+
+    svn_stringbuf_appendbyte(sb, '\"');
+
+    for (c = value; *c; c++)
+      {
+        if (*c == '\\' || *c == '\"' || *c == '\'')
+          svn_stringbuf_appendbyte(sb, '\\');
+
+        svn_stringbuf_appendbyte(sb, *c);
+      }
+
+    svn_stringbuf_appendbyte(sb, '\"');
+
+#ifdef SVN_DEBUG
+    status = apr_tokenize_to_argv(sb->data, &argv, result_pool);
+
+    SVN_ERR_ASSERT_NO_RETURN(!status && argv[0] && !argv[1]
+                             && !strcmp(argv[0], value));
+#endif
+
+    return sb->data;
+  }
+}
+
+/* In *NEW_EXTERNALS_DESCRIPTION, return a new external description for
+ * use as a line in an svn:externals property, based on the external item
+ * ITEM and the additional parser information in INFO. Pin the external
+ * to EXTERNAL_PEGREV. Use POOL for all allocations. */
+static svn_error_t *
+make_external_description(const char **new_external_description,
+                          const char *local_abspath_or_url,
+                          svn_wc_external_item2_t *item,
+                          svn_wc__externals_parser_info_t *info,
+                          svn_opt_revision_t external_pegrev,
+                          apr_pool_t *pool)
+{
+  const char *rev_str;
+  const char *peg_rev_str;
+
+  switch (info->format)
+    {
+      case svn_wc__external_description_format_1:
+        if (external_pegrev.kind == svn_opt_revision_unspecified)
+          {
+            /* If info->rev_str is NULL, this yields an empty string. */
+            rev_str = apr_pstrcat(pool, info->rev_str, " ", SVN_VA_NULL);
+          }
+        else if (info->rev_str && item->revision.kind != svn_opt_revision_head)
+          rev_str = apr_psprintf(pool, "%s ", info->rev_str);
+        else
+          {
+            /* ### can't handle svn_opt_revision_date without info->rev_str */
+            SVN_ERR_ASSERT(external_pegrev.kind == svn_opt_revision_number);
+            rev_str = apr_psprintf(pool, "-r%ld ",
+                                   external_pegrev.value.number);
+          }
+
+        *new_external_description =
+          apr_psprintf(pool, "%s %s%s\n", maybe_quote(item->target_dir, pool),
+                                          rev_str,
+                                          maybe_quote(item->url, pool));
+        break;
+
+      case svn_wc__external_description_format_2:
+        if (external_pegrev.kind == svn_opt_revision_unspecified)
+          {
+            /* If info->rev_str is NULL, this yields an empty string. */
+            rev_str = apr_pstrcat(pool, info->rev_str, " ", SVN_VA_NULL);
+          }
+        else if (info->rev_str && item->revision.kind != svn_opt_revision_head)
+          rev_str = apr_psprintf(pool, "%s ", info->rev_str);
+        else
+          rev_str = "";
+
+        if (external_pegrev.kind == svn_opt_revision_unspecified)
+          peg_rev_str = info->peg_rev_str ? info->peg_rev_str : "";
+        else if (info->peg_rev_str &&
+                 item->peg_revision.kind != svn_opt_revision_head)
+          peg_rev_str = info->peg_rev_str;
+        else
+          {
+            /* ### can't handle svn_opt_revision_date without info->rev_str */
+            SVN_ERR_ASSERT(external_pegrev.kind == svn_opt_revision_number);
+            peg_rev_str = apr_psprintf(pool, "@%ld",
+                                       external_pegrev.value.number);
+          }
+
+        *new_external_description =
+          apr_psprintf(pool, "%s%s %s\n", rev_str,
+                       maybe_quote(apr_psprintf(pool, "%s%s", item->url,
+                                                peg_rev_str),
+                                   pool),
+                       maybe_quote(item->target_dir, pool));
+        break;
+
+      default:
+        return svn_error_createf(
+                 SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION, NULL,
+                 _("%s property defined at '%s' is using an unsupported "
+                   "syntax"), SVN_PROP_EXTERNALS,
+                 svn_dirent_local_style(local_abspath_or_url, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+/* Pin all externals listed in EXTERNALS_PROP_VAL to their last-changed
+ * revision. Return a new property value in *PINNED_EXTERNALS allocated
+ * in RESULT_POOL. LOCAL_ABSPATH_OR_URL is the path or URL defining the
+ * svn:externals property. Use SCRATCH_POOL for temporary allocations.
+ */
+static svn_error_t *
+pin_externals_prop(svn_string_t **pinned_externals,
+                   svn_string_t *externals_prop_val,
+                   const apr_hash_t *externals_to_pin,
+                   const char *repos_root_url,
+                   const char *local_abspath_or_url,
+                   svn_client_ctx_t *ctx,
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
+{
+  svn_stringbuf_t *buf;
+  apr_array_header_t *external_items;
+  apr_array_header_t *parser_infos;
+  apr_array_header_t *items_to_pin;
+  int i;
+  apr_pool_t *iterpool;
+
+  SVN_ERR(svn_wc__parse_externals_description(&external_items,
+                                              &parser_infos,
+                                              local_abspath_or_url,
+                                              externals_prop_val->data,
+                                              FALSE /* canonicalize_url */,
+                                              scratch_pool));
+
+  if (externals_to_pin)
+    items_to_pin = svn_hash_gets((apr_hash_t *)externals_to_pin,
+                                 local_abspath_or_url);
+  else
+    items_to_pin = NULL;
+
+  buf = svn_stringbuf_create_empty(scratch_pool);
+  iterpool = svn_pool_create(scratch_pool);
+  for (i = 0; i < external_items->nelts; i++)
+    {
+      svn_wc_external_item2_t *item;
+      svn_wc__externals_parser_info_t *info;
+      svn_opt_revision_t external_pegrev;
+      const char *pinned_desc;
+
+      svn_pool_clear(iterpool);
+
+      item = APR_ARRAY_IDX(external_items, i, svn_wc_external_item2_t *);
+      info = APR_ARRAY_IDX(parser_infos, i, svn_wc__externals_parser_info_t *);
+
+      if (items_to_pin)
+        {
+          int j;
+          svn_wc_external_item2_t *item_to_pin = NULL;
+
+          for (j = 0; j < items_to_pin->nelts; j++)
+            {
+              svn_wc_external_item2_t *const current =
+                APR_ARRAY_IDX(items_to_pin, j, svn_wc_external_item2_t *);
+
+
+              if (current
+                  && 0 == strcmp(item->url, current->url)
+                  && 0 == strcmp(item->target_dir, current->target_dir))
+                {
+                  item_to_pin = current;
+                  break;
+                }
+            }
+
+          /* If this item is not in our list of external items to pin then
+           * simply keep the external at its original value. */
+          if (!item_to_pin)
+            {
+              const char *desc;
+
+              external_pegrev.kind = svn_opt_revision_unspecified;
+              SVN_ERR(make_external_description(&desc, local_abspath_or_url,
+                                                item, info, external_pegrev,
+                                                iterpool));
+              svn_stringbuf_appendcstr(buf, desc);
+              continue;
+            }
+        }
+
+      if (item->peg_revision.kind == svn_opt_revision_date)
+        {
+          external_pegrev.kind = svn_opt_revision_date;
+          external_pegrev.value.date = item->peg_revision.value.date;
+        }
+      else if (item->peg_revision.kind == svn_opt_revision_number)
+        {
+          external_pegrev.kind = svn_opt_revision_number;
+          external_pegrev.value.number = item->peg_revision.value.number;
+        }
+      else
+        {
+          SVN_ERR_ASSERT(
+            item->peg_revision.kind == svn_opt_revision_head ||
+            item->peg_revision.kind == svn_opt_revision_unspecified);
+
+          if (svn_path_is_url(local_abspath_or_url))
+            {
+              const char *resolved_url;
+              svn_ra_session_t *external_ra_session;
+              svn_revnum_t latest_revnum;
+
+              SVN_ERR(svn_wc__resolve_relative_external_url(
+                        &resolved_url, item, repos_root_url,
+                        local_abspath_or_url, iterpool, iterpool));
+              
SVN_ERR(svn_client__open_ra_session_internal(&external_ra_session,
+                                                           NULL, resolved_url,
+                                                           NULL, NULL, FALSE,
+                                                           FALSE, ctx,
+                                                           iterpool,
+                                                           iterpool));
+              SVN_ERR(svn_ra_get_latest_revnum(external_ra_session,
+                                               &latest_revnum,
+                                               iterpool));
+
+              external_pegrev.kind = svn_opt_revision_number;
+              external_pegrev.value.number = latest_revnum;
+            }
+          else
+            {
+              const char *external_abspath;
+              svn_node_kind_t external_kind;
+              svn_revnum_t external_checked_out_rev;
+
+              external_abspath = svn_dirent_join(local_abspath_or_url,
+                                                 item->target_dir,
+                                                 iterpool);
+              SVN_ERR(svn_wc__read_external_info(&external_kind, NULL, NULL,
+                                                 NULL, NULL, ctx->wc_ctx,
+                                                 local_abspath_or_url,
+                                                 external_abspath, TRUE,
+                                                 iterpool,
+                                                 iterpool));
+              if (external_kind == svn_node_none)
+                return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS,
+                                         NULL,
+                                         _("Cannot pin external '%s' defined "
+                                           "in %s at '%s' because it is not "
+                                           "checked out in the working copy "
+                                           "at '%s'"),
+                                           item->url, SVN_PROP_EXTERNALS,
+                                           svn_dirent_local_style(
+                                             local_abspath_or_url, iterpool),
+                                           svn_dirent_local_style(
+                                             external_abspath, iterpool));
+              else if (external_kind == svn_node_dir)
+                {
+                  svn_boolean_t is_switched;
+                  svn_boolean_t is_modified;
+                  svn_revnum_t min_rev;
+                  svn_revnum_t max_rev;
+
+                  /* Perform some sanity checks on the checked-out external. */
+
+                  SVN_ERR(svn_wc__has_switched_subtrees(&is_switched,
+                                                        ctx->wc_ctx,
+                                                        external_abspath, NULL,
+                                                        iterpool));
+                  if (is_switched)
+                    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS,
+                                             NULL,
+                                             _("Cannot pin external '%s' 
defined "
+                                               "in %s at '%s' because '%s' has 
"
+                                               "switched subtrees (switches "
+                                               "cannot be represented in %s)"),
+                                             item->url, SVN_PROP_EXTERNALS,
+                                             svn_dirent_local_style(
+                                               local_abspath_or_url, iterpool),
+                                             svn_dirent_local_style(
+                                               external_abspath, iterpool),
+                                             SVN_PROP_EXTERNALS);
+
+                  SVN_ERR(svn_wc__has_local_mods(&is_modified, ctx->wc_ctx,
+                                                 external_abspath,
+                                                 ctx->cancel_func,
+                                                 ctx->cancel_baton,
+                                                 iterpool));
+                  if (is_modified)
+                    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS,
+                                             NULL,
+                                             _("Cannot pin external '%s' 
defined "
+                                               "in %s at '%s' because '%s' has 
"
+                                               "local modifications (local "
+                                               "modifications cannot be "
+                                               "represented in %s)"),
+                                             item->url, SVN_PROP_EXTERNALS,
+                                             svn_dirent_local_style(
+                                               local_abspath_or_url, iterpool),
+                                             svn_dirent_local_style(
+                                               external_abspath, iterpool),
+                                             SVN_PROP_EXTERNALS);
+
+                  SVN_ERR(svn_wc__min_max_revisions(&min_rev, &max_rev, 
ctx->wc_ctx,
+                                                    external_abspath, FALSE,
+                                                    iterpool));
+                  if (min_rev != max_rev)
+                    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS,
+                                             NULL,
+                                             _("Cannot pin external '%s' 
defined "
+                                               "in %s at '%s' because '%s' is 
a "
+                                               "mixed-revision working copy "
+                                               "(mixed-revisions cannot be "
+                                               "represented in %s)"),
+                                             item->url, SVN_PROP_EXTERNALS,
+                                             svn_dirent_local_style(
+                                               local_abspath_or_url, iterpool),
+                                             svn_dirent_local_style(
+                                               external_abspath, iterpool),
+                                             SVN_PROP_EXTERNALS);
+                  external_checked_out_rev = min_rev;
+                }
+              else
+                {
+                  SVN_ERR_ASSERT(external_kind == svn_node_file);
+                  
SVN_ERR(svn_wc__node_get_repos_info(&external_checked_out_rev,
+                                                      NULL, NULL, NULL,
+                                                      ctx->wc_ctx, 
external_abspath,
+                                                      iterpool, iterpool));
+                }
+
+              external_pegrev.kind = svn_opt_revision_number;
+              external_pegrev.value.number = external_checked_out_rev;
+            }
+        }
+
+      SVN_ERR_ASSERT(external_pegrev.kind == svn_opt_revision_date ||
+                     external_pegrev.kind == svn_opt_revision_number);
+
+      SVN_ERR(make_external_description(&pinned_desc, local_abspath_or_url,
+                                        item, info, external_pegrev, 
iterpool));
+
+      svn_stringbuf_appendcstr(buf, pinned_desc);
+    }
+  svn_pool_destroy(iterpool);
+
+  *pinned_externals = svn_string_create_from_buf(buf, result_pool);
+
+  return SVN_NO_ERROR;
+}
+
+/* Return, in *NEW_EXTERNALS, a new hash of externals definitions, some or
+ * which all of which are pinned. If EXTERNALS_TO_PIN is NULL, pin all
+ * externals, else pin the externals mentioned in EXTERNALS_TO_PIN.
+ * The pinning operation takes place as part of the copy operation for
+ * the source/destination pair PAIR. Use RA_SESSION and REPOS_ROOT_URL
+ * to contact the repository containing the externals definition, if neccesary.
+ * Use CX to fopen additional RA sessions to external repositories, if
+ * neccessary. Allocate *NEW_EXTERNALS in RESULT_POOL.
+ * Use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+resolve_pinned_externals(apr_hash_t **new_externals,
+                         const apr_hash_t *externals_to_pin,
+                         svn_client__copy_pair_t *pair,
+                         svn_ra_session_t *ra_session,
+                         const char *repos_root_url,
+                         svn_client_ctx_t *ctx,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
+{
+  const char *old_url = NULL;
+  apr_hash_t *externals_props;
+  apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
+
+  *new_externals = apr_hash_make(result_pool);
+
+  if (svn_path_is_url(pair->src_abspath_or_url))
+    {
+      SVN_ERR(svn_client__ensure_ra_session_url(&old_url, ra_session,
+                                                pair->src_abspath_or_url,
+                                                scratch_pool));
+      externals_props = apr_hash_make(scratch_pool);
+      SVN_ERR(svn_client__remote_propget(externals_props, NULL,
+                                         SVN_PROP_EXTERNALS,
+                                         pair->src_abspath_or_url, "",
+                                         svn_node_dir,
+                                         pair->src_revnum,
+                                         ra_session,
+                                         svn_depth_infinity,
+                                         scratch_pool,
+                                         scratch_pool));
+    }
+  else
+    {
+      SVN_ERR(svn_wc__externals_gather_definitions(&externals_props, NULL,
+                                                   ctx->wc_ctx,
+                                                   pair->src_abspath_or_url,
+                                                   svn_depth_infinity,
+                                                   scratch_pool, 
scratch_pool));
+
+      /* ### gather_definitions returns propvals as const char * */
+      for (hi = apr_hash_first(scratch_pool, externals_props);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          const char *local_abspath_or_url = apr_hash_this_key(hi);
+          const char *propval = apr_hash_this_val(hi);
+          svn_string_t *new_propval = svn_string_create(propval, scratch_pool);
+
+          svn_hash_sets(externals_props, local_abspath_or_url, new_propval);
+        }
+    }
+
+  if (apr_hash_count(externals_props) == 0)
+    {
+      if (old_url)
+        SVN_ERR(svn_ra_reparent(ra_session, old_url, scratch_pool));
+      return SVN_NO_ERROR;
+    }
+
+  iterpool = svn_pool_create(scratch_pool);
+  for (hi = apr_hash_first(scratch_pool, externals_props);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *local_abspath_or_url = apr_hash_this_key(hi);
+      svn_string_t *externals_propval = apr_hash_this_val(hi);
+      const char *relpath;
+      svn_string_t *new_propval;
+
+      svn_pool_clear(iterpool);
+
+      SVN_ERR(pin_externals_prop(&new_propval, externals_propval,
+                                 externals_to_pin,
+                                 repos_root_url, local_abspath_or_url, ctx,
+                                 result_pool, iterpool));
+      if (svn_path_is_url(pair->src_abspath_or_url))
+        relpath = svn_uri_skip_ancestor(pair->src_abspath_or_url,
+                                        local_abspath_or_url,
+                                        result_pool);
+      else
+        relpath = svn_dirent_skip_ancestor(pair->src_abspath_or_url,
+                                           local_abspath_or_url);
+      SVN_ERR_ASSERT(relpath);
+      svn_hash_sets(*new_externals, relpath, new_propval);
+    }
+  svn_pool_destroy(iterpool);
+
+  if (old_url)
+    SVN_ERR(svn_ra_reparent(ra_session, old_url, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
 
 /* The guts of do_wc_to_wc_copies */
 static svn_error_t *
 do_wc_to_wc_copies_with_write_lock(svn_boolean_t *timestamp_sleep,
                                    const apr_array_header_t *copy_pairs,
                                    const char *dst_parent,
+                                   svn_boolean_t pin_externals,
+                                   const apr_hash_t *externals_to_pin,
                                    svn_client_ctx_t *ctx,
                                    apr_pool_t *scratch_pool)
 {
@@ -195,12 +669,28 @@ do_wc_to_wc_copies_with_write_lock(svn_b
       const char *dst_abspath;
       svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
                                                     svn_client__copy_pair_t *);
+      apr_hash_t *pinned_externals = NULL;
+
       svn_pool_clear(iterpool);
 
       /* Check for cancellation */
       if (ctx->cancel_func)
         SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
+      if (pin_externals)
+        {
+          const char *repos_root_url;
+
+          SVN_ERR(svn_wc__node_get_origin(NULL, NULL, NULL, &repos_root_url,
+                                          NULL, NULL, NULL, ctx->wc_ctx,
+                                          pair->src_abspath_or_url, FALSE,
+                                          scratch_pool, iterpool));
+          SVN_ERR(resolve_pinned_externals(&pinned_externals,
+                                           externals_to_pin, pair, NULL,
+                                           repos_root_url, ctx,
+                                           iterpool, iterpool));
+        }
+
       /* Perform the copy */
       dst_abspath = svn_dirent_join(pair->dst_parent_abspath, pair->base_name,
                                     iterpool);
@@ -211,6 +701,31 @@ do_wc_to_wc_copies_with_write_lock(svn_b
                          ctx->notify_func2, ctx->notify_baton2, iterpool);
       if (err)
         break;
+
+      if (pinned_externals)
+        {
+          apr_hash_index_t *hi;
+
+          for (hi = apr_hash_first(iterpool, pinned_externals);
+               hi;
+               hi = apr_hash_next(hi))
+            {
+              const char *dst_relpath = apr_hash_this_key(hi);
+              svn_string_t *externals_propval = apr_hash_this_val(hi);
+              const char *local_abspath;
+
+              local_abspath = svn_dirent_join(pair->dst_abspath_or_url,
+                                              dst_relpath, iterpool);
+              /* ### use a work queue? */
+              SVN_ERR(svn_wc_prop_set4(ctx->wc_ctx, local_abspath,
+                                       SVN_PROP_EXTERNALS, externals_propval,
+                                       svn_depth_empty, TRUE /* skip_checks */,
+                                       NULL  /* changelist_filter */,
+                                       ctx->cancel_func, ctx->cancel_baton,
+                                       NULL, NULL, /* no extra notification */
+                                       iterpool));
+            }
+        }
     }
   svn_pool_destroy(iterpool);
 
@@ -223,6 +738,8 @@ do_wc_to_wc_copies_with_write_lock(svn_b
 static svn_error_t *
 do_wc_to_wc_copies(svn_boolean_t *timestamp_sleep,
                    const apr_array_header_t *copy_pairs,
+                   svn_boolean_t pin_externals,
+                   const apr_hash_t *externals_to_pin,
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool)
 {
@@ -236,6 +753,7 @@ do_wc_to_wc_copies(svn_boolean_t *timest
 
   SVN_WC__CALL_WITH_WRITE_LOCK(
     do_wc_to_wc_copies_with_write_lock(timestamp_sleep, copy_pairs, dst_parent,
+                                       pin_externals, externals_to_pin,
                                        ctx, pool),
     ctx->wc_ctx, dst_parent_abspath, FALSE, pool);
 
@@ -594,6 +1112,8 @@ typedef struct path_driver_info_t
   svn_boolean_t resurrection;
   svn_boolean_t dir_add;
   svn_string_t *mergeinfo;  /* the new mergeinfo for the target */
+  svn_string_t *externals; /* new externals definitions for the target */
+  svn_boolean_t only_pin_externals;
 } path_driver_info_t;
 
 
@@ -631,7 +1151,7 @@ path_driver_cb_func(void **dir_baton,
      with such, the code is just plain wrong. */
   SVN_ERR_ASSERT(! svn_path_is_empty(path));
 
-  /* Check to see if we need to add the path as a directory. */
+  /* Check to see if we need to add the path as a parent directory. */
   if (path_info->dir_add)
     {
       return cb_baton->editor->add_directory(path, parent_baton, NULL,
@@ -662,7 +1182,7 @@ path_driver_cb_func(void **dir_baton,
       /* Not a move?  This must just be the copy addition. */
       else
         {
-          do_add = TRUE;
+          do_add = !path_info->only_pin_externals;
         }
     }
 
@@ -702,6 +1222,18 @@ path_driver_cb_func(void **dir_baton,
                                                       pool));
         }
     }
+
+  if (path_info->externals)
+    {
+      if (*dir_baton == NULL)
+        SVN_ERR(cb_baton->editor->open_directory(path, parent_baton,
+                                                 SVN_INVALID_REVNUM,
+                                                 pool, dir_baton));
+
+      SVN_ERR(cb_baton->editor->change_dir_prop(*dir_baton, SVN_PROP_EXTERNALS,
+                                                path_info->externals, pool));
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -786,6 +1318,79 @@ find_absent_parents2(svn_ra_session_t *r
   return SVN_NO_ERROR;
 }
 
+/* Queue property changes for pinning svn:externals properties set on
+ * descendants of the path corresponding to PARENT_INFO. PINNED_EXTERNALS
+ * is keyed by the relative path of each descendant which should have some
+ * or all of its externals pinned, with the corresponding pinned svn:externals
+ * properties as values. Property changes are queued in a new list of path
+ * infos *NEW_PATH_INFOS, or in an existing item of the PATH_INFOS list if an
+ * existing item is found for the descendant. Allocate results in RESULT_POOL.
+ * Use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+queue_externals_change_path_infos(apr_array_header_t *new_path_infos,
+                                  apr_array_header_t *path_infos,
+                                  apr_hash_t *pinned_externals,
+                                  path_driver_info_t *parent_info,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
+{
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_hash_index_t *hi;
+
+  for (hi = apr_hash_first(scratch_pool, pinned_externals);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *dst_relpath = apr_hash_this_key(hi);
+      svn_string_t *externals_prop = apr_hash_this_val(hi);
+      const char *src_url;
+      path_driver_info_t *info;
+      int i;
+
+      svn_pool_clear(iterpool);
+
+      src_url = svn_path_url_add_component2(parent_info->src_url,
+                                            dst_relpath, iterpool);
+
+      /* Try to find a path info the external change can be applied to. */
+      info = NULL;
+      for (i = 0; i < path_infos->nelts; i++)
+        {
+          path_driver_info_t *existing_info;
+
+          existing_info = APR_ARRAY_IDX(path_infos, i, path_driver_info_t *);
+          if (strcmp(src_url, existing_info->src_url) == 0)
+            {
+              info = existing_info;
+              break;
+            }
+        }
+
+      if (info == NULL)
+        {
+          /* A copied-along child needs its externals pinned.
+             Create a new path info for this property change. */
+          info = apr_pcalloc(result_pool, sizeof(*info));
+          info->src_url = svn_path_url_add_component2(
+                                parent_info->src_url, dst_relpath,
+                                result_pool);
+          info->src_path = NULL; /* Only needed on copied dirs */
+          info->dst_path = svn_relpath_join(parent_info->dst_path,
+                                            dst_relpath,
+                                            result_pool);
+          info->src_kind = svn_node_dir;
+          info->only_pin_externals = TRUE;
+          APR_ARRAY_PUSH(new_path_infos, path_driver_info_t *) = info;
+        }
+
+      info->externals = externals_prop;
+    }
+
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 repos_to_repos_copy(const apr_array_header_t *copy_pairs,
                     svn_boolean_t make_parents,
@@ -794,6 +1399,8 @@ repos_to_repos_copy(const apr_array_head
                     void *commit_baton,
                     svn_client_ctx_t *ctx,
                     svn_boolean_t is_move,
+                    svn_boolean_t pin_externals,
+                    const apr_hash_t *externals_to_pin,
                     apr_pool_t *pool)
 {
   svn_error_t *err;
@@ -809,6 +1416,7 @@ repos_to_repos_copy(const apr_array_head
   struct path_driver_cb_baton cb_baton;
   apr_array_header_t *new_dirs = NULL;
   apr_hash_t *commit_revprops;
+  apr_array_header_t *pin_externals_only_infos = NULL;
   int i;
   svn_client__copy_pair_t *first_pair =
     APR_ARRAY_IDX(copy_pairs, 0, svn_client__copy_pair_t *);
@@ -1067,12 +1675,31 @@ repos_to_repos_copy(const apr_array_head
         }
 
       /* More info for our INFO structure.  */
-      info->src_path = src_rel;
+      info->src_path = src_rel; /* May be NULL, if outside RA session scope */
       info->dst_path = dst_rel;
 
       svn_hash_sets(action_hash, info->dst_path, info);
       if (is_move && (! info->resurrection))
         svn_hash_sets(action_hash, info->src_path, info);
+
+      if (pin_externals)
+        {
+          apr_hash_t *pinned_externals;
+
+          SVN_ERR(resolve_pinned_externals(&pinned_externals,
+                                           externals_to_pin, pair,
+                                           ra_session, repos_root,
+                                           ctx, pool, pool));
+          if (pin_externals_only_infos == NULL)
+            {
+              pin_externals_only_infos =
+                apr_array_make(pool, 0, sizeof(path_driver_info_t *));
+            }
+          SVN_ERR(queue_externals_change_path_infos(pin_externals_only_infos,
+                                                    path_infos,
+                                                    pinned_externals,
+                                                    info, pool, pool));
+        }
     }
 
   if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
@@ -1161,6 +1788,19 @@ repos_to_repos_copy(const apr_array_head
         APR_ARRAY_PUSH(paths, const char *) = info->src_path;
     }
 
+  /* Add any items which only need their externals pinned. */
+  if (pin_externals_only_infos)
+    {
+      for (i = 0; i < pin_externals_only_infos->nelts; i++)
+        {
+          path_driver_info_t *info;
+
+          info = APR_ARRAY_IDX(pin_externals_only_infos, i, path_driver_info_t 
*);
+          APR_ARRAY_PUSH(paths, const char *) = info->dst_path;
+          svn_hash_sets(action_hash, info->dst_path, info);
+        }
+    }
+
   SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
                                            message, ctx, pool));
 
@@ -1239,6 +1879,62 @@ check_url_kind(void *baton,
   return SVN_NO_ERROR;
 }
 
+/* Queue a property change on a copy of LOCAL_ABSPATH to COMMIT_URL
+ * in the COMMIT_ITEMS list.
+ * If the list does not already have a commit item for COMMIT_URL
+ * add a new commit item for the property change.
+ * Allocate results in RESULT_POOL.
+ * Use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+queue_prop_change_commit_items(const char *local_abspath,
+                               const char *commit_url,
+                               apr_array_header_t *commit_items,
+                               const char *propname,
+                               svn_string_t *propval,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
+{
+  svn_client_commit_item3_t *item = NULL;
+  svn_prop_t *prop;
+  int i;
+
+  for (i = 0; i < commit_items->nelts; i++)
+    {
+      svn_client_commit_item3_t *existing_item;
+
+      existing_item = APR_ARRAY_IDX(commit_items, i,
+                                    svn_client_commit_item3_t *);
+      if (strcmp(existing_item->url, commit_url) == 0)
+        {
+          item = existing_item;
+          break;
+        }
+    }
+
+  if (item == NULL)
+    {
+      item = svn_client_commit_item3_create(result_pool);
+      item->path = local_abspath;
+      item->url = commit_url;
+      item->kind = svn_node_dir;
+      item->state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
+      APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
+    }
+  else
+    item->state_flags |= SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
+
+  if (item->outgoing_prop_changes == NULL)
+    item->outgoing_prop_changes = apr_array_make(result_pool, 1,
+                                                 sizeof(svn_prop_t *));
+
+  prop = apr_palloc(result_pool, sizeof(*prop));
+  prop->name = propname;
+  prop->value = propval;
+  APR_ARRAY_PUSH(item->outgoing_prop_changes, svn_prop_t *) = prop;
+
+  return SVN_NO_ERROR;
+}
+
 /* ### Copy ...
  * COMMIT_INFO_P is ...
  * COPY_PAIRS is ... such that each 'src_abspath_or_url' is a local abspath
@@ -1252,6 +1948,8 @@ wc_to_repos_copy(const apr_array_header_
                  const apr_hash_t *revprop_table,
                  svn_commit_callback2_t commit_callback,
                  void *commit_baton,
+                 svn_boolean_t pin_externals,
+                 const apr_hash_t *externals_to_pin,
                  svn_client_ctx_t *ctx,
                  apr_pool_t *scratch_pool)
 {
@@ -1448,6 +2146,43 @@ wc_to_repos_copy(const apr_array_header_
           APR_ARRAY_PUSH(item->outgoing_prop_changes, svn_prop_t *)
             = mergeinfo_prop;
         }
+
+      if (pin_externals)
+        {
+          apr_hash_t *pinned_externals;
+          apr_hash_index_t *hi;
+
+          SVN_ERR(resolve_pinned_externals(&pinned_externals,
+                                           externals_to_pin, pair,
+                                           ra_session, cukb.repos_root_url,
+                                           ctx, scratch_pool, iterpool));
+          for (hi = apr_hash_first(scratch_pool, pinned_externals);
+               hi;
+               hi = apr_hash_next(hi))
+            {
+              const char *dst_relpath = apr_hash_this_key(hi);
+              svn_string_t *externals_propval = apr_hash_this_val(hi);
+              const char *dst_url;
+              const char *commit_url;
+              const char *src_abspath;
+
+              if (svn_path_is_url(pair->dst_abspath_or_url))
+                dst_url = pair->dst_abspath_or_url;
+              else
+                SVN_ERR(svn_wc__node_get_url(&dst_url, ctx->wc_ctx,
+                                             pair->dst_abspath_or_url,
+                                             scratch_pool, iterpool));
+              commit_url = svn_path_url_add_component2(dst_url, dst_relpath,
+                                                       scratch_pool);
+              src_abspath = svn_dirent_join(pair->src_abspath_or_url,
+                                            dst_relpath, iterpool);
+              SVN_ERR(queue_prop_change_commit_items(src_abspath,
+                                                     commit_url, commit_items,
+                                                     SVN_PROP_EXTERNALS,
+                                                     externals_propval,
+                                                     scratch_pool, iterpool));
+            }
+        }
     }
 
   if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
@@ -1567,6 +2302,8 @@ repos_to_wc_copy_single(svn_boolean_t *t
                         svn_client__copy_pair_t *pair,
                         svn_boolean_t same_repositories,
                         svn_boolean_t ignore_externals,
+                        svn_boolean_t pin_externals,
+                        const apr_hash_t *externals_to_pin,
                         svn_ra_session_t *ra_session,
                         svn_client_ctx_t *ctx,
                         apr_pool_t *pool)
@@ -1623,6 +2360,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,
@@ -1675,6 +2420,61 @@ repos_to_wc_copy_single(svn_boolean_t *t
 
           return SVN_NO_ERROR;
         }
+
+      if (pin_externals)
+        {
+          apr_hash_t *pinned_externals;
+          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,
+                                           externals_to_pin, pair,
+                                           ra_session, repos_root_url,
+                                           ctx, pool, pool));
+
+          iterpool = svn_pool_create(pool);
+          for (hi = apr_hash_first(pool, pinned_externals);
+               hi;
+               hi = apr_hash_next(hi))
+            {
+              const char *dst_relpath = apr_hash_this_key(hi);
+              svn_string_t *externals_propval = apr_hash_this_val(hi);
+              const char *local_abspath;
+
+              svn_pool_clear(iterpool);
+
+              local_abspath = svn_dirent_join(pair->dst_abspath_or_url,
+                                              dst_relpath, iterpool);
+              /* ### use a work queue? */
+              SVN_ERR(svn_wc_prop_set4(ctx->wc_ctx, local_abspath,
+                                       SVN_PROP_EXTERNALS, externals_propval,
+                                       svn_depth_empty, TRUE /* skip_checks */,
+                                       NULL  /* changelist_filter */,
+                                       ctx->cancel_func, ctx->cancel_baton,
+                                       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 */
 
   else if (pair->src_kind == svn_node_file)
@@ -1734,6 +2534,8 @@ repos_to_wc_copy_locked(svn_boolean_t *t
                         const apr_array_header_t *copy_pairs,
                         const char *top_dst_path,
                         svn_boolean_t ignore_externals,
+                        svn_boolean_t pin_externals,
+                        const apr_hash_t *externals_to_pin,
                         svn_ra_session_t *ra_session,
                         svn_client_ctx_t *ctx,
                         apr_pool_t *scratch_pool)
@@ -1799,6 +2601,7 @@ repos_to_wc_copy_locked(svn_boolean_t *t
                                                     svn_client__copy_pair_t *),
                                       same_repositories,
                                       ignore_externals,
+                                      pin_externals, externals_to_pin,
                                       ra_session, ctx, iterpool));
     }
   svn_pool_destroy(iterpool);
@@ -1811,6 +2614,8 @@ repos_to_wc_copy(svn_boolean_t *timestam
                  const apr_array_header_t *copy_pairs,
                  svn_boolean_t make_parents,
                  svn_boolean_t ignore_externals,
+                 svn_boolean_t pin_externals,
+                 const apr_hash_t *externals_to_pin,
                  svn_client_ctx_t *ctx,
                  apr_pool_t *pool)
 {
@@ -1919,6 +2724,7 @@ repos_to_wc_copy(svn_boolean_t *timestam
   SVN_WC__CALL_WITH_WRITE_LOCK(
     repos_to_wc_copy_locked(timestamp_sleep,
                             copy_pairs, top_dst_path, ignore_externals,
+                            pin_externals, externals_to_pin,
                             ra_session, ctx, pool),
     ctx->wc_ctx, lock_abspath, FALSE, pool);
   return SVN_NO_ERROR;
@@ -1945,6 +2751,8 @@ try_copy(svn_boolean_t *timestamp_sleep,
          svn_boolean_t metadata_only,
          svn_boolean_t make_parents,
          svn_boolean_t ignore_externals,
+         svn_boolean_t pin_externals,
+         const apr_hash_t *externals_to_pin,
          const apr_hash_t *revprop_table,
          svn_commit_callback2_t commit_callback,
          void *commit_baton,
@@ -2247,28 +3055,32 @@ try_copy(svn_boolean_t *timestamp_sleep,
           /* We ignore these values, so assert the default value */
           SVN_ERR_ASSERT(allow_mixed_revisions && !metadata_only);
           return svn_error_trace(do_wc_to_wc_copies(timestamp_sleep,
-                                                    copy_pairs, ctx, pool));
+                                                    copy_pairs,
+                                                    pin_externals,
+                                                    externals_to_pin,
+                                                    ctx, pool));
         }
     }
   else if ((! srcs_are_urls) && (dst_is_url))
     {
       return svn_error_trace(
         wc_to_repos_copy(copy_pairs, make_parents, revprop_table,
-                         commit_callback, commit_baton, ctx, pool));
+                         commit_callback, commit_baton,
+                         pin_externals, externals_to_pin, ctx, pool));
     }
   else if ((srcs_are_urls) && (! dst_is_url))
     {
       return svn_error_trace(
         repos_to_wc_copy(timestamp_sleep,
                          copy_pairs, make_parents, ignore_externals,
-                         ctx, pool));
+                         pin_externals, externals_to_pin, ctx, pool));
     }
   else
     {
       return svn_error_trace(
         repos_to_repos_copy(copy_pairs, make_parents, revprop_table,
                             commit_callback, commit_baton, ctx, is_move,
-                            pool));
+                            pin_externals, externals_to_pin, pool));
     }
 }
 
@@ -2276,11 +3088,13 @@ try_copy(svn_boolean_t *timestamp_sleep,
 
 /* Public Interfaces */
 svn_error_t *
-svn_client_copy6(const apr_array_header_t *sources,
+svn_client_copy7(const apr_array_header_t *sources,
                  const char *dst_path,
                  svn_boolean_t copy_as_child,
                  svn_boolean_t make_parents,
                  svn_boolean_t ignore_externals,
+                 svn_boolean_t pin_externals,
+                 const apr_hash_t *externals_to_pin,
                  const apr_hash_t *revprop_table,
                  svn_commit_callback2_t commit_callback,
                  void *commit_baton,
@@ -2302,6 +3116,8 @@ svn_client_copy6(const apr_array_header_
                  FALSE /* metadata_only */,
                  make_parents,
                  ignore_externals,
+                 pin_externals,
+                 externals_to_pin,
                  revprop_table,
                  commit_callback, commit_baton,
                  ctx,
@@ -2336,6 +3152,8 @@ svn_client_copy6(const apr_array_header_
                      FALSE /* metadata_only */,
                      make_parents,
                      ignore_externals,
+                     pin_externals,
+                     externals_to_pin,
                      revprop_table,
                      commit_callback, commit_baton,
                      ctx,
@@ -2397,6 +3215,8 @@ svn_client_move7(const apr_array_header_
                  metadata_only,
                  make_parents,
                  FALSE /* ignore_externals */,
+                 FALSE /* pin_externals */,
+                 NULL /* externals_to_pin */,
                  revprop_table,
                  commit_callback, commit_baton,
                  ctx,
@@ -2430,6 +3250,8 @@ svn_client_move7(const apr_array_header_
                      metadata_only,
                      make_parents,
                      FALSE /* ignore_externals */,
+                     FALSE /* pin_externals */,
+                     NULL /* externals_to_pin */,
                      revprop_table,
                      commit_callback, commit_baton,
                      ctx,

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_client/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/deprecated.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/deprecated.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/deprecated.c 
Mon Feb 16 17:40:07 2015
@@ -627,6 +627,25 @@ svn_client_commit(svn_client_commit_info
 
 /*** From copy.c ***/
 svn_error_t *
+svn_client_copy6(const apr_array_header_t *sources,
+                 const char *dst_path,
+                 svn_boolean_t copy_as_child,
+                 svn_boolean_t make_parents,
+                 svn_boolean_t ignore_externals,
+                 const apr_hash_t *revprop_table,
+                 svn_commit_callback2_t commit_callback,
+                 void *commit_baton,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool)
+{
+  return svn_error_trace(svn_client_copy7(sources, dst_path, copy_as_child,
+                                          make_parents, ignore_externals,
+                                          FALSE, NULL, revprop_table,
+                                          commit_callback, commit_baton,
+                                          ctx, pool));
+}
+
+svn_error_t *
 svn_client_copy5(svn_commit_info_t **commit_info_p,
                  const apr_array_header_t *sources,
                  const char *dst_path,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/diff.c Mon Feb 
16 17:40:07 2015
@@ -2207,7 +2207,7 @@ do_diff(const char **root_relpath,
 
               SVN_ERR(svn_dirent_get_absolute(&abspath1, path_or_url1,
                                               scratch_pool));
-              SVN_ERR(svn_dirent_get_absolute(&abspath2, path_or_url2, 
+              SVN_ERR(svn_dirent_get_absolute(&abspath2, path_or_url2,
                                               scratch_pool));
 
               /* ### What about ddi? */

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_client/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/externals.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/externals.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/externals.c 
Mon Feb 16 17:40:07 2015
@@ -171,7 +171,7 @@ switch_dir_external(const char *local_ab
   if (revision->kind == svn_opt_revision_number)
     external_rev = revision->value.number;
 
-  /* 
+  /*
    * The code below assumes existing versioned paths are *not* part of
    * the external's defining working copy.
    * The working copy library does not support registering externals
@@ -242,6 +242,20 @@ switch_dir_external(const char *local_ab
                                                   FALSE, FALSE, FALSE, TRUE,
                                                   FALSE, TRUE,
                                                   ra_session, ctx, subpool));
+
+              /* We just decided that this existing directory is an external,
+                 so update the external registry with this information, like
+                 when checking out an external */
+              SVN_ERR(svn_wc__external_register(ctx->wc_ctx,
+                                    defining_abspath,
+                                    local_abspath, svn_node_dir,
+                                    repos_root_url, repos_uuid,
+                                    svn_uri_skip_ancestor(repos_root_url,
+                                                          url, pool),
+                                    external_peg_rev,
+                                    external_rev,
+                                    pool));
+
               svn_pool_destroy(subpool);
               goto cleanup;
             }

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/log.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/log.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/log.c Mon Feb 
16 17:40:07 2015
@@ -303,7 +303,7 @@ limit_receiver(void *baton, svn_log_entr
 
    The limitations on TARGETS specified by svn_client_log5 are enforced here.
    So TARGETS can only contain a single WC path or a URL and zero or more
-   relative paths -- anything else will raise an error. 
+   relative paths -- anything else will raise an error.
 
    PEG_REVISION, TARGETS, and CTX are as per svn_client_log5.
 
@@ -642,7 +642,7 @@ run_ra_get_log(apr_array_header_t *revis
                apr_array_header_t *log_segments,
                svn_client__pathrev_t *actual_loc,
                svn_ra_session_t *ra_session,
-               /* The following are as per svn_client_log5. */ 
+               /* The following are as per svn_client_log5. */
                const apr_array_header_t *targets,
                int limit,
                svn_boolean_t discover_changed_paths,
@@ -761,7 +761,7 @@ run_ra_get_log(apr_array_header_t *revis
          So to be safe we handle that case. */
       if (matching_segment == NULL)
         continue;
-      
+
       /* A segment with a NULL path means there is gap in the history.
          We'll just proceed and let svn_ra_get_log2 fail with a useful
          error...*/

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/merge.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/merge.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/merge.c Mon 
Feb 16 17:40:07 2015
@@ -1849,9 +1849,14 @@ merge_file_opened(void **new_file_baton,
         }
       else if (fb->tree_conflict_local_node_kind != svn_node_file)
         {
+          svn_boolean_t added;
           fb->shadowed = TRUE;
 
-          fb->tree_conflict_reason = svn_wc_conflict_reason_obstructed;
+          SVN_ERR(svn_wc__node_is_added(&added, merge_b->ctx->wc_ctx,
+                                        local_abspath, scratch_pool));
+
+          fb->tree_conflict_reason = added ? svn_wc_conflict_reason_added
+                                           : svn_wc_conflict_reason_obstructed;
 
           /* ### Similar to directory */
           *skip = TRUE;
@@ -1952,8 +1957,14 @@ merge_file_opened(void **new_file_baton,
                    && !is_deleted)
             {
               /* Set a tree conflict */
+              svn_boolean_t added;
+
               fb->shadowed = TRUE;
-              fb->tree_conflict_reason = svn_wc_conflict_reason_obstructed;
+              SVN_ERR(svn_wc__node_is_added(&added, merge_b->ctx->wc_ctx,
+                                            local_abspath, scratch_pool));
+
+              fb->tree_conflict_reason = added ? svn_wc_conflict_reason_added
+                                               : 
svn_wc_conflict_reason_obstructed;
             }
         }
 
@@ -2621,9 +2632,14 @@ merge_dir_opened(void **new_dir_baton,
         }
       else if (db->tree_conflict_local_node_kind != svn_node_dir)
         {
+          svn_boolean_t added;
+
           db->shadowed = TRUE;
+          SVN_ERR(svn_wc__node_is_added(&added, merge_b->ctx->wc_ctx,
+                                        local_abspath, scratch_pool));
 
-          db->tree_conflict_reason = svn_wc_conflict_reason_obstructed;
+          db->tree_conflict_reason = added ? svn_wc_conflict_reason_added
+                                           : svn_wc_conflict_reason_obstructed;
 
           /* ### To avoid breaking tests */
           *skip = TRUE;
@@ -2766,8 +2782,14 @@ merge_dir_opened(void **new_dir_baton,
                    && !is_deleted)
             {
               /* Set a tree conflict */
+              svn_boolean_t added;
               db->shadowed = TRUE;
-              db->tree_conflict_reason = svn_wc_conflict_reason_obstructed;
+
+              SVN_ERR(svn_wc__node_is_added(&added, merge_b->ctx->wc_ctx,
+                                            local_abspath, scratch_pool));
+
+              db->tree_conflict_reason = added ? svn_wc_conflict_reason_added
+                                               : 
svn_wc_conflict_reason_obstructed;
             }
         }
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/patch.c Mon 
Feb 16 17:40:07 2015
@@ -1795,7 +1795,7 @@ get_hunk_info(hunk_info_t **hi, patch_ta
                   && (!matched_line
                       || (matched_line > original_start
                           && (matched_line - original_start
-                              > original_start - search_start)))) 
+                              > original_start - search_start))))
                 {
                   svn_linenum_t search_start2 = 1;
 

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_client/prop_commands.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/prop_commands.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/libsvn_client/prop_commands.c 
(original)
+++ 
subversion/branches/move-tracking-2/subversion/libsvn_client/prop_commands.c 
Mon Feb 16 17:40:07 2015
@@ -527,40 +527,18 @@ svn_client_revprop_set2(const char *prop
   return SVN_NO_ERROR;
 }
 
-/* Helper for the remote case of svn_client_propget.
- *
- * If PROPS is not null, then get the value of property PROPNAME in
- * REVNUM, using RA_SESSION.  Store the value ('svn_string_t *') in
- * PROPS, under the path key "TARGET_PREFIX/TARGET_RELATIVE"
- * ('const char *').
- *
- * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a
- * depth-first ordered array of svn_prop_inherited_item_t * structures
- * representing the PROPNAME properties inherited by the target.  If
- * INHERITABLE_PROPS in not null and no inheritable properties are found,
- * then set *INHERITED_PROPS to an empty array.
- *
- * Recurse according to DEPTH, similarly to svn_client_propget3().
- *
- * KIND is the kind of the node at "TARGET_PREFIX/TARGET_RELATIVE".
- * Yes, caller passes this; it makes the recursion more efficient :-).
- *
- * Allocate PROPS and *INHERITED_PROPS in RESULT_POOL, but do all temporary
- * work in SCRATCH_POOL.  The two pools can be the same; recursive
- * calls may use a different SCRATCH_POOL, however.
- */
-static svn_error_t *
-remote_propget(apr_hash_t *props,
-               apr_array_header_t **inherited_props,
-               const char *propname,
-               const char *target_prefix,
-               const char *target_relative,
-               svn_node_kind_t kind,
-               svn_revnum_t revnum,
-               svn_ra_session_t *ra_session,
-               svn_depth_t depth,
-               apr_pool_t *result_pool,
-               apr_pool_t *scratch_pool)
+svn_error_t *
+svn_client__remote_propget(apr_hash_t *props,
+                           apr_array_header_t **inherited_props,
+                           const char *propname,
+                           const char *target_prefix,
+                           const char *target_relative,
+                           svn_node_kind_t kind,
+                           svn_revnum_t revnum,
+                           svn_ra_session_t *ra_session,
+                           svn_depth_t depth,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
 {
   apr_hash_t *dirents;
   apr_hash_t *prop_hash = NULL;
@@ -672,15 +650,15 @@ remote_propget(apr_hash_t *props,
           new_target_relative = svn_relpath_join(target_relative, this_name,
                                                  iterpool);
 
-          SVN_ERR(remote_propget(props, NULL,
-                                 propname,
-                                 target_prefix,
-                                 new_target_relative,
-                                 this_ent->kind,
-                                 revnum,
-                                 ra_session,
-                                 depth_below_here,
-                                 result_pool, iterpool));
+          SVN_ERR(svn_client__remote_propget(props, NULL,
+                                             propname,
+                                             target_prefix,
+                                             new_target_relative,
+                                             this_ent->kind,
+                                             revnum,
+                                             ra_session,
+                                             depth_below_here,
+                                             result_pool, iterpool));
         }
 
       svn_pool_destroy(iterpool);
@@ -970,7 +948,8 @@ svn_client_propget5(apr_hash_t **props,
           if (!local_explicit_props)
             *props = apr_hash_make(result_pool);
 
-          SVN_ERR(remote_propget(!local_explicit_props ? *props : NULL,
+          SVN_ERR(svn_client__remote_propget(
+                                 !local_explicit_props ? *props : NULL,
                                  !local_iprops ? inherited_props : NULL,
                                  propname, loc->url, "",
                                  kind, loc->rev, ra_session,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/ra.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/ra.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/ra.c Mon Feb 
16 17:40:07 2015
@@ -706,7 +706,7 @@ repos_locations(const char **start_url,
           || (SVN_IS_VALID_REVNUM(end_revnum) && (end_revnum > youngest_rev)))
         return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
                                  _("No such revision %ld"),
-                                 (start_revnum > youngest_rev) 
+                                 (start_revnum > youngest_rev)
                                         ? start_revnum : end_revnum);
 
       if (start_url)

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/update.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/update.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/update.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/update.c Mon 
Feb 16 17:40:07 2015
@@ -199,7 +199,7 @@ record_conflict(svn_wc_conflict_result_t
    is not null.
 
    Use RA_SESSION_P to run the update if it is not NULL.  If it is then
-   open a new ra session and place it in RA_SESSION_P.  This allows 
+   open a new ra session and place it in RA_SESSION_P.  This allows
    repeated calls to update_internal to reuse the same session.
 */
 static svn_error_t *

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/svndiff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/svndiff.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/svndiff.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/svndiff.c Mon 
Feb 16 17:40:07 2015
@@ -360,7 +360,7 @@ decode_size(apr_size_t *val,
   const unsigned char *result = svn__decode_uint(&temp, p, end);
   if (temp > APR_SIZE_MAX)
     return NULL;
-  
+
   *val = (apr_size_t)temp;
   return result;
 }
@@ -494,7 +494,7 @@ zlib_decode(const unsigned char *in, apr
   compressed.data = (char *)in;
   compressed.len = inLen;
   compressed.blocksize = inLen + 1;
-  
+
   return svn__decompress(&compressed, out, limit);
 }
 
@@ -796,7 +796,7 @@ read_one_byte(unsigned char *byte, svn_s
   return SVN_NO_ERROR;
 }
 
-/* Read and decode one integer from STREAM into *SIZE. 
+/* Read and decode one integer from STREAM into *SIZE.
    Increment *BYTE_COUNTER by the number of chars we have read. */
 static svn_error_t *
 read_one_size(apr_size_t *size,

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_diff/parse-diff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_diff/parse-diff.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_diff/parse-diff.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_diff/parse-diff.c Mon 
Feb 16 17:40:07 2015
@@ -532,7 +532,7 @@ parse_mergeinfo(svn_boolean_t *found_mer
         }
       else
         SVN_ERR(err);
-                            
+
       if (mergeinfo)
         {
           if (hunk->original_length > 0) /* reverse merges */

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs/fs-loader.c Mon 
Feb 16 17:40:07 2015
@@ -408,6 +408,11 @@ synchronized_initialize(void *baton, apr
 svn_error_t *
 svn_fs_initialize(apr_pool_t *pool)
 {
+#if defined(SVN_USE_DSO) && APR_HAS_DSO
+  /* Ensure that DSO subsystem is initialized early as possible if
+     we're going to use it. */
+  SVN_ERR(svn_dso_initialize2());
+#endif
   /* Protect against multiple calls. */
   return svn_error_trace(svn_atomic__init_once(&common_pool_initialized,
                                                synchronized_initialize,
@@ -1691,7 +1696,7 @@ svn_fs_lock(svn_lock_t **lock, svn_fs_t
             apr_pool_t *pool)
 {
   apr_hash_t *targets = apr_hash_make(pool);
-  svn_fs_lock_target_t target; 
+  svn_fs_lock_target_t target;
   svn_error_t *err;
   struct lock_baton_t baton = {0};
 
@@ -1710,7 +1715,7 @@ svn_fs_lock(svn_lock_t **lock, svn_fs_t
     svn_error_compose(err, baton.fs_err);
   else if (!err)
     err = baton.fs_err;
-  
+
   return svn_error_trace(err);
 }
 
@@ -1958,7 +1963,7 @@ svn_fs_info_dup(const void *info_void,
   fs_library_vtable_t *vtable;
 
   SVN_ERR(get_library_vtable(&vtable, info->fs_type, scratch_pool));
-  
+
   if (vtable->info_fsap_dup)
     return vtable->info_fsap_dup(info_void, result_pool);
   else

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c Mon Feb 
16 17:40:07 2015
@@ -783,8 +783,8 @@ base_create(svn_fs_t *fs,
   return SVN_NO_ERROR;;
 
 error:
-  svn_error_clear(cleanup_fs(fs));
-  return svn_err;
+  return svn_error_compose_create(svn_err,
+                                  svn_error_trace(cleanup_fs(fs)));
 }
 
 
@@ -871,8 +871,8 @@ base_open(svn_fs_t *fs,
   return SVN_NO_ERROR;
 
  error:
-  svn_error_clear(cleanup_fs(fs));
-  return svn_err;
+  return svn_error_compose_create(svn_err,
+                                  svn_error_trace(cleanup_fs(fs)));
 }
 
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/lock.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/lock.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/lock.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/lock.c Mon 
Feb 16 17:40:07 2015
@@ -261,7 +261,7 @@ svn_fs_base__lock(svn_fs_t *fs,
       args.expiration_date = expiration_date;
       args.current_rev = target->current_rev;
       args.result_pool = result_pool;
-      
+
       err = svn_fs_base__retry_txn(fs, txn_body_lock, &args, TRUE,
                                    scratch_pool);
       if (!cb_err && lock_callback)

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c 
Mon Feb 16 17:40:07 2015
@@ -631,7 +631,7 @@ typedef struct rep_state_t
                        -1 if the offset is yet unknown. */
   apr_off_t current;/* The current offset relative to START. */
   apr_off_t size;   /* The on-disk size of the representation. */
-  int ver;          /* If a delta, what svndiff version? 
+  int ver;          /* If a delta, what svndiff version?
                        -1 for unknown delta version. */
   int chunk_index;  /* number of the window to read */
 } rep_state_t;
@@ -991,7 +991,7 @@ svn_fs_fs__rep_chain_length(int *chain_l
   int count = 0;
   int shards = 1;
   svn_revnum_t last_shard = rep->revision / shard_size;
-  
+
   /* Check whether the length of the deltification chain is acceptable.
    * Otherwise, shared reps may form a non-skipping delta chain in
    * extreme cases. */
@@ -1104,7 +1104,7 @@ struct rep_read_baton
   /* The text we've been reading, if we're going to cache it. */
   svn_stringbuf_t *current_fulltext;
 
-  /* If not NULL, attempt to read the data from this cache. 
+  /* If not NULL, attempt to read the data from this cache.
      Once that lookup fails, reset it to NULL. */
   svn_cache__t *fulltext_cache;
 
@@ -1550,7 +1550,7 @@ read_plain_window(svn_stringbuf_t **nwin
                   apr_pool_t *scratch_pool)
 {
   apr_off_t offset;
-  
+
   /* RS->FILE may be shared between RS instances -> make sure we point
    * to the right data. */
   SVN_ERR(auto_open_shared_file(rs->sfile));
@@ -2001,7 +2001,7 @@ rep_read_contents(void *baton,
                              &rb->src_state, &rb->len, rb->fs, &rb->rep,
                              rb->filehandle_pool));
 
-      /* In case we did read from the fulltext cache before, make the 
+      /* In case we did read from the fulltext cache before, make the
        * window stream catch up.  Also, initialize the fulltext buffer
        * if we want to cache the fulltext at the end. */
       SVN_ERR(skip_contents(rb, rb->fulltext_delivered));
@@ -2788,7 +2788,7 @@ init_rep_state(rep_state_t *rs,
   /* this function does not apply to representation containers */
   SVN_ERR_ASSERT(entry->type >= SVN_FS_FS__ITEM_TYPE_FILE_REP
                  && entry->type <= SVN_FS_FS__ITEM_TYPE_DIR_PROPS);
-  
+
   shared_file->rfile = file;
   shared_file->fs = fs;
   shared_file->revision = entry->item.revision;
@@ -2850,7 +2850,7 @@ get_raw_window_end(void **out,
  * at or beyond that offset.  Use POOL for temporary allocations.
  *
  * This function requires RS->RAW_WINDOW_CACHE and RS->WINDOW_CACHE to
- * be non-NULL. 
+ * be non-NULL.
  */
 static svn_error_t *
 cache_windows(svn_fs_t *fs,
@@ -2965,7 +2965,7 @@ block_read_windows(svn_fs_fs__rep_header
 
   SVN_ERR(init_rep_state(&rs, rep_header, fs, rev_file, entry,
                          result_pool));
-  
+
   /* RS->FILE may be shared between RS instances -> make sure we point
    * to the right data. */
   offset = rs.start + rs.current;
@@ -3018,7 +3018,7 @@ read_rep_header(svn_fs_fs__rep_header_t
 {
   fs_fs_data_t *ffd = fs->fsap_data;
   svn_boolean_t is_cached = FALSE;
-  
+
   if (ffd->rep_header_cache)
     {
       SVN_ERR(svn_cache__get((void**)rep_header, &is_cached,
@@ -3246,7 +3246,7 @@ block_read(void **result,
 
   /* don't try this on transaction protorev files */
   SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(revision));
-  
+
   /* index lookup: find the OFFSET of the item we *must* read plus (in the
    * "do-while" block) the list of items in the same block. */
   SVN_ERR(svn_fs_fs__item_offset(&wanted_offset, fs, revision_file,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c Mon Feb 
16 17:40:07 2015
@@ -401,7 +401,7 @@ svn_fs_fs__with_all_locks(svn_fs_t *fs,
   fs_fs_data_t *ffd = fs->fsap_data;
 
   /* Be sure to use the correct lock ordering as documented in
-     fs_fs_shared_data_t.  The lock chain is being created in 
+     fs_fs_shared_data_t.  The lock chain is being created in
      innermost (last to acquire) -> outermost (first to acquire) order. */
   with_lock_baton_t *lock_baton
     = create_lock_baton(fs, write_lock, body, baton, pool);
@@ -1144,7 +1144,7 @@ create_file_ignore_eexist(const char *fi
   return svn_error_trace(err);
 }
 
-/* Baton type bridging svn_fs_fs__upgrade and upgrade_body carrying 
+/* Baton type bridging svn_fs_fs__upgrade and upgrade_body carrying
  * parameters over between them. */
 struct upgrade_baton_t
 {
@@ -1287,7 +1287,7 @@ svn_fs_fs__upgrade(svn_fs_t *fs,
   baton.notify_baton = notify_baton;
   baton.cancel_func = cancel_func;
   baton.cancel_baton = cancel_baton;
-  
+
   return svn_fs_fs__with_all_locks(fs, upgrade_body, (void *)&baton, pool);
 }
 
@@ -1556,7 +1556,7 @@ svn_fs_fs__file_checksum(svn_checksum_t
     {
       svn_checksum_t temp;
       temp.kind = kind;
-      
+
       switch(kind)
         {
           case svn_checksum_md5:

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/hotcopy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/hotcopy.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/hotcopy.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/hotcopy.c Mon 
Feb 16 17:40:07 2015
@@ -369,7 +369,7 @@ hotcopy_copy_packed_shard(svn_boolean_t
   return SVN_NO_ERROR;
 }
 
-/* Remove file PATH, if it exists - even if it is read-only. 
+/* Remove file PATH, if it exists - even if it is read-only.
  * Use POOL for temporary allocations. */
 static svn_error_t *
 hotcopy_remove_file(const char *path,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/id.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/id.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/id.c Mon Feb 16 
17:40:07 2015
@@ -232,7 +232,7 @@ svn_fs_fs__id_txn_unparse(const svn_fs_f
 {
   char string[2 * SVN_INT64_BUFFER_SIZE + 1];
   char *p = string;
-  
+
   p += svn__i64toa(p, txn_id->revision);
   *(p++) = '-';
   p += svn__ui64tobase36(p, txn_id->number);
@@ -418,7 +418,7 @@ svn_fs_fs__id_txn_create_root(const svn_
   fs_fs__id_t *id = apr_pcalloc(pool, sizeof(*id));
 
   /* node ID and copy ID are "0" */
-  
+
   id->private_id.txn_id = *txn_id;
   id->private_id.rev_item.revision = SVN_INVALID_REVNUM;
 
@@ -598,7 +598,7 @@ svn_fs_fs__id_serialize(svn_temp_seriali
                         const svn_fs_id_t * const *in)
 {
   const fs_fs__id_t *id = (const fs_fs__id_t *)*in;
-  
+
   /* nothing to do for NULL ids */
   if (id == NULL)
     return;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.c?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.c Mon Feb 
16 17:40:07 2015
@@ -87,7 +87,7 @@ typedef struct l2p_page_table_entry_t
 
 /* Master run-time data structure of an log-to-phys index.  It contains
  * the page tables of every revision covered by that index - but not the
- * pages themselves. 
+ * pages themselves.
  */
 typedef struct l2p_header_t
 {
@@ -498,7 +498,7 @@ stream_write_encoded(svn_stream_t *strea
                      apr_uint64_t value)
 {
   unsigned char encoded[ENCODED_INT_LENGTH];
- 
+
   apr_size_t len = encode_uint(encoded, value);
   return svn_error_trace(svn_stream_write(stream, (char *)encoded, &len));
 }
@@ -806,7 +806,7 @@ svn_fs_fs__l2p_index_append(svn_checksum
    * The current implementation is limited to 2G entries per page. */
   if (ffd->l2p_page_size > APR_INT32_MAX)
     return svn_error_createf(SVN_ERR_FS_INDEX_OVERFLOW , NULL,
-                            _("L2P index page size  %s" 
+                            _("L2P index page size  %s"
                               " exceeds current limit of 2G entries"),
                             apr_psprintf(local_pool, "%" APR_UINT64_T_FMT,
                                          ffd->l2p_page_size));
@@ -869,7 +869,7 @@ svn_fs_fs__l2p_index_append(svn_checksum
             return svn_error_createf(SVN_ERR_FS_INDEX_OVERFLOW , NULL,
                                     _("Item index %s too large "
                                       "in l2p proto index for revision %ld"),
-                                    apr_psprintf(local_pool, "%" 
APR_UINT64_T_FMT, 
+                                    apr_psprintf(local_pool, "%" 
APR_UINT64_T_FMT,
                                                  proto_entry.item_index),
                                     revision + page_counts->nelts);
 
@@ -1277,7 +1277,7 @@ l2p_page_table_access_func(void **out,
 
   /* set output as a courtesy to the caller */
   *out = table_baton->pages;
-  
+
   return SVN_NO_ERROR;
 }
 
@@ -1669,7 +1669,7 @@ l2p_proto_index_lookup(apr_off_t *offset
     }
 
   SVN_ERR(svn_io_file_close(file, scratch_pool));
-  
+
   return SVN_NO_ERROR;
 }
 
@@ -2188,7 +2188,7 @@ get_p2l_header(p2l_header_t **header,
 
   /* allocate result data structure */
   result = apr_pcalloc(result_pool, sizeof(*result));
-  
+
   /* Read table sizes, check them for plausibility and allocate page array. */
   SVN_ERR(packed_stream_get(&value, rev_file->p2l_stream));
   result->first_revision = (svn_revnum_t)value;
@@ -2282,7 +2282,7 @@ p2l_page_info_copy(p2l_page_info_baton_t
                    const p2l_header_t *header,
                    const apr_off_t *offsets)
 {
-  /* if the requested offset is out of bounds, return info for 
+  /* if the requested offset is out of bounds, return info for
    * a zero-sized empty page right behind the last page.
    */
   if (baton->offset / header->page_size < header->page_count)
@@ -2595,7 +2595,7 @@ get_p2l_keys(p2l_page_info_baton_t *page
              apr_pool_t *scratch_pool)
 {
   p2l_page_info_baton_t page_info;
-  
+
   /* request info for the index pages that describes the pack / rev file
    * contents at pack / rev file position OFFSET. */
   page_info.offset = offset;
@@ -2611,7 +2611,7 @@ get_p2l_keys(p2l_page_info_baton_t *page
   /* return results */
   if (page_info_p)
     *page_info_p = page_info;
-  
+
   /* construct cache key */
   if (key_p)
     {
@@ -2621,7 +2621,7 @@ get_p2l_keys(p2l_page_info_baton_t *page
       key.is_packed = rev_file->is_packed;
       key.page = page_info.page_no;
 
-      *key_p = key;  
+      *key_p = key;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.h?rev=1660173&r1=1660172&r2=1660173&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/index.h Mon Feb 
16 17:40:07 2015
@@ -71,7 +71,7 @@ svn_fs_fs__l2p_proto_index_add_revision(
  * Not all possible index values need to be used.  OFFSET may be -1 to
  * mark 'invalid' item indexes but that is already implied for all item
  * indexes not explicitly given a mapping.
- * 
+ *
  * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
@@ -83,7 +83,7 @@ svn_fs_fs__l2p_proto_index_add_entry(apr
 /* Use the proto index file stored at PROTO_FILE_NAME, construct the final
  * log-to-phys index and append it to INDEX_FILE.  The first revision will
  * be REVISION, entries to the next revision will be assigned to REVISION+1
- * and so forth.  
+ * and so forth.
  *
  * Return the MD5 checksum of the on-disk index data in *CHECKSUM, allocated
  * in RESULT_POOL.  Use SCRATCH_POOL for temporary allocations.


Reply via email to