You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/11/14 14:17:12 UTC

svn commit: r1409189 [1/2] - in /subversion/branches/tree-read-api: ./ build/ac-macros/ subversion/bindings/javahl/native/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_ra_local/ su...

Author: julianfoad
Date: Wed Nov 14 13:17:08 2012
New Revision: 1409189

URL: http://svn.apache.org/viewvc?rev=1409189&view=rev
Log:
On the 'tree-read-api' branch: catch up to trunk@1409188.

Modified:
    subversion/branches/tree-read-api/   (props changed)
    subversion/branches/tree-read-api/build/ac-macros/apache.m4
    subversion/branches/tree-read-api/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/tree-read-api/subversion/include/private/svn_wc_private.h
    subversion/branches/tree-read-api/subversion/include/svn_client.h
    subversion/branches/tree-read-api/subversion/libsvn_client/add.c
    subversion/branches/tree-read-api/subversion/libsvn_client/client.h
    subversion/branches/tree-read-api/subversion/libsvn_client/commit.c
    subversion/branches/tree-read-api/subversion/libsvn_client/deprecated.c
    subversion/branches/tree-read-api/subversion/libsvn_client/ra.c
    subversion/branches/tree-read-api/subversion/libsvn_client/revisions.c
    subversion/branches/tree-read-api/subversion/libsvn_delta/debug_editor.c
    subversion/branches/tree-read-api/subversion/libsvn_ra_local/split_url.c
    subversion/branches/tree-read-api/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/tree-read-api/subversion/libsvn_ra_serf/update.c
    subversion/branches/tree-read-api/subversion/libsvn_ra_serf/util.c
    subversion/branches/tree-read-api/subversion/libsvn_ra_svn/client.c
    subversion/branches/tree-read-api/subversion/libsvn_subr/dirent_uri.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/adm_files.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/info.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/node.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/props.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/status.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/update_editor.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/wc.h
    subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.c
    subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.h
    subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/tree-read-api/subversion/mod_dav_svn/authz.c
    subversion/branches/tree-read-api/subversion/mod_dav_svn/dav_svn.h
    subversion/branches/tree-read-api/subversion/mod_dav_svn/repos.c
    subversion/branches/tree-read-api/subversion/svn/add-cmd.c
    subversion/branches/tree-read-api/subversion/svn/import-cmd.c
    subversion/branches/tree-read-api/subversion/svn/main.c
    subversion/branches/tree-read-api/subversion/svnmucc/svnmucc.c
    subversion/branches/tree-read-api/subversion/tests/cmdline/autoprop_tests.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/depth_tests.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/import_tests.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/verify.py
    subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py
    subversion/branches/tree-read-api/subversion/tests/libsvn_client/client-test.c
    subversion/branches/tree-read-api/subversion/tests/libsvn_subr/dirent_uri-test.c

Propchange: subversion/branches/tree-read-api/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1408109-1409188

Modified: subversion/branches/tree-read-api/build/ac-macros/apache.m4
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/build/ac-macros/apache.m4?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/build/ac-macros/apache.m4 (original)
+++ subversion/branches/tree-read-api/build/ac-macros/apache.m4 Wed Nov 14 13:17:08 2012
@@ -97,7 +97,7 @@ if test -n "$APXS" && test "$APXS" != "n
       apache_minor_version_wanted_regex="0"
       ;;
     1)
-      apache_minor_version_wanted_regex=["[1-4]"]
+      apache_minor_version_wanted_regex=["[1-5]"]
       ;;
     2)
       apache_minor_version_wanted_regex=["[3-5]"]

Modified: subversion/branches/tree-read-api/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/bindings/javahl/native/SVNClient.cpp?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/tree-read-api/subversion/bindings/javahl/native/SVNClient.cpp Wed Nov 14 13:17:08 2012
@@ -584,7 +584,7 @@ void SVNClient::doImport(const char *pat
         return;
 
     SVN_JNI_ERR(svn_client_import5(intPath.c_str(), intUrl.c_str(), depth,
-                                   noIgnore, ignoreUnknownNodeTypes,
+                                   noIgnore, FALSE, ignoreUnknownNodeTypes,
                                    revprops.hash(subPool),
                                    ImportFilterCallback::callback, ifCallback,
                                    CommitCallback::callback, commitCallback,

Modified: subversion/branches/tree-read-api/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/include/private/svn_wc_private.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/tree-read-api/subversion/include/private/svn_wc_private.h Wed Nov 14 13:17:08 2012
@@ -669,35 +669,6 @@ svn_wc__node_get_pre_ng_status_data(svn_
                                     apr_pool_t *result_pool,
                                     apr_pool_t *scratch_pool);
 
-
-/**
- * Return the location of the base for this node's next commit,
- * reflecting any local tree modifications affecting this node.
- *
- * Get the base location of @a local_abspath using @a wc_ctx.  If @a
- * local_abspath is not in the working copy, return @c
- * SVN_ERR_WC_PATH_NOT_FOUND.
- *
- * If this node has no uncommitted changes, return the same location as
- * svn_wc__node_get_base().
- *
- * If this node is moved-here or copied-here (possibly as part of a replace),
- * return the location of the copy/move source. Do the same even when the node
- * has been removed from a recursive copy (subpath excluded from the copy).
- *
- * Else, if this node is locally added, return SVN_INVALID_REVNUM/NULL, or
- * if locally deleted or replaced, return the revert-base location.
- */
-svn_error_t *
-svn_wc__node_get_commit_base(svn_revnum_t *revision,
-                             const char **repos_relpath,
-                             const char **repos_root_url,
-                             const char **repos_uuid,
-                             svn_wc_context_t *wc_ctx,
-                             const char *local_abspath,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool);
-
 /**
  * Fetch lock information (if any) for @a local_abspath using @a wc_ctx:
  *

Modified: subversion/branches/tree-read-api/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/include/svn_client.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/include/svn_client.h (original)
+++ subversion/branches/tree-read-api/subversion/include/svn_client.h Wed Nov 14 13:17:08 2012
@@ -1524,18 +1524,43 @@ svn_client_switch(svn_revnum_t *result_r
  * behaviour only when recursing into an already versioned directory with @a
  * force.)
  *
+ * If @a no_autoprops is TRUE, don't set any autoprops on added files. If
+ * @a no_autoprops is FALSE then all added files have autprops set as per
+ * the auto-props list in @a ctx->config and the value of any
+ * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by the nearest
+ * parents of @a path which are already under version control.
+ *
  * If @a add_parents is TRUE, recurse up @a path's directory and look for
  * a versioned directory.  If found, add all intermediate paths between it
  * and @a path.  If not found, return #SVN_ERR_CLIENT_NO_VERSIONED_PARENT.
  *
+ * @a scratch_pool is used for temporary allocations only.
+ *
  * @par Important:
  * This is a *scheduling* operation.  No changes will
  * happen to the repository until a commit occurs.  This scheduling
  * can be removed with svn_client_revert2().
  *
- * @since New in 1.5.
+ * @since New in 1.8.
  */
 svn_error_t *
+svn_client_add5(const char *path,
+                svn_depth_t depth,
+                svn_boolean_t force,
+                svn_boolean_t no_ignore,
+                svn_boolean_t no_autoprops,
+                svn_boolean_t add_parents,
+                svn_client_ctx_t *ctx,
+                apr_pool_t *scratch_pool);
+
+/**
+ * Similar to svn_client_add3(), but with @a no_autoprops always set to
+ * FALSE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
+ */
+SVN_DEPRECATED
+svn_error_t *
 svn_client_add4(const char *path,
                 svn_depth_t depth,
                 svn_boolean_t force,
@@ -1852,7 +1877,7 @@ typedef svn_error_t *(*svn_client_import
  * actions: #svn_wc_notify_commit_added,
  * #svn_wc_notify_commit_postfix_txdelta.
  *
- * Use @a pool for any temporary allocation.
+ * Use @a scratch_pool for any temporary allocation.
  *
  * If non-NULL, @a revprop_table is a hash table holding additional,
  * custom revision properties (<tt>const char *</tt> names mapped to
@@ -1879,6 +1904,13 @@ typedef svn_error_t *(*svn_client_import
  * if the target is part of a WC the import ignores any existing
  * properties.)
  *
+ * If @a no_autoprops is TRUE, don't set any autoprops on imported files. If
+ * @a no_autoprops is FALSE then all imported files have autprops set as per
+ * the auto-props list in @a ctx->config and the value of any
+ * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by and explicitly set
+ * on @a url if @a url is already under versioned control, or the nearest parents
+ * of @a path which are already under version control if not.
+ *
  * If @a ignore_unknown_node_types is @c FALSE, ignore files of which the
  * node type is unknown, such as device files and pipes.
  *
@@ -1897,6 +1929,7 @@ svn_client_import5(const char *path,
                    const char *url,
                    svn_depth_t depth,
                    svn_boolean_t no_ignore,
+                   svn_boolean_t no_autoprops,
                    svn_boolean_t ignore_unknown_node_types,
                    const apr_hash_t *revprop_table,
                    svn_client_import_filter_func_t filter_callback,
@@ -1908,7 +1941,7 @@ svn_client_import5(const char *path,
 
 /**
  * Similar to svn_client_import5(), but without support for an optional
- * @a filter_callback.
+ * @a filter_callback and @a no_autoprops always set to FALSE.
  *
  * @since New in 1.7.
  * @deprecated Provided for backward compatibility with the 1.7 API.

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/add.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/add.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/add.c Wed Nov 14 13:17:08 2012
@@ -201,16 +201,19 @@ svn_client__get_paths_auto_props(apr_has
   *properties = apr_hash_make(result_pool);
   *mimetype = NULL;
 
-  for (hi = apr_hash_first(scratch_pool, autoprops);
-       hi != NULL;
-       hi = apr_hash_next(hi))
-    {
-      const char *pattern = svn__apr_hash_index_key(hi);
-      apr_hash_t *propvals = svn__apr_hash_index_val(hi);
-
-      get_auto_props_for_pattern(*properties, mimetype, &have_executable,
-                                 svn_dirent_basename(path, scratch_pool),
-                                 pattern, propvals, scratch_pool);
+  if (autoprops)
+    {
+      for (hi = apr_hash_first(scratch_pool, autoprops);
+           hi != NULL;
+           hi = apr_hash_next(hi))
+        {
+          const char *pattern = svn__apr_hash_index_key(hi);
+          apr_hash_t *propvals = svn__apr_hash_index_val(hi);
+
+          get_auto_props_for_pattern(*properties, mimetype, &have_executable,
+                                     svn_dirent_basename(path, scratch_pool),
+                                     pattern, propvals, scratch_pool);
+        }
     }
 
   /* if mimetype has not been set check the file */
@@ -267,10 +270,11 @@ static svn_error_t *
 add_file(const char *local_abspath,
          svn_magic__cookie_t *magic_cookie,
          apr_hash_t *autoprops,
+         svn_boolean_t no_autoprops,
          svn_client_ctx_t *ctx,
          apr_pool_t *pool)
 {
-  apr_hash_t* properties;
+  apr_hash_t* properties = NULL;
   apr_hash_index_t *hi;
   const char *mimetype;
   svn_node_kind_t kind;
@@ -289,18 +293,21 @@ add_file(const char *local_abspath,
     }
   else
     {
-      apr_hash_t *file_autoprops;
+      apr_hash_t *file_autoprops = NULL;
 
       /* Get automatic properties */
-      /* Grab the inherited svn:auto-props and config file
-         auto-props for this file if we haven't already got them
+      /* If we are setting autoprops grab the inherited svn:auto-props and
+         config file auto-props for this file if we haven't already got them
          when iterating over the file's unversioned parents. */
-      if (autoprops == NULL)
-        SVN_ERR(svn_client__get_all_auto_props(
-          &file_autoprops, svn_dirent_dirname(local_abspath,pool),
-          ctx, pool, pool));
-      else
-        file_autoprops = autoprops;
+      if (!no_autoprops)
+        {
+          if (autoprops == NULL)
+            SVN_ERR(svn_client__get_all_auto_props(
+              &file_autoprops, svn_dirent_dirname(local_abspath,pool),
+              ctx, pool, pool));
+          else
+            file_autoprops = autoprops;
+        }
 
       /* This may fail on write-only files:
          we open them to estimate file type.
@@ -341,14 +348,15 @@ add_file(const char *local_abspath,
             {
               /* Don't leave the job half-done. If we fail to set a property,
                * (try to) un-add the file. */
-              svn_error_clear(svn_wc_revert4(ctx->wc_ctx,
+              return svn_error_compose_create(
+                              err,
+                              svn_wc_revert4(ctx->wc_ctx,
                                              local_abspath,
                                              svn_depth_empty,
                                              FALSE /* use_commit_times */,
                                              NULL /* changelists */,
                                              NULL, NULL, NULL, NULL,
                                              pool));
-              return svn_error_trace(err);
             }
         }
     }
@@ -406,6 +414,7 @@ add_dir_recursive(const char *dir_abspat
                   svn_depth_t depth,
                   svn_boolean_t force,
                   svn_boolean_t no_ignore,
+                  svn_boolean_t no_autoprops,
                   svn_magic__cookie_t *magic_cookie,
                   apr_hash_t **config_autoprops,
                   svn_boolean_t refresh_ignores,
@@ -509,15 +518,16 @@ add_dir_recursive(const char *dir_abspat
             refresh_ignores = FALSE;
 
           SVN_ERR(add_dir_recursive(abspath, depth_below_here,
-                                    force, no_ignore, magic_cookie,
-                                    config_autoprops, refresh_ignores,
-                                    ignores, ctx, iterpool, iterpool));
+                                    force, no_ignore, no_autoprops,
+                                    magic_cookie, config_autoprops,
+                                    refresh_ignores, ignores, ctx,
+                                    iterpool, iterpool));
         }
       else if ((dirent->kind == svn_node_file || dirent->special)
                && depth >= svn_depth_files)
         {
-          err = add_file(abspath, magic_cookie, *config_autoprops, ctx,
-                         iterpool);
+          err = add_file(abspath, magic_cookie, *config_autoprops,
+                         no_autoprops, ctx, iterpool);
           if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
             svn_error_clear(err);
           else
@@ -692,6 +702,7 @@ svn_client__get_all_auto_props(apr_hash_
   svn_boolean_t use_autoprops;
   collect_auto_props_baton_t autoprops_baton;
   svn_error_t *err = NULL;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t target_is_url = svn_path_is_url(path_or_url);
   svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
                                                  SVN_CONFIG_CATEGORY_CONFIG,
@@ -699,6 +710,7 @@ svn_client__get_all_auto_props(apr_hash_
   *autoprops = apr_hash_make(result_pool);
   autoprops_baton.result_pool = result_pool;
   autoprops_baton.autoprops = *autoprops;
+  
 
   /* Are "traditional" auto-props enabled?  If so grab them from the
     config.  This is our starting set auto-props, which may be overriden
@@ -720,7 +732,7 @@ svn_client__get_all_auto_props(apr_hash_
 
   /* If PATH_OR_URL is a WC path, then it might be unversioned, in which case
      we find it's nearest versioned parent. */
-  while (err == NULL)
+  do
     {
       err = svn_client_propget5(&props, &inherited_config_auto_props,
                                 SVN_PROP_INHERITABLE_AUTO_PROPS, path_or_url,
@@ -741,6 +753,7 @@ svn_client__get_all_auto_props(apr_hash_
           break;
         }
     }
+  while (err == NULL);
 
   /* Stash any explicit PROPS for PARENT_PATH into the inherited props array,
      since these are actually inherited props for LOCAL_ABSPATH. */
@@ -765,7 +778,6 @@ svn_client__get_all_auto_props(apr_hash_
       apr_hash_index_t *hi;
       svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
         inherited_config_auto_props, i, svn_prop_inherited_item_t *);
-      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
       for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
            hi;
@@ -819,9 +831,11 @@ svn_client__get_all_auto_props(apr_hash_
               if (*ch == '\n')
                 ch++;
             }
-          svn_pool_destroy(iterpool);
         }
     }
+
+  svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }
 
@@ -963,7 +977,7 @@ svn_error_t *svn_client__get_all_ignores
   return SVN_NO_ERROR;
 }
 
-/* The main logic of the public svn_client_add4.
+/* The main logic of the public svn_client_add5.
  *
  * EXISTING_PARENT_ABSPATH is the absolute path to the first existing
  * parent directory of local_abspath. If not NULL, all missing parents
@@ -973,6 +987,7 @@ add(const char *local_abspath,
     svn_depth_t depth,
     svn_boolean_t force,
     svn_boolean_t no_ignore,
+    svn_boolean_t no_autoprops,
     const char *existing_parent_abspath,
     svn_client_ctx_t *ctx,
     apr_pool_t *scratch_pool)
@@ -1032,12 +1047,12 @@ add(const char *local_abspath,
          and pass depth along no matter what it is, so that the
          target's depth will be set correctly. */
       err = add_dir_recursive(local_abspath, depth, force, no_ignore,
-                              magic_cookie, &config_autoprops, TRUE, ignores,
-                              ctx, scratch_pool, scratch_pool);
+                              no_autoprops, magic_cookie, &config_autoprops,
+                              TRUE, ignores, ctx, scratch_pool, scratch_pool);
     }
   else if (kind == svn_node_file)
-    err = add_file(local_abspath, magic_cookie, config_autoprops, ctx,
-                   scratch_pool);
+    err = add_file(local_abspath, magic_cookie, config_autoprops,
+                   no_autoprops, ctx, scratch_pool);
   else if (kind == svn_node_none)
     {
       svn_boolean_t tree_conflicted;
@@ -1080,13 +1095,14 @@ add(const char *local_abspath,
 
 
 svn_error_t *
-svn_client_add4(const char *path,
+svn_client_add5(const char *path,
                 svn_depth_t depth,
                 svn_boolean_t force,
                 svn_boolean_t no_ignore,
+                svn_boolean_t no_autoprops,
                 svn_boolean_t add_parents,
                 svn_client_ctx_t *ctx,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
   const char *parent_abspath;
   const char *local_abspath;
@@ -1098,14 +1114,14 @@ svn_client_add4(const char *path,
     return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
                              _("'%s' is not a local path"), path);
 
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
 
   /* See if we're being asked to add a wc-root.  That's typically not
      okay, unless we're in "force" mode.  svn_wc__strictly_is_wc_root()
      will return TRUE even if LOCAL_ABSPATH is a *symlink* to a working
      copy root, which is a scenario we want to treat differently.  */
   err = svn_wc__strictly_is_wc_root(&is_wc_root, ctx->wc_ctx,
-                                    local_abspath, pool);
+                                    local_abspath, scratch_pool);
   if (err)
     {
       if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
@@ -1125,7 +1141,7 @@ svn_client_add4(const char *path,
       svn_boolean_t is_special;
 
       SVN_ERR(svn_io_check_special_path(local_abspath, &disk_kind, &is_special,
-                                        pool));
+                                        scratch_pool));
 
       /* A symlink can be an unversioned target and a wcroot. Lets try to add
          the symlink, which can't be a wcroot. */
@@ -1138,14 +1154,15 @@ svn_client_add4(const char *path,
             return svn_error_createf(
                                  SVN_ERR_ENTRY_EXISTS, NULL,
                                  _("'%s' is already under version control"),
-                                 svn_dirent_local_style(local_abspath, pool));
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool));
         }
     }
 
   if (is_wc_root)
     parent_abspath = local_abspath; /* We will only add children */
   else
-    parent_abspath = svn_dirent_dirname(local_abspath, pool);
+    parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   existing_parent_abspath = NULL;
   if (add_parents && !is_wc_root)
@@ -1153,20 +1170,20 @@ svn_client_add4(const char *path,
       apr_pool_t *subpool;
       const char *existing_parent_abspath2;
 
-      subpool = svn_pool_create(pool);
+      subpool = svn_pool_create(scratch_pool);
       SVN_ERR(find_existing_parent(&existing_parent_abspath2, ctx,
-                                   parent_abspath, pool, subpool));
+                                   parent_abspath, scratch_pool, subpool));
       if (strcmp(existing_parent_abspath2, parent_abspath) != 0)
         existing_parent_abspath = existing_parent_abspath2;
       svn_pool_destroy(subpool);
     }
 
   SVN_WC__CALL_WITH_WRITE_LOCK(
-    add(local_abspath, depth, force, no_ignore, existing_parent_abspath,
-        ctx, pool),
+    add(local_abspath, depth, force, no_ignore, no_autoprops,
+        existing_parent_abspath, ctx, scratch_pool),
     ctx->wc_ctx, (existing_parent_abspath ? existing_parent_abspath 
                                           : parent_abspath),
-    FALSE /* lock_anchor */, pool);
+    FALSE /* lock_anchor */, scratch_pool);
   return SVN_NO_ERROR;
 }
 
@@ -1398,7 +1415,7 @@ svn_client__make_local_parents(const cha
      itself is added, since it not only constraints the operation depth, but
      also defines the depth of the target directory now. Moreover, the new
      directory will have no children at all.*/
-  err = svn_client_add4(path, svn_depth_infinity, FALSE, FALSE,
+  err = svn_client_add5(path, svn_depth_infinity, FALSE, FALSE, FALSE,
                         make_parents, ctx, pool);
 
   /* If we created a new directory, but couldn't add it to version

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/client.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/client.h (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/client.h Wed Nov 14 13:17:08 2012
@@ -326,17 +326,18 @@ svn_client__ra_make_cb_baton(svn_wc_cont
 
 /*** Add/delete ***/
 
-/* Read automatic properties matching PATH from AUTOPROPS.  AUTOPROPS
-   is is a hash as per svn_client__get_all_auto_props.
-
-   Set *PROPERTIES to a hash containing propname/value pairs
-   (const char * keys mapping to svn_string_t * values).  *PROPERTIES
-   may be an empty hash, but will not be NULL.
-
-   Set *MIMETYPE to the mimetype, if any, or to NULL.
-
-   If MAGIC_COOKIE is not NULL and no mime-type can be determined
-   via CTX->config try to detect the mime-type with libmagic.
+/* If AUTOPROPS is not null: Then read automatic properties matching PATH
+   from AUTOPROPS.  AUTOPROPS is is a hash as per
+   svn_client__get_all_auto_props.  Set *PROPERTIES to a hash containing
+   propname/value pairs (const char * keys mapping to svn_string_t * values).
+
+   If AUTOPROPS is null then set *PROPERTIES to an empty hash.
+
+   If *MIMETYPE is null or "application/octet-stream" then check AUTOPROPS
+   for a matching svn:mime-type.  If AUTOPROPS is null or no match is found
+   and MAGIC_COOKIE is not NULL, then then try to detect the mime-type with
+   libmagic.  If a mimetype is found then add it to *PROPERTIES and set
+   *MIMETYPE to the mimetype value or NULL otherwise.
 
    Allocate the *PROPERTIES and its contents as well as *MIMETYPE, in
    RESULT_POOL.  Use SCRATCH_POOL for temporary allocations. */
@@ -628,17 +629,16 @@ svn_client__get_inheritable_props(apr_ha
 /* Create an editor for a pure repository comparison, i.e. comparing one
    repository version against the other.
 
-   DIFF_CMD/DIFF_CMD_BATON represent the callback and callback argument that
-   implement the file comparison function
+   DIFF_CALLBACKS/DIFF_CMD_BATON represent the callback that implements
+   the comparison.
 
    DEPTH is the depth to recurse.
 
    RA_SESSION is an RA session through which this editor may fetch
    properties, file contents and directory listings of the 'old' side of the
    diff. It is a separate RA session from the one through which this editor
-   is being driven.
-
-   REVISION is the start revision in the comparison.
+   is being driven. REVISION is the revision number of the 'old' side of
+   the diff.
 
    For each deleted directory, if WALK_DELETED_DIRS is true then just call
    the 'dir_deleted' callback once, otherwise call the 'file_deleted' or

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/commit.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/commit.c Wed Nov 14 13:17:08 2012
@@ -79,8 +79,9 @@ typedef struct import_ctx_t
   /* Collection of all possible configuration file dictated auto-props and
      svn:auto-props.  A hash mapping const char * file patterns to a
      second hash which maps const char * property names to const char *
-     property values.  Properties which don't have a value, e.g. svn:executable,
-     simply map the property name to an empty string. */
+     property values.  Properties which don't have a value, e.g.
+     svn:executable, simply map the property name to an empty string.
+     May be NULL if autoprops are disabled. */
   apr_hash_t *autoprops;
 } import_ctx_t;
 
@@ -287,7 +288,7 @@ import_file(const svn_delta_editor_t *ed
 
 /* Return in CHILDREN a mapping of basenames to dirents for the importable
  * children of DIR_ABSPATH.  EXCLUDES is a hash of absolute paths to filter
- * out.  IGNORES and MANDATORY_IGNORES, if non-NULL, are lists of basename
+ * out.  IGNORES and GLOBAL_IGNORES, if non-NULL, are lists of basename
  * patterns to filter out.
  * FILTER_CALLBACK and FILTER_BATON will be called for each absolute path,
  * allowing users to further filter the list of returned entries.
@@ -298,7 +299,7 @@ get_filtered_children(apr_hash_t **child
                       const char *dir_abspath,
                       apr_hash_t *excludes,
                       apr_array_header_t *ignores,
-                      apr_array_header_t *mandatory_ignores,
+                      apr_array_header_t *global_ignores,
                       svn_client_import_filter_func_t filter_callback,
                       void *filter_baton,
                       svn_client_ctx_t *ctx,
@@ -359,7 +360,8 @@ get_filtered_children(apr_hash_t **child
           continue;
         }
 
-      if (svn_wc_match_ignore_list(base_name, mandatory_ignores, iterpool))
+      if (global_ignores &&
+          svn_wc_match_ignore_list(base_name, global_ignores, iterpool))
         {
           apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
           continue;
@@ -392,8 +394,9 @@ import_dir(const svn_delta_editor_t *edi
            const char *edit_path,
            svn_depth_t depth,
            apr_hash_t *excludes,
-           apr_array_header_t *mandatory_ignores,
+           apr_array_header_t *global_ignores,
            svn_boolean_t no_ignore,
+           svn_boolean_t no_autoprops,
            svn_boolean_t ignore_unknown_node_types,
            svn_client_import_filter_func_t filter_callback,
            void *filter_baton,
@@ -412,8 +415,9 @@ import_children(const char *dir_abspath,
                 void *dir_baton,
                 svn_depth_t depth,
                 apr_hash_t *excludes,
-                apr_array_header_t *mandatory_ignores,
+                apr_array_header_t *global_ignores,
                 svn_boolean_t no_ignore,
+                svn_boolean_t no_autoprops,
                 svn_boolean_t ignore_unknown_node_types,
                 svn_client_import_filter_func_t filter_callback,
                 void *filter_baton,
@@ -455,7 +459,7 @@ import_children(const char *dir_abspath,
 
           SVN_ERR(import_dir(editor, dir_baton, this_abspath,
                              this_edit_path, depth_below_here, excludes,
-                             mandatory_ignores, no_ignore,
+                             global_ignores, no_ignore, no_autoprops,
                              ignore_unknown_node_types, filter_callback,
                              filter_baton, import_ctx, ctx, iterpool));
         }
@@ -508,7 +512,7 @@ import_children(const char *dir_abspath,
  * EXCLUDES is a hash whose keys are absolute paths to exclude from
  * the import (values are unused).
  *
- * MANDATORY_IGNORES is an array of const char * ignore patterns.  Any child
+ * GLOBAL_IGNORES is an array of const char * ignore patterns.  Any child
  * of LOCAL_ABSPATH which matches one or more of the patterns is not imported.
  *
  * If NO_IGNORE is FALSE, don't import files or directories that match
@@ -528,8 +532,9 @@ import_dir(const svn_delta_editor_t *edi
            const char *edit_path,
            svn_depth_t depth,
            apr_hash_t *excludes,
-           apr_array_header_t *mandatory_ignores,
+           apr_array_header_t *global_ignores,
            svn_boolean_t no_ignore,
+           svn_boolean_t no_autoprops,
            svn_boolean_t ignore_unknown_node_types,
            svn_client_import_filter_func_t filter_callback,
            void *filter_baton,
@@ -538,16 +543,11 @@ import_dir(const svn_delta_editor_t *edi
            apr_pool_t *pool)
 {
   apr_hash_t *dirents;
-  apr_array_header_t *ignores = NULL;
   void *this_dir_baton;
 
   SVN_ERR(svn_path_check_valid(local_abspath, pool));
-
-  if (!no_ignore)
-    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-
-  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
-                                mandatory_ignores, filter_callback,
+  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, NULL,
+                                global_ignores, filter_callback,
                                 filter_baton, ctx, pool, pool));
 
   /* Import this directory, but not yet its children. */
@@ -578,8 +578,8 @@ import_dir(const svn_delta_editor_t *edi
 
   /* Now import the children recursively. */
   SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
-                          this_dir_baton, depth, excludes, mandatory_ignores,
-                          no_ignore, ignore_unknown_node_types,
+                          this_dir_baton, depth, excludes, global_ignores,
+                          no_ignore, no_autoprops, ignore_unknown_node_types,
                           filter_callback, filter_baton,
                           import_ctx, ctx, pool));
 
@@ -621,7 +621,7 @@ import_dir(const svn_delta_editor_t *edi
  * repository target and thus dictates which immediate children of that
  * target should be ignored and not imported.
  *
- * MANDATORY_IGNORES is an array of const char * ignore patterns which
+ * GLOBAL_IGNORES is an array of const char * ignore patterns which
  * correspond to the svn:global-ignores properties (if any) set on
  * the root of the repository target or inherited by it.
  *
@@ -647,8 +647,9 @@ import(const char *local_abspath,
        apr_hash_t *excludes,
        apr_hash_t *autoprops,
        apr_array_header_t *local_ignores,
-       apr_array_header_t *mandatory_ignores,
+       apr_array_header_t *global_ignores,
        svn_boolean_t no_ignore,
+       svn_boolean_t no_autoprops,
        svn_boolean_t ignore_unknown_node_types,
        svn_client_import_filter_func_t filter_callback,
        void *filter_baton,
@@ -656,7 +657,6 @@ import(const char *local_abspath,
        apr_pool_t *pool)
 {
   void *root_baton;
-  apr_array_header_t *ignores = NULL;
   apr_array_header_t *batons = NULL;
   const char *edit_path = "";
   import_ctx_t *import_ctx = apr_pcalloc(pool, sizeof(*import_ctx));
@@ -724,12 +724,10 @@ import(const char *local_abspath,
       svn_boolean_t ignores_match = FALSE;
 
       if (!no_ignore)
-        {
-          SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-          ignores_match =
-            (svn_wc_match_ignore_list(local_abspath, ignores, pool)
-             || svn_wc_match_ignore_list(local_abspath, local_ignores, pool));
-        }
+        ignores_match =
+          (svn_wc_match_ignore_list(local_abspath, global_ignores, pool)
+           || svn_wc_match_ignore_list(local_abspath, local_ignores, pool));
+
       if (!ignores_match)
         SVN_ERR(import_file(editor, root_baton, local_abspath, edit_path,
                             dirent, import_ctx, ctx, pool));
@@ -738,38 +736,21 @@ import(const char *local_abspath,
     {
       apr_hash_t *dirents;
 
-      if (!no_ignore)
-        {
-          int i;
-
-          SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-
-          /* If we are not creating new repository paths, then we are creating
-             importing new paths to an existing directory.  If that directory
-             has the svn:ignore property set on it, then we want to ignore
-             immediate children that match the pattern(s) defined by that
-             property. */
-          if (!new_entries->nelts)
-            {
-              for (i = 0; i < local_ignores->nelts; i++)
-                {
-                  const char *ignore = APR_ARRAY_IDX(local_ignores, i,
-                                                     const char *);
-                  APR_ARRAY_PUSH(ignores, const char *) = ignore;
-                }          
-            }
-        }
+      /* If we are creating a new repository directory path to import to,
+         then we disregard any svn:ignore property. */
+      if (!no_ignore && new_entries->nelts)
+        local_ignores = NULL;
 
       SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes,
-                                    ignores, mandatory_ignores,
+                                    local_ignores, global_ignores,
                                     filter_callback, filter_baton, ctx,
                                     pool, pool));
 
       SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
-                              root_baton, depth, excludes, mandatory_ignores,
-                              no_ignore, ignore_unknown_node_types,
-                              filter_callback, filter_baton,
-                              import_ctx, ctx, pool));
+                              root_baton, depth, excludes, global_ignores,
+                              no_ignore, no_autoprops,
+                              ignore_unknown_node_types, filter_callback,
+                              filter_baton, import_ctx, ctx, pool));
 
     }
   else if (dirent->kind == svn_node_none
@@ -890,6 +871,7 @@ svn_client_import5(const char *path,
                    const char *url,
                    svn_depth_t depth,
                    svn_boolean_t no_ignore,
+                   svn_boolean_t no_autoprops,
                    svn_boolean_t ignore_unknown_node_types,
                    const apr_hash_t *revprop_table,
                    svn_client_import_filter_func_t filter_callback,
@@ -913,9 +895,8 @@ svn_client_import5(const char *path,
   const char *dir;
   apr_hash_t *commit_revprops;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-  apr_hash_t *autoprops;
-  apr_array_header_t *mandatory_ignores;
-  svn_opt_revision_t rev;
+  apr_hash_t *autoprops = NULL;
+  apr_array_header_t *global_ignores;
   apr_hash_t *local_ignores_hash;
   apr_array_header_t *local_ignores_arr;
 
@@ -1031,24 +1012,41 @@ svn_client_import5(const char *path,
 
   /* Get inherited svn:auto-props, svn:global-ignores, and
      svn:ignores for the location we are importing to. */
-  SVN_ERR(svn_client__get_all_auto_props(&autoprops, url, ctx,
-                                         scratch_pool, iterpool));
-  SVN_ERR(svn_client__get_inherited_ignores(&mandatory_ignores, url,
-                                            ctx, scratch_pool, iterpool));
-  rev.kind = svn_opt_revision_head;
-  SVN_ERR(svn_client_propget5(&local_ignores_hash, NULL, SVN_PROP_IGNORE, url,
-                              &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
-                              scratch_pool, scratch_pool));
-  local_ignores_arr = apr_array_make(scratch_pool, 1, sizeof(const char *));
-
-  if (apr_hash_count(local_ignores_hash))
-    {
-      svn_string_t *propval = apr_hash_get(local_ignores_hash, url,
-                                           APR_HASH_KEY_STRING);
-      if (propval)
-        {
-          svn_cstring_split_append(local_ignores_arr, propval->data,
-                                   "\n\r\t\v ", FALSE, scratch_pool);
+  if (!no_autoprops)
+    SVN_ERR(svn_client__get_all_auto_props(&autoprops, url, ctx,
+                                           scratch_pool, iterpool));
+  if (no_ignore)
+    {
+      global_ignores = NULL;
+      local_ignores_arr = NULL;
+    }
+  else
+    {
+      svn_opt_revision_t rev;
+      apr_array_header_t *config_ignores;
+
+      SVN_ERR(svn_client__get_inherited_ignores(&global_ignores, url, ctx,
+                                                scratch_pool, iterpool));
+      SVN_ERR(svn_wc_get_default_ignores(&config_ignores, ctx->config,
+                                         scratch_pool));
+      global_ignores = apr_array_append(scratch_pool, global_ignores,
+                                        config_ignores);
+
+      rev.kind = svn_opt_revision_head;
+      SVN_ERR(svn_client_propget5(&local_ignores_hash, NULL, SVN_PROP_IGNORE, url,
+                                  &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
+                                  scratch_pool, scratch_pool));
+      local_ignores_arr = apr_array_make(scratch_pool, 1, sizeof(const char *));
+
+      if (apr_hash_count(local_ignores_hash))
+        {
+          svn_string_t *propval = apr_hash_get(local_ignores_hash, url,
+                                               APR_HASH_KEY_STRING);
+          if (propval)
+            {
+              svn_cstring_split_append(local_ignores_arr, propval->data,
+                                       "\n\r\t\v ", FALSE, scratch_pool);
+            }
         }
     }
 
@@ -1056,8 +1054,9 @@ svn_client_import5(const char *path,
      the error.  We don't even care if the abort itself fails.  */
   if ((err = import(local_abspath, new_entries, editor, edit_baton,
                     depth, excludes, autoprops, local_ignores_arr,
-                    mandatory_ignores, no_ignore, ignore_unknown_node_types,
-                    filter_callback, filter_baton, ctx, iterpool)))
+                    global_ignores, no_ignore, no_autoprops,
+                    ignore_unknown_node_types, filter_callback,
+                    filter_baton, ctx, iterpool)))
     {
       svn_error_clear(editor->abort_edit(edit_baton, iterpool));
       return svn_error_trace(err);

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/deprecated.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/deprecated.c Wed Nov 14 13:17:08 2012
@@ -78,6 +78,19 @@ capture_commit_info(const svn_commit_inf
 
 /*** From add.c ***/
 svn_error_t *
+svn_client_add4(const char *path,
+                svn_depth_t depth,
+                svn_boolean_t force,
+                svn_boolean_t no_ignore,
+                svn_boolean_t add_parents,
+                svn_client_ctx_t *ctx,
+                apr_pool_t *pool)
+{
+  return svn_client_add5(path, depth, force, no_ignore, FALSE, add_parents,
+                         ctx, pool);
+}
+
+svn_error_t *
 svn_client_add3(const char *path,
                 svn_boolean_t recursive,
                 svn_boolean_t force,
@@ -398,7 +411,7 @@ svn_client_import4(const char *path,
                    apr_pool_t *pool)
 {
   return svn_error_trace(svn_client_import5(path, url, depth, no_ignore,
-                                            ignore_unknown_node_types,
+                                            FALSE, ignore_unknown_node_types,
                                             revprop_table,
                                             NULL, NULL,
                                             commit_callback, commit_baton,

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/ra.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/ra.c Wed Nov 14 13:17:08 2012
@@ -1033,9 +1033,9 @@ svn_client__ra_provide_base(svn_stream_t
     {
       /* The pristine contents refer to the BASE, or to the pristine of
          a copy/move to this location. Fetch the correct revision.  */
-      SVN_ERR(svn_wc__node_get_commit_base(revision, NULL, NULL, NULL,
-                                           reb->wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__node_get_origin(NULL, revision, NULL, NULL, NULL, NULL,
+                                      reb->wc_ctx, local_abspath, FALSE,
+                                      scratch_pool, scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -1078,9 +1078,9 @@ svn_client__ra_provide_props(apr_hash_t 
     {
       /* The pristine props refer to the BASE, or to the pristine props of
          a copy/move to this location. Fetch the correct revision.  */
-      SVN_ERR(svn_wc__node_get_commit_base(revision, NULL, NULL, NULL,
-                                           reb->wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__node_get_origin(NULL, revision, NULL, NULL, NULL, NULL,
+                                      reb->wc_ctx, local_abspath, FALSE,
+                                      scratch_pool, scratch_pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/revisions.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/revisions.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/revisions.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/revisions.c Wed Nov 14 13:17:08 2012
@@ -91,9 +91,9 @@ svn_client__get_revision_number(svn_revn
         if (svn_path_is_url(local_abspath))
           goto invalid_rev_arg;
 
-        err = svn_wc__node_get_commit_base(revnum, NULL, NULL, NULL,
-                                           wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool);
+        err = svn_wc__node_get_origin(NULL, revnum, NULL, NULL, NULL, NULL,
+                                      wc_ctx, local_abspath, TRUE,
+                                      scratch_pool, scratch_pool);
 
         /* Return the same error as older code did (before and at r935091).
            At least svn_client_proplist4 promises SVN_ERR_ENTRY_NOT_FOUND. */

Modified: subversion/branches/tree-read-api/subversion/libsvn_delta/debug_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_delta/debug_editor.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_delta/debug_editor.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_delta/debug_editor.c Wed Nov 14 13:17:08 2012
@@ -52,6 +52,8 @@ write_indent(struct edit_baton *eb, apr_
 {
   int i;
 
+  /* This is DBG_FLAG from ../libsvn_subr/debug.c */
+  SVN_ERR(svn_stream_puts(eb->out, "DBG:"));
   for (i = 0; i < eb->indent_level; ++i)
     SVN_ERR(svn_stream_puts(eb->out, " "));
 

Modified: subversion/branches/tree-read-api/subversion/libsvn_ra_local/split_url.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_ra_local/split_url.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_ra_local/split_url.c Wed Nov 14 13:17:08 2012
@@ -23,14 +23,13 @@
 
 #include "ra_local.h"
 #include <string.h>
-#include "svn_path.h"
 #include "svn_dirent_uri.h"
 #include "svn_private_config.h"
 
 
 svn_error_t *
 svn_ra_local__split_URL(svn_repos_t **repos,
-                        const char **repos_url,
+                        const char **repos_root_url,
                         const char **fs_path,
                         const char *URL,
                         apr_pool_t *pool)
@@ -38,7 +37,6 @@ svn_ra_local__split_URL(svn_repos_t **re
   svn_error_t *err = SVN_NO_ERROR;
   const char *repos_dirent;
   const char *repos_root_dirent;
-  svn_stringbuf_t *urlbuf;
 
   SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
 
@@ -61,18 +59,18 @@ svn_ra_local__split_URL(svn_repos_t **re
     SVN_ERR(svn_repos_remember_client_capabilities(*repos, caps));
   }
 
+  /* = apr_pstrcat(pool,
+                   "/",
+                   svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
+                   (const char *)NULL */
   *fs_path = &repos_dirent[strlen(repos_root_dirent)];
 
   if (**fs_path == '\0')
     *fs_path = "/";
 
-  /* Remove the path components in *fs_path from the original URL, to get
-     the URL to the repository root. */
-  urlbuf = svn_stringbuf_create(URL, pool);
-  svn_path_remove_components(urlbuf,
-                             svn_path_component_count(repos_dirent)
-                             - svn_path_component_count(repos_root_dirent));
-  *repos_url = urlbuf->data;
+  /* Create a url to the repository root. */
+  SVN_ERR(svn_uri_get_file_url_from_dirent(repos_root_url, repos_root_dirent,
+                                           pool));
 
   /* Configure hook script environment variables. */
   SVN_ERR(svn_repos_hooks_setenv(*repos, NULL, pool, pool));

Modified: subversion/branches/tree-read-api/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_ra_serf/ra_serf.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_ra_serf/ra_serf.h Wed Nov 14 13:17:08 2012
@@ -959,6 +959,7 @@ svn_ra_serf__xml_pop_state(svn_ra_serf__
 
 svn_error_t *
 svn_ra_serf__process_pending(svn_ra_serf__xml_parser_t *parser,
+                             svn_boolean_t *network_eof,
                              apr_pool_t *scratch_pool);
 
 

Modified: subversion/branches/tree-read-api/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_ra_serf/update.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_ra_serf/update.c Wed Nov 14 13:17:08 2012
@@ -85,8 +85,8 @@ typedef enum report_state_e {
    since network and parsing behavior (ie. it doesn't pause immediately)
    can make the measurements quite imprecise.
 
-   We measure outstanding requests as the sum of ACTIVE_FETCHES and
-   ACTIVE_PROPFINDS in the report_context_t structure.  */
+   We measure outstanding requests as the sum of NUM_ACTIVE_FETCHES and
+   NUM_ACTIVE_PROPFINDS in the report_context_t structure.  */
 #define REQUEST_COUNT_TO_PAUSE 1000
 #define REQUEST_COUNT_TO_RESUME 100
 
@@ -126,7 +126,7 @@ typedef struct report_dir_t
   /* Our base revision - SVN_INVALID_REVNUM if we're adding this dir. */
   svn_revnum_t base_rev;
 
-  /* controlling dir baton - this is only created in open_dir() */
+  /* controlling dir baton - this is only created in ensure_dir_opened() */
   void *dir_baton;
   apr_pool_t *dir_baton_pool;
 
@@ -342,20 +342,16 @@ struct report_context_t {
   report_dir_t *root_dir;
 
   /* number of pending GET requests */
-  unsigned int active_fetches;
+  unsigned int num_active_fetches;
 
   /* completed fetches (contains report_fetch_t) */
   svn_ra_serf__list_t *done_fetches;
 
   /* number of pending PROPFIND requests */
-  unsigned int active_propfinds;
+  unsigned int num_active_propfinds;
 
   /* completed PROPFIND requests (contains svn_ra_serf__handler_t) */
   svn_ra_serf__list_t *done_propfinds;
-  svn_ra_serf__list_t *done_dir_propfinds;
-
-  /* list of outstanding prop changes (contains report_dir_t) */
-  svn_ra_serf__list_t *active_dir_propfinds;
 
   /* list of files that only have prop changes (contains report_info_t) */
   svn_ra_serf__list_t *file_propchanges_only;
@@ -366,36 +362,44 @@ struct report_context_t {
   /* Are we done parsing the REPORT response? */
   svn_boolean_t done;
 
+  /* Did we receive all data from the network? */
+  svn_boolean_t report_received;
+
   /* Did we get a complete (non-truncated) report? */
   svn_boolean_t report_completed;
 
   /* The XML parser context for the REPORT response.  */
   svn_ra_serf__xml_parser_t *parser_ctx;
-
-  /* Did we close the root directory? */
-  svn_boolean_t closed_root;
 };
 
-
-/* Returns best connection for fetching files/properities. */
+/* Returns best connection for fetching files/properties. */
 static svn_ra_serf__connection_t *
 get_best_connection(report_context_t *ctx)
 {
   svn_ra_serf__connection_t * conn;
+  int first_conn;
 
-  /* Currently just cycle connection. In future we could store number of
-   * pending request on each connection for better connection usage. */
+  /* Skip the first connection if the REPORT response hasn't been completely
+     received yet. */
+  first_conn = ctx->report_received ? 0: 1;
+
+  if (ctx->sess->num_conns - first_conn == 1)
+    return ctx->sess->conns[first_conn];
+
+  /* Currently just cycle connections. In future we could store number of
+   * pending requests on each connection for better connection usage. */
   conn = ctx->sess->conns[ctx->sess->cur_conn];
 
   /* Switch our connection. */
   ctx->sess->cur_conn++;
 
   if (ctx->sess->cur_conn >= ctx->sess->num_conns)
-      ctx->sess->cur_conn = 1;
+      ctx->sess->cur_conn = first_conn;
 
   return conn;
 }
 
+
 /** Report state management helper **/
 
 static report_info_t *
@@ -573,7 +577,7 @@ remove_dir_props(void *baton,
 /** Helpers to open and close directories */
 
 static svn_error_t*
-open_dir(report_dir_t *dir)
+ensure_dir_opened(report_dir_t *dir)
 {
   report_context_t *ctx = dir->report_context;
 
@@ -602,7 +606,7 @@ open_dir(report_dir_t *dir)
     }
   else
     {
-      SVN_ERR(open_dir(dir->parent_dir));
+      SVN_ERR(ensure_dir_opened(dir->parent_dir));
 
       dir->dir_baton_pool = svn_pool_create(dir->parent_dir->dir_baton_pool);
 
@@ -698,7 +702,7 @@ static svn_error_t *close_all_dirs(repor
 
   SVN_ERR_ASSERT(! dir->ref_count);
 
-  SVN_ERR(open_dir(dir));
+  SVN_ERR(ensure_dir_opened(dir));
 
   return close_dir(dir);
 }
@@ -843,7 +847,7 @@ open_updated_file(report_info_t *info,
   const svn_delta_editor_t *update_editor = ctx->update_editor;
 
   /* Ensure our parent is open. */
-  SVN_ERR(open_dir(info->dir));
+  SVN_ERR(ensure_dir_opened(info->dir));
   info->editor_pool = svn_pool_create(info->dir->dir_baton_pool);
 
   /* Expand our full name now if we haven't done so yet. */
@@ -1202,44 +1206,6 @@ handle_stream(serf_request_t *request,
   /* not reached */
 }
 
-/* Close the directory represented by DIR -- and any suitable parents
-   thereof -- if we are able to do so.  This is the case whenever:
-
-     - there are no remaining open items within the directory, and
-     - the directory's XML close tag has been processed (so we know
-       there are no more children to worry about in the future), and
-     - either:
-         - we aren't fetching properties for this directory, or
-         - we've already finished fetching those properties.
-*/
-static svn_error_t *
-maybe_close_dir_chain(report_dir_t *dir)
-{
-  report_dir_t *cur_dir = dir;
-
-  while (cur_dir
-         && !cur_dir->ref_count
-         && cur_dir->tag_closed
-         && (!cur_dir->fetch_props || cur_dir->propfind_handler->done))
-    {
-      report_dir_t *parent = cur_dir->parent_dir;
-      report_context_t *report_context = cur_dir->report_context;
-
-      SVN_ERR(close_dir(cur_dir));
-      if (parent)
-        {
-          parent->ref_count--;
-        }
-      else
-        {
-          report_context->closed_root = TRUE;
-        }
-      cur_dir = parent;
-    }
-
-  return SVN_NO_ERROR;
-}
-
 /* Open the file associated with INFO for editing, pass along any
    propchanges we've recorded for it, and then close the file. */
 static svn_error_t *
@@ -1253,7 +1219,6 @@ handle_propchange_only(report_info_t *in
   svn_pool_destroy(info->pool);
 
   info->dir->ref_count--;
-  SVN_ERR(maybe_close_dir_chain(info->dir));
 
   return SVN_NO_ERROR;
 }
@@ -1278,7 +1243,6 @@ handle_local_content(report_info_t *info
   svn_pool_destroy(info->pool);
 
   info->dir->ref_count--;
-  SVN_ERR(maybe_close_dir_chain(info->dir));
 
   return SVN_NO_ERROR;
 }
@@ -1319,7 +1283,7 @@ fetch_file(report_context_t *ctx, report
       /* Create a serf request for the PROPFIND.  */
       svn_ra_serf__request_create(info->propfind_handler);
 
-      ctx->active_propfinds++;
+      ctx->num_active_propfinds++;
     }
 
   /* If we've been asked to fetch the file or it's an add, do so.
@@ -1430,7 +1394,7 @@ fetch_file(report_context_t *ctx, report
 
           svn_ra_serf__request_create(handler);
 
-          ctx->active_fetches++;
+          ctx->num_active_fetches++;
         }
     }
   else if (info->propfind_handler)
@@ -1453,7 +1417,8 @@ fetch_file(report_context_t *ctx, report
       SVN_ERR(handle_propchange_only(info, info->pool));
     }
 
-  if (ctx->active_fetches + ctx->active_propfinds > REQUEST_COUNT_TO_PAUSE)
+  if (ctx->num_active_fetches + ctx->num_active_propfinds
+      > REQUEST_COUNT_TO_PAUSE)
     ctx->parser_ctx->paused = TRUE;
 
   return SVN_NO_ERROR;
@@ -1724,7 +1689,7 @@ start_report(svn_ra_serf__xml_parser_t *
 
       info = parser->state->private;
 
-      SVN_ERR(open_dir(info->dir));
+      SVN_ERR(ensure_dir_opened(info->dir));
 
       tmppool = svn_pool_create(info->dir->dir_baton_pool);
 
@@ -1754,7 +1719,7 @@ start_report(svn_ra_serf__xml_parser_t *
 
       info = parser->state->private;
 
-      SVN_ERR(open_dir(info->dir));
+      SVN_ERR(ensure_dir_opened(info->dir));
 
       SVN_ERR(ctx->update_editor->absent_directory(
                                         svn_relpath_join(info->name, file_name,
@@ -1779,7 +1744,7 @@ start_report(svn_ra_serf__xml_parser_t *
 
       info = parser->state->private;
 
-      SVN_ERR(open_dir(info->dir));
+      SVN_ERR(ensure_dir_opened(info->dir));
 
       SVN_ERR(ctx->update_editor->absent_file(
                                         svn_relpath_join(info->name, file_name,
@@ -2004,29 +1969,22 @@ end_report(svn_ra_serf__xml_parser_t *pa
        */
       if (info->dir->fetch_props)
         {
-          svn_ra_serf__list_t *list_item;
-
           SVN_ERR(svn_ra_serf__deliver_props(&info->dir->propfind_handler,
                                              info->dir->props, ctx->sess,
                                              get_best_connection(ctx),
                                              info->dir->url,
                                              ctx->target_rev, "0",
                                              all_props,
-                                             &ctx->done_dir_propfinds,
+                                             &ctx->done_propfinds,
                                              info->dir->pool));
           SVN_ERR_ASSERT(info->dir->propfind_handler);
 
           /* Create a serf request for the PROPFIND.  */
           svn_ra_serf__request_create(info->dir->propfind_handler);
 
-          ctx->active_propfinds++;
-
-          list_item = apr_pcalloc(info->dir->pool, sizeof(*list_item));
-          list_item->data = info->dir;
-          list_item->next = ctx->active_dir_propfinds;
-          ctx->active_dir_propfinds = list_item;
+          ctx->num_active_propfinds++;
 
-          if (ctx->active_fetches + ctx->active_propfinds
+          if (ctx->num_active_fetches + ctx->num_active_propfinds
               > REQUEST_COUNT_TO_PAUSE)
             ctx->parser_ctx->paused = TRUE;
         }
@@ -2381,16 +2339,16 @@ link_path(void *report_baton,
 #define REQS_PER_CONN 8
 
 /** This function creates a new connection for this serf session, but only
- * if the number of ACTIVE_REQS > REQS_PER_CONN or if there currently is
+ * if the number of NUM_ACTIVE_REQS > REQS_PER_CONN or if there currently is
  * only one main connection open.
  */
 static svn_error_t *
-open_connection_if_needed(svn_ra_serf__session_t *sess, int active_reqs)
+open_connection_if_needed(svn_ra_serf__session_t *sess, int num_active_reqs)
 {
   /* For each REQS_PER_CONN outstanding requests open a new connection, with
    * a minimum of 1 extra connection. */
   if (sess->num_conns == 1 ||
-      ((active_reqs / REQS_PER_CONN) > sess->num_conns))
+      ((num_active_reqs / REQS_PER_CONN) > sess->num_conns))
     {
       int cur = sess->num_conns;
       apr_status_t status;
@@ -2444,6 +2402,7 @@ finish_report(void *report_baton,
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_parser_t *parser_ctx;
   const char *report_target;
+  svn_boolean_t closed_root;
   svn_stringbuf_t *buf = NULL;
   apr_pool_t *iterpool = svn_pool_create(pool);
   svn_error_t *err;
@@ -2504,13 +2463,16 @@ finish_report(void *report_baton,
   SVN_ERR(open_connection_if_needed(sess, 0));
 
   sess->cur_conn = 1;
+  closed_root = FALSE;
 
   /* Note that we may have no active GET or PROPFIND requests, yet the
      processing has not been completed. This could be from a delay on the
      network or because we've spooled the entire response into our "pending"
      content of the XML parser. The DONE flag will get set when all the
      XML content has been received *and* parsed.  */
-  while (!report->done || report->active_fetches || report->active_propfinds)
+  while (!report->done
+         || report->num_active_fetches
+         || report->num_active_propfinds)
     {
       apr_pool_t *iterpool_inner;
       svn_ra_serf__list_t *done_list;
@@ -2572,61 +2534,8 @@ finish_report(void *report_baton,
 
       /* Open extra connections if we have enough requests to send. */
       if (sess->num_conns < MAX_NR_OF_CONNS)
-        SVN_ERR(open_connection_if_needed(sess, report->active_fetches +
-                                          report->active_propfinds));
-
-      /* Prune directory propfinds that are finished. */
-      done_list = report->done_dir_propfinds;
-      while (done_list)
-        {
-          report->active_propfinds--;
-
-          if (report->active_dir_propfinds)
-            {
-              svn_ra_serf__list_t *cur, *prev;
-
-              prev = NULL;
-              cur = report->active_dir_propfinds;
-
-              while (cur)
-                {
-                  report_dir_t *item = cur->data;
-
-                  if (item->propfind_handler == done_list->data)
-                    {
-                      break;
-                    }
-
-                  prev = cur;
-                  cur = cur->next;
-                }
-
-              /* If we found a match, set the new props and remove this
-               * propchange from our list.
-               */
-              if (cur)
-                {
-                  report_dir_t *cur_dir = cur->data;
-
-                  if (!prev)
-                    {
-                      report->active_dir_propfinds = cur->next;
-                    }
-                  else
-                    {
-                      prev->next = cur->next;
-                    }
-
-                  /* See if this directory (and perhaps even parents of that)
-                     can be closed now. */
-                  SVN_ERR(open_dir(cur_dir));
-                  SVN_ERR(maybe_close_dir_chain(cur_dir));
-                }
-            }
-
-          done_list = done_list->next;
-        }
-      report->done_dir_propfinds = NULL;
+        SVN_ERR(open_connection_if_needed(sess, report->num_active_fetches +
+                                          report->num_active_propfinds));
 
       /* prune our propfind list if they are done. */
       done_list = report->done_propfinds;
@@ -2634,7 +2543,7 @@ finish_report(void *report_baton,
         {
           svn_pool_clear(iterpool_inner);
 
-          report->active_propfinds--;
+          report->num_active_propfinds--;
 
           /* If we have some files that we won't be fetching the content
            * for, ensure that we update the file with any altered props.
@@ -2707,20 +2616,42 @@ finish_report(void *report_baton,
           cur_dir->ref_count--;
 
           /* Decrement our active fetch count. */
-          report->active_fetches--;
+          report->num_active_fetches--;
 
           done_list = done_list->next;
 
-          /* See if the parent directory of this fetched item (and
-             perhaps even parents of that) can be closed now. */
-          SVN_ERR(maybe_close_dir_chain(cur_dir));
+          /* If we have a valid directory and
+           * we have no open items in this dir and
+           * we've closed the directory tag (no more children can be added)
+           * and either:
+           *   we know we won't be fetching props or
+           *   we've already completed the propfind
+           * then, we know it's time for us to close this directory.
+           */
+          while (cur_dir && !cur_dir->ref_count && cur_dir->tag_closed
+                 && (!cur_dir->fetch_props
+                     || cur_dir->propfind_handler->done))
+            {
+              report_dir_t *parent = cur_dir->parent_dir;
+
+              SVN_ERR(close_dir(cur_dir));
+              if (parent)
+                {
+                  parent->ref_count--;
+                }
+              else
+                {
+                  closed_root = TRUE;
+                }
+              cur_dir = parent;
+            }
         }
       report->done_fetches = NULL;
 
       /* If the parser is paused, and the number of active requests has
          dropped far enough, then resume parsing.  */
       if (parser_ctx->paused
-          && (report->active_fetches + report->active_propfinds
+          && (report->num_active_fetches + report->num_active_propfinds
               < REQUEST_COUNT_TO_RESUME))
         parser_ctx->paused = FALSE;
 
@@ -2728,7 +2659,9 @@ finish_report(void *report_baton,
          present (we can't know for sure because of the private structure),
          then go process the pending content.  */
       if (!parser_ctx->paused && parser_ctx->pending != NULL)
-        SVN_ERR(svn_ra_serf__process_pending(parser_ctx, iterpool_inner));
+        SVN_ERR(svn_ra_serf__process_pending(parser_ctx,
+                                             &report->report_received,
+                                             iterpool_inner));
 
       /* Debugging purposes only! */
       for (i = 0; i < sess->num_conns; i++)
@@ -2742,7 +2675,7 @@ finish_report(void *report_baton,
     {
       /* Ensure that we opened and closed our root dir and that we closed
        * all of our children. */
-      if (report->closed_root == FALSE && report->root_dir != NULL)
+      if (closed_root == FALSE && report->root_dir != NULL)
         {
           SVN_ERR(close_all_dirs(report->root_dir));
         }

Modified: subversion/branches/tree-read-api/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_ra_serf/util.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_ra_serf/util.c Wed Nov 14 13:17:08 2012
@@ -1404,6 +1404,7 @@ xml_parser_cleanup(void *baton)
 
 svn_error_t *
 svn_ra_serf__process_pending(svn_ra_serf__xml_parser_t *parser,
+                             svn_boolean_t *network_eof,
                              apr_pool_t *scratch_pool)
 {
   svn_boolean_t pending_empty = FALSE;
@@ -1411,7 +1412,10 @@ svn_ra_serf__process_pending(svn_ra_serf
 
   /* Fast path exit: already paused, nothing to do, or already done.  */
   if (parser->paused || parser->pending == NULL || *parser->done)
-    return SVN_NO_ERROR;
+    {
+      *network_eof = parser->pending ? parser->pending->network_eof : FALSE;
+      return SVN_NO_ERROR;
+    }
 
   /* Parsing the pending conten in the spillbuf will result in many disc i/o
      operations. This can be so slow that we don't run the network event
@@ -1434,7 +1438,7 @@ svn_ra_serf__process_pending(svn_ra_serf
 
           /* If the XML parsing callbacks paused us, then we're done for now.  */
           if (parser->paused)
-            return SVN_NO_ERROR;
+            break;
 
           cur_read += len;
         }
@@ -1462,6 +1466,8 @@ svn_ra_serf__process_pending(svn_ra_serf
       add_done_item(parser);
     }
 
+  *network_eof = parser->pending ? parser->pending->network_eof : FALSE;
+
   return SVN_NO_ERROR;
 }
 #undef PENDING_TO_PARSE

Modified: subversion/branches/tree-read-api/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_ra_svn/client.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_ra_svn/client.c Wed Nov 14 13:17:08 2012
@@ -325,6 +325,11 @@ static svn_ra_reporter3_t ra_svn_reporte
   ra_svn_abort_report
 };
 
+/* Set *REPORTER and *REPORT_BATON to a new reporter which will drive
+ * EDITOR/EDIT_BATON when it gets the finish_report() call.
+ *
+ * Allocate the new reporter in POOL.
+ */
 static svn_error_t *
 ra_svn_get_reporter(svn_ra_svn__session_baton_t *sess_baton,
                     apr_pool_t *pool,

Modified: subversion/branches/tree-read-api/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_subr/dirent_uri.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_subr/dirent_uri.c Wed Nov 14 13:17:08 2012
@@ -2402,7 +2402,17 @@ svn_uri_get_file_url_from_dirent(const c
       *url = apr_pstrcat(pool, "file:", dirent, NULL);
     }
   else
-    *url = apr_pstrcat(pool, "file:///", dirent, NULL);
+    {
+      char *uri = apr_pstrcat(pool, "file:///", dirent, NULL);
+      apr_size_t len = 8 /* strlen("file:///") */ + strlen(dirent);
+
+      /* "C:/" is a canonical dirent on Windows,
+         but "file:///C:/" is not a canonical uri */
+      if (uri[len-1] == '/')
+        uri[len-1] = '\0';
+
+      *url = uri;
+    }
 #endif
 
   return SVN_NO_ERROR;

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/adm_files.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/adm_files.c Wed Nov 14 13:17:08 2012
@@ -403,6 +403,9 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
                             apr_pool_t *scratch_pool)
 {
   int format;
+  const char *original_repos_relpath;
+  const char *original_root_url;
+  svn_boolean_t is_op_root;
   const char *repos_relpath = svn_uri_skip_ancestor(repos_root_url, url,
                                                     scratch_pool);
   svn_wc__db_status_t status;
@@ -428,9 +431,10 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
   SVN_ERR(svn_wc__db_read_info(&status, NULL,
                                &db_revision, &db_repos_relpath,
                                &db_repos_root_url, &db_repos_uuid,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               &original_repos_relpath, &original_root_url,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, &is_op_root, NULL, NULL,
                                NULL, NULL, NULL,
                                db, local_abspath, scratch_pool, scratch_pool));
 
@@ -469,26 +473,17 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
 
       /* The caller gives us a URL which should match the entry. However,
          some callers compensate for an old problem in entry->url and pass
-         the copyfrom_url instead. See ^/notes/api-errata/wc002.txt. As
+         the copyfrom_url instead. See ^/notes/api-errata/1.7/wc002.txt. As
          a result, we allow the passed URL to match copyfrom_url if it
          does not match the entry's primary URL.  */
-      /* ### comparing URLs, should they be canonicalized first? */
       if (strcmp(db_repos_uuid, repos_uuid)
           || strcmp(db_repos_root_url, repos_root_url)
           || !svn_relpath_skip_ancestor(db_repos_relpath, repos_relpath))
         {
-          const char *copyfrom_root_url, *copyfrom_repos_relpath;
-
-          SVN_ERR(svn_wc__internal_get_copyfrom_info(&copyfrom_root_url,
-                                                     &copyfrom_repos_relpath,
-                                                     NULL, NULL, NULL,
-                                                     db, local_abspath,
-                                                     scratch_pool,
-                                                     scratch_pool));
-
-          if (copyfrom_root_url == NULL
-              || strcmp(copyfrom_root_url, repos_root_url)
-              || strcmp(copyfrom_repos_relpath, repos_relpath))
+          if (!is_op_root /* copy_from was set on op-roots only */
+              || original_root_url == NULL
+              || strcmp(original_root_url, repos_root_url)
+              || strcmp(original_repos_relpath, repos_relpath))
             return
               svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
                                 _("URL '%s' (uuid: '%s') doesn't match existing "

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/info.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/info.c Wed Nov 14 13:17:08 2012
@@ -94,6 +94,7 @@ build_info_for_node(svn_wc__info2_t **in
   svn_boolean_t conflicted;
   svn_boolean_t op_root;
   svn_boolean_t have_base;
+  svn_boolean_t have_more_work;
   svn_wc_info_t *wc_info;
 
   tmpinfo = apr_pcalloc(result_pool, sizeof(*tmpinfo));
@@ -118,7 +119,7 @@ build_info_for_node(svn_wc__info2_t **in
                                &wc_info->recorded_time,
                                &wc_info->changelist,
                                &conflicted, &op_root, NULL, NULL,
-                               &have_base, NULL, NULL,
+                               &have_base, &have_more_work, NULL,
                                db, local_abspath,
                                result_pool, scratch_pool));
 
@@ -188,9 +189,30 @@ build_info_for_node(svn_wc__info2_t **in
 
       /* ### We should be able to avoid both these calls with the information
          from read_info() in most cases */
-      SVN_ERR(svn_wc__internal_node_get_schedule(&wc_info->schedule, NULL,
-                                                 db, local_abspath,
-                                                 scratch_pool));
+      if (! op_root)
+        wc_info->schedule = svn_wc_schedule_normal;
+      else if (! have_more_work && ! have_base)
+        wc_info->schedule = svn_wc_schedule_add;
+      else
+        {
+          svn_wc__db_status_t below_working;
+          svn_boolean_t have_work;
+
+          SVN_ERR(svn_wc__db_info_below_working(&have_base, &have_work,
+                                                &below_working,
+                                                db, local_abspath,
+                                                scratch_pool));
+
+          /* If the node is not present or deleted (read: not present
+             in working), then the node is not a replacement */
+          if (below_working != svn_wc__db_status_not_present
+              && below_working != svn_wc__db_status_deleted)
+            {
+              wc_info->schedule = svn_wc_schedule_replace;
+            }
+          else
+            wc_info->schedule = svn_wc_schedule_add;
+        }
       SVN_ERR(svn_wc__db_read_url(&tmpinfo->URL, db, local_abspath,
                                 result_pool, scratch_pool));
     }