Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/copy.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/copy.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/copy.c 
Sat Feb 14 11:15:05 2015
@@ -177,12 +177,440 @@ get_copy_pair_ancestors(const apr_array_
   return SVN_NO_ERROR;
 }
 
+/* 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", item->target_dir, rev_str, 
item->url);
+        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 %s\n", rev_str, item->url, peg_rev_str,
+                       item->target_dir);
+        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 +623,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 +655,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 +692,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 +707,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 +1066,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 +1105,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 +1136,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 +1176,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 +1272,81 @@ 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 = svn_relpath_join(parent_info->src_path,
+                                            dst_relpath,
+                                            result_pool);
+          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 +1355,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 +1372,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 *);
@@ -1073,6 +1637,25 @@ repos_to_repos_copy(const apr_array_head
       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 +1744,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 +1835,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 +1904,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 +2102,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 +2258,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 +2316,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 +2376,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 +2490,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 +2557,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 +2570,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 +2680,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 +2707,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 +3011,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 +3044,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 +3072,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 +3108,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 +3171,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 +3206,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/remove-log-addressing/subversion/libsvn_client/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/deprecated.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_client/deprecated.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_client/deprecated.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/diff.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/diff.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/diff.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/externals.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_client/externals.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_client/externals.c 
Sat Feb 14 11:15:05 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

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_client/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/log.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/log.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/log.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/patch.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/patch.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/patch.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/prop_commands.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/prop_commands.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_client/prop_commands.c
 (original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_client/prop_commands.c
 Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/ra.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/ra.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/ra.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/ra.c Sat 
Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_client/update.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/update.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_client/update.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_client/update.c 
Sat Feb 14 11:15:05 2015
@@ -198,7 +198,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/remove-log-addressing/subversion/libsvn_delta/svndiff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_diff/parse-diff.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_diff/parse-diff.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_diff/parse-diff.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_diff/parse-diff.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_fs/fs-loader.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_fs_base/lock.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/lock.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/lock.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/lock.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/cached_data.c 
Sat Feb 14 11:15:05 2015
@@ -141,11 +141,11 @@ dbg_log_access(svn_fs_t *fs,
         }
     }
 
-  /* reduced logging for format 6 and earlier */
-  printf("%5s%10" APR_UINT64_T_HEX_FMT " %s %7ld %7" APR_UINT64_T_FMT \
-         "   %s\n",
-         pack, (apr_uint64_t)(offset), type, revision, item_index,
-         description);
+      /* reduced logging for format 6 and earlier */
+      printf("%5s%10" APR_UINT64_T_HEX_FMT " %s %7ld %7" APR_UINT64_T_FMT \
+             "   %s\n",
+             pack, (apr_uint64_t)(offset), type, revision, item_index,
+             description);
 #endif
 
   return SVN_NO_ERROR;
@@ -312,21 +312,21 @@ get_node_revision_body(node_revision_t *
                                      rev_item->number,
                                      scratch_pool));
 
-      /* physical addressing mode reading, parsing and caching */
-      SVN_ERR(svn_fs_fs__read_noderev(noderev_p,
-                                      revision_file->stream,
-                                      result_pool,
-                                      scratch_pool));
-
-      /* Workaround issue #4031: is-fresh-txn-root in revision files. */
-      (*noderev_p)->is_fresh_txn_root = FALSE;
-
-      /* The noderev is not in cache, yet. Add it, if caching has been 
enabled. */
-      if (ffd->node_revision_cache)
-        SVN_ERR(svn_cache__set(ffd->node_revision_cache,
-                               &key,
-                               *noderev_p,
-                               scratch_pool));
+          /* physical addressing mode reading, parsing and caching */
+          SVN_ERR(svn_fs_fs__read_noderev(noderev_p,
+                                          revision_file->stream,
+                                          result_pool,
+                                          scratch_pool));
+
+          /* Workaround issue #4031: is-fresh-txn-root in revision files. */
+          (*noderev_p)->is_fresh_txn_root = FALSE;
+
+          /* The noderev is not in cache, yet. Add it, if caching has been 
enabled. */
+          if (ffd->node_revision_cache)
+            SVN_ERR(svn_cache__set(ffd->node_revision_cache,
+                                   &key,
+                                   *noderev_p,
+                                   scratch_pool));
 
       SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
     }
@@ -488,32 +488,32 @@ svn_fs_fs__rev_get_root(svn_fs_id_t **ro
                         apr_pool_t *scratch_pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
-  svn_fs_fs__revision_file_t *revision_file;
-  apr_off_t root_offset;
-  svn_fs_id_t *root_id = NULL;
-  svn_boolean_t is_cached;
+      svn_fs_fs__revision_file_t *revision_file;
+      apr_off_t root_offset;
+      svn_fs_id_t *root_id = NULL;
+      svn_boolean_t is_cached;
 
   SVN_ERR(svn_fs_fs__ensure_revision_exists(rev, fs, scratch_pool));
 
-  SVN_ERR(svn_cache__get((void **) root_id_p, &is_cached,
-                        ffd->rev_root_id_cache, &rev, result_pool));
-  if (is_cached)
-    return SVN_NO_ERROR;
-
-  SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&revision_file, fs, rev,
-                                           scratch_pool, scratch_pool));
-  SVN_ERR(get_root_changes_offset(&root_offset, NULL,
-                                  revision_file, fs, rev,
-                                  scratch_pool));
+      SVN_ERR(svn_cache__get((void **) root_id_p, &is_cached,
+                            ffd->rev_root_id_cache, &rev, result_pool));
+      if (is_cached)
+        return SVN_NO_ERROR;
+
+      SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&revision_file, fs, rev,
+                                               scratch_pool, scratch_pool));
+      SVN_ERR(get_root_changes_offset(&root_offset, NULL,
+                                      revision_file, fs, rev,
+                                      scratch_pool));
 
-  SVN_ERR(get_fs_id_at_offset(&root_id, revision_file, fs, rev,
-                              root_offset, result_pool));
+      SVN_ERR(get_fs_id_at_offset(&root_id, revision_file, fs, rev,
+                                  root_offset, result_pool));
 
-  SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
+      SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
 
   SVN_ERR(svn_cache__set(ffd->rev_root_id_cache, &rev, root_id, scratch_pool));
 
-  *root_id_p = root_id;
+      *root_id_p = root_id;
 
   return SVN_NO_ERROR;
 }
@@ -770,9 +770,9 @@ create_rep_state_body(rep_state_t **rep_
       /* populate the cache if appropriate */
       if (! svn_fs_fs__id_txn_used(&rep->txn_id))
         {
-          if (ffd->rep_header_cache)
-            SVN_ERR(svn_cache__set(ffd->rep_header_cache, &key, rh,
-                                   scratch_pool));
+            if (ffd->rep_header_cache)
+              SVN_ERR(svn_cache__set(ffd->rep_header_cache, &key, rh,
+                                     scratch_pool));
         }
     }
 
@@ -848,12 +848,12 @@ svn_fs_fs__check_rep(representation_t *r
                      void **hint,
                      apr_pool_t *scratch_pool)
 {
-  rep_state_t *rs;
-  svn_fs_fs__rep_header_t *rep_header;
+      rep_state_t *rs;
+      svn_fs_fs__rep_header_t *rep_header;
 
-  /* ### Should this be using read_rep_line() directly? */
-  SVN_ERR(create_rep_state(&rs, &rep_header, (shared_file_t**)hint,
-                           rep, fs, scratch_pool, scratch_pool));
+      /* ### Should this be using read_rep_line() directly? */
+      SVN_ERR(create_rep_state(&rs, &rep_header, (shared_file_t**)hint,
+                               rep, fs, scratch_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c 
Sat Feb 14 11:15:05 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);
@@ -987,7 +987,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
 {
@@ -1128,7 +1128,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);
 }
 
@@ -1397,7 +1397,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/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c 
Sat Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_fs_fs/id.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c Sat 
Feb 14 11:15:05 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/remove-log-addressing/subversion/libsvn_fs_fs/lock.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/lock.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/lock.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/lock.c 
Sat Feb 14 11:15:05 2015
@@ -355,7 +355,7 @@ set_lock(const char *fs_path,
      always come back empty. */
   SVN_ERR(read_digest_file(&children, NULL, fs_path, digest_path, pool));
 
-  SVN_ERR(write_digest_file(children, lock, fs_path, digest_path, 
+  SVN_ERR(write_digest_file(children, lock, fs_path, digest_path,
                             perms_reference, pool));
 
   return SVN_NO_ERROR;
@@ -405,7 +405,7 @@ add_to_digest(const char *fs_path,
     }
 
   if (apr_hash_count(children) != original_count)
-    SVN_ERR(write_digest_file(children, lock, fs_path, index_digest_path, 
+    SVN_ERR(write_digest_file(children, lock, fs_path, index_digest_path,
                               perms_reference, pool));
 
   return SVN_NO_ERROR;
@@ -438,7 +438,7 @@ delete_from_digest(const char *fs_path,
     }
 
   if (apr_hash_count(children) || lock)
-    SVN_ERR(write_digest_file(children, lock, fs_path, index_digest_path, 
+    SVN_ERR(write_digest_file(children, lock, fs_path, index_digest_path,
                               perms_reference, pool));
   else
     SVN_ERR(svn_io_remove_file2(index_digest_path, TRUE, pool));
@@ -900,14 +900,17 @@ lock_body(void *baton, apr_pool_t *pool)
         {
           info->lock = svn_lock_create(lb->result_pool);
           if (target->token)
-            info->lock->token = target->token;
+            info->lock->token = apr_pstrdup(lb->result_pool, target->token);
           else
             SVN_ERR(svn_fs_fs__generate_lock_token(&(info->lock->token), 
lb->fs,
                                                    lb->result_pool));
 
+          /* The INFO->PATH is already allocated in LB->RESULT_POOL as a result
+             of svn_fspath__canonicalize() (see svn_fs_fs__lock()). */
           info->lock->path = info->path;
-          info->lock->owner = lb->fs->access_ctx->username;
-          info->lock->comment = lb->comment;
+          info->lock->owner = apr_pstrdup(lb->result_pool,
+                                          lb->fs->access_ctx->username);
+          info->lock->comment = apr_pstrdup(lb->result_pool, lb->comment);
           info->lock->is_dav_comment = lb->is_dav_comment;
           info->lock->creation_date = apr_time_now();
           info->lock->expiration_date = lb->expiration_date;
@@ -1147,7 +1150,7 @@ svn_fs_fs__lock(svn_fs_t *fs,
             info->fs_err = svn_error_createf(SVN_ERR_FS_LOCK_OPERATION_FAILED,
                                              0, _("Failed to lock '%s'"),
                                              info->path);
-                                             
+
           cb_err = lock_callback(lock_baton, info->path, info->lock,
                                  info->fs_err, scratch_pool);
         }

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/low_level.c 
Sat Feb 14 11:15:05 2015
@@ -430,7 +430,7 @@ svn_fs_fs__read_changes_incrementally(sv
     }
   while (change);
   svn_pool_destroy(iterpool);
-  
+
   return SVN_NO_ERROR;
 }
 
@@ -656,7 +656,7 @@ svn_fs_fs__parse_representation(represen
 
   /* initialize transaction info (never stored) */
   svn_fs_fs__id_txn_reset(&rep->txn_id);
-  
+
   /* while in transactions, it is legal to simply write "-1" */
   str = svn_cstring_tokenize(" ", &string);
   if (str == NULL)
@@ -929,7 +929,7 @@ format_digest(const unsigned char *diges
   svn_checksum_t checksum;
   checksum.digest = digest;
   checksum.kind = kind;
-  
+
   if (is_null)
     return "(null)";
 
@@ -1105,7 +1105,7 @@ svn_fs_fs__write_rep_header(svn_fs_fs__r
                             apr_pool_t *scratch_pool)
 {
   const char *text;
-  
+
   switch (header->type)
     {
       case svn_fs_fs__rep_plain:

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/recovery.c 
Sat Feb 14 11:15:05 2015
@@ -193,7 +193,7 @@ recover_find_max_ids(svn_fs_t *fs,
                               "representation"));
 
   /* Now create a stream that's allowed to read only as much data as is
-     stored in the representation.  Note that this is a directory, i.e. 
+     stored in the representation.  Note that this is a directory, i.e.
      represented using the hash format on disk and can never have 0 length. */
   baton.pool = pool;
   baton.remaining = noderev->data_rep->expanded_size

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.c 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.c 
Sat Feb 14 11:15:05 2015
@@ -111,7 +111,7 @@ svn_fs_fs__upgrade_cleanup_pack_revprops
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   const char *revsprops_dir = svn_dirent_join(fs->path, PATH_REVPROPS_DIR,
                                               scratch_pool);
-  
+
   /* delete the non-packed revprops shards afterwards */
   for (shard = 0; shard < first_unpacked_shard; ++shard)
     {

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.h?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.h 
(original)
+++ 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/revprops.h 
Sat Feb 14 11:15:05 2015
@@ -23,12 +23,12 @@
 #include "svn_fs.h"
 
 /* In the filesystem FS, pack all revprop shards up to min_unpacked_rev.
- * 
+ *
  * NOTE: Keep the old non-packed shards around until after the format bump.
  * Otherwise, re-running upgrade will drop the packed revprop shard but
  * have no unpacked data anymore.  Call upgrade_cleanup_pack_revprops after
  * the bump.
- * 
+ *
  * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
  * used in the usual way.  Temporary allocations are done in SCRATCH_POOL.
  */
@@ -42,7 +42,7 @@ svn_fs_fs__upgrade_pack_revprops(svn_fs_
 
 /* In the filesystem FS, remove all non-packed revprop shards up to
  * min_unpacked_rev.  Temporary allocations are done in SCRATCH_POOL.
- * 
+ *
  * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
  * used in the usual way.  Cancellation is supported in the sense that we
  * will cleanly abort the operation.  However, there will be remnant shards
@@ -79,7 +79,7 @@ svn_fs_fs__set_revision_proplist(svn_fs_
 
 /* Return TRUE, if for REVISION in FS, we can find the revprop pack file.
  * Use POOL for temporary allocations.
- * Set *MISSING, if the reason is a missing manifest or pack file. 
+ * Set *MISSING, if the reason is a missing manifest or pack file.
  */
 svn_boolean_t
 svn_fs_fs__packed_revprop_available(svn_boolean_t *missing,

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/stats.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/stats.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/stats.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/stats.c 
Sat Feb 14 11:15:05 2015
@@ -300,7 +300,7 @@ add_change(svn_fs_fs__stats_t *stats,
         add_to_histogram(&stats->dir_prop_rep_histogram, rep_size);
         add_to_histogram(&stats->dir_prop_histogram, expanded_size);
         break;
-      case file_property_rep: 
+      case file_property_rep:
         add_to_histogram(&stats->file_prop_rep_histogram, rep_size);
         add_to_histogram(&stats->file_prop_histogram, expanded_size);
         break;
@@ -690,7 +690,7 @@ read_phys_revision(query_t *query,
   trailer = svn_stringbuf_ncreate(buf, len, scratch_pool);
 
   /* Parse that trailer. */
-  SVN_ERR(svn_fs_fs__parse_revision_trailer(&root_node_offset, 
+  SVN_ERR(svn_fs_fs__parse_revision_trailer(&root_node_offset,
                                             &changes_offset, trailer,
                                             info->revision));
   SVN_ERR(get_phys_change_count(query, info, scratch_pool));

Modified: 
subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c?rev=1659777&r1=1659776&r2=1659777&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c 
(original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/tree.c 
Sat Feb 14 11:15:05 2015
@@ -90,7 +90,7 @@ typedef struct fs_txn_root_data_t
 {
   /* TXN_ID value from the main struct but as a struct instead of a string */
   svn_fs_fs__id_part_t txn_id;
-  
+
   /* Cache of txn DAG nodes (without their nested noderevs, because
    * it's mutable). Same keys/values as ffd->rev_node_cache. */
   svn_cache__t *txn_node_cache;
@@ -574,7 +574,7 @@ root_txn_id(svn_fs_root_t *root)
 {
   fs_txn_root_data_t *frd = root->fsap_data;
   assert(root->is_txn_root);
-  
+
   return &frd->txn_id;
 }
 
@@ -2095,7 +2095,7 @@ merge_changes(dag_node_t *ancestor_node,
   dag_node_t *txn_root_node;
   svn_fs_t *fs = txn->fs;
   const svn_fs_fs__id_part_t *txn_id = svn_fs_fs__txn_get_id(txn);
-  
+
   SVN_ERR(svn_fs_fs__dag_txn_root(&txn_root_node, fs, txn_id, pool));
 
   if (ancestor_node == NULL)
@@ -2905,7 +2905,7 @@ window_consumer(svn_txdelta_window_t *wi
      cb->target_string. */
   SVN_ERR(tb->interpreter(window, tb->interpreter_baton));
 
-  /* Is the window NULL?  If so, we're done.  The stream has already been 
+  /* Is the window NULL?  If so, we're done.  The stream has already been
      closed by the interpreter. */
   if (! window)
     SVN_ERR(svn_fs_fs__dag_finalize_edits(tb->node, tb->result_checksum,


Reply via email to