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 [2/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...

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/node.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/node.c Wed Nov 14 13:17:08 2012
@@ -426,149 +426,6 @@ svn_wc__node_get_repos_relpath(const cha
                                                             scratch_pool));
 }
 
-svn_error_t *
-svn_wc__internal_get_copyfrom_info(const char **copyfrom_root_url,
-                                   const char **copyfrom_repos_relpath,
-                                   const char **copyfrom_url,
-                                   svn_revnum_t *copyfrom_rev,
-                                   svn_boolean_t *is_copy_target,
-                                   svn_wc__db_t *db,
-                                   const char *local_abspath,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool)
-{
-  const char *original_root_url;
-  const char *original_repos_relpath;
-  svn_revnum_t original_revision;
-  svn_wc__db_status_t status;
-
-  if (copyfrom_root_url)
-    *copyfrom_root_url = NULL;
-  if (copyfrom_repos_relpath)
-    *copyfrom_repos_relpath = NULL;
-  if (copyfrom_url)
-    *copyfrom_url = NULL;
-  if (copyfrom_rev)
-    *copyfrom_rev = SVN_INVALID_REVNUM;
-  if (is_copy_target)
-    *is_copy_target = FALSE;
-
-  SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
-                               &original_repos_relpath,
-                               &original_root_url, NULL,
-                               &original_revision,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL,
-                               db, local_abspath, result_pool, scratch_pool));
-  if (original_root_url && original_repos_relpath)
-    {
-      /* If this was the root of the copy then the URL is immediately
-         available... */
-      const char *my_copyfrom_url;
-
-      if (copyfrom_url || is_copy_target)
-        my_copyfrom_url = svn_path_url_add_component2(original_root_url,
-                                                      original_repos_relpath,
-                                                      result_pool);
-
-      if (copyfrom_root_url)
-        *copyfrom_root_url = original_root_url;
-      if (copyfrom_repos_relpath)
-        *copyfrom_repos_relpath = original_repos_relpath;
-      if (copyfrom_url)
-        *copyfrom_url = my_copyfrom_url;
-
-      if (copyfrom_rev)
-        *copyfrom_rev = original_revision;
-
-      if (is_copy_target)
-        {
-          /* ### At this point we'd just set is_copy_target to TRUE, *but* we
-           * currently want to model wc-1 behaviour.  Particularly, this
-           * affects mixed-revision copies (e.g. wc-wc copy):
-           * - Wc-1 saw only the root of a mixed-revision copy as the copy's
-           *   root.
-           * - Wc-ng returns an explicit original_root_url,
-           *   original_repos_relpath pair for each subtree with mismatching
-           *   revision.
-           * We need to compensate for that: Find out if the parent of
-           * this node is also copied and has a matching copy_from URL. If so,
-           * nevermind the revision, just like wc-1 did, and say this was not
-           * a separate copy target. */
-          const char *parent_abspath;
-          const char *base_name;
-          const char *parent_copyfrom_url;
-
-          svn_dirent_split(&parent_abspath, &base_name, local_abspath,
-                           scratch_pool);
-
-          /* This is a copied node, so we should never fall off the top of a
-           * working copy here. */
-          SVN_ERR(svn_wc__internal_get_copyfrom_info(NULL, NULL,
-                                                     &parent_copyfrom_url,
-                                                     NULL, NULL,
-                                                     db, parent_abspath,
-                                                     scratch_pool,
-                                                     scratch_pool));
-
-          /* So, count this as a separate copy target only if the URLs
-           * don't match up, or if the parent isn't copied at all. */
-          if (parent_copyfrom_url == NULL
-              || strcmp(my_copyfrom_url,
-                        svn_path_url_add_component2(parent_copyfrom_url,
-                                                    base_name,
-                                                    scratch_pool)) != 0)
-            *is_copy_target = TRUE;
-        }
-    }
-  else if ((status == svn_wc__db_status_added)
-           && (copyfrom_rev || copyfrom_url || copyfrom_root_url
-               || copyfrom_repos_relpath))
-    {
-      /* ...But if this is merely the descendant of an explicitly
-         copied/moved directory, we need to do a bit more work to
-         determine copyfrom_url and copyfrom_rev. */
-      const char *op_root_abspath;
-
-      SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath, NULL, NULL,
-                                       NULL, &original_repos_relpath,
-                                       &original_root_url, NULL,
-                                       &original_revision, NULL, NULL, db,
-                                       local_abspath, result_pool, scratch_pool));
-      if (status == svn_wc__db_status_copied ||
-          status == svn_wc__db_status_moved_here)
-        {
-          const char *src_parent_url;
-          const char *src_relpath;
-
-          src_parent_url = svn_path_url_add_component2(original_root_url,
-                                                       original_repos_relpath,
-                                                       scratch_pool);
-          src_relpath = svn_dirent_is_child(op_root_abspath, local_abspath,
-                                            scratch_pool);
-          if (src_relpath)
-            {
-              if (copyfrom_root_url)
-                *copyfrom_root_url = original_root_url;
-              if (copyfrom_repos_relpath)
-                *copyfrom_repos_relpath = svn_relpath_join(
-                                            original_repos_relpath,
-                                            src_relpath, result_pool);
-              if (copyfrom_url)
-                *copyfrom_url = svn_path_url_add_component2(src_parent_url,
-                                                            src_relpath,
-                                                            result_pool);
-              if (copyfrom_rev)
-                *copyfrom_rev = original_revision;
-            }
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
 /* A recursive node-walker, helper for svn_wc__internal_walk_children().
  *
  * Call WALK_CALLBACK with WALK_BATON on all children (recursively) of
@@ -939,134 +796,6 @@ svn_wc__node_get_pre_ng_status_data(svn_
   return SVN_NO_ERROR;
 }
 
-
-svn_error_t *
-svn_wc__internal_get_commit_base(svn_revnum_t *commit_base_revision,
-                                 const char **repos_relpath,
-                                 const char **repos_root_url,
-                                 const char **repos_uuid,
-                                 svn_wc__db_t *db,
-                                 const char *local_abspath,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool)
-{
-  svn_wc__db_status_t status;
-  svn_boolean_t have_base;
-  svn_boolean_t have_more_work;
-  svn_revnum_t revision;
-  svn_revnum_t orig_revision;
-  const char *orig_repos_relpath;
-  const char *orig_repos_root_url;
-  const char *orig_repos_uuid;
-
-  *commit_base_revision = SVN_INVALID_REVNUM;
-
-  SVN_ERR(svn_wc__db_read_info(&status, NULL,
-                               &revision, repos_relpath,
-                               repos_root_url, repos_uuid,
-                               NULL, NULL, NULL, NULL, NULL, NULL,
-                               &orig_repos_relpath, &orig_repos_root_url,
-                               &orig_repos_uuid, &orig_revision,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               &have_base, &have_more_work, NULL,
-                               db, local_abspath, scratch_pool, scratch_pool));
-
-  if (SVN_IS_VALID_REVNUM(revision))
-    {
-      /* We are looking directly at BASE */
-      if (commit_base_revision)
-        *commit_base_revision = revision;
-      return SVN_NO_ERROR;
-    }
-  else if (SVN_IS_VALID_REVNUM(orig_revision))
-    {
-      /* We are looking at a copied node */
-      if (commit_base_revision)
-        *commit_base_revision = orig_revision;
-      if (repos_relpath)
-        *repos_relpath = orig_repos_relpath;
-      if (repos_root_url)
-        *repos_root_url = orig_repos_root_url;
-      if (repos_uuid)
-        *repos_uuid = orig_repos_uuid;
-      return SVN_NO_ERROR;
-    }
-
-  if (status == svn_wc__db_status_added)
-    {
-      /* If the node was copied/moved-here, return the copy/move source
-         revision (not this node's base revision). */
-      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL,
-                                       repos_relpath, repos_root_url,
-                                       repos_uuid, commit_base_revision,
-                                       NULL, NULL, db, local_abspath,
-                                       scratch_pool, scratch_pool));
-
-
-      if (SVN_IS_VALID_REVNUM(*commit_base_revision))
-        return SVN_NO_ERROR;
-      /* Fall through to handle simple replacements */
-    }
-  else if (status == svn_wc__db_status_deleted)
-    {
-      const char *work_del_abspath;
-
-      SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-                                       &work_del_abspath, NULL,
-                                       db, local_abspath,
-                                       scratch_pool, scratch_pool));
-      if (work_del_abspath != NULL)
-        {
-          /* This is a deletion within a copied subtree. Get the copied-from
-           * revision. */
-          SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL,
-                                           repos_relpath, repos_root_url,
-                                           repos_uuid, commit_base_revision,
-                                           NULL, NULL, db,
-                                           svn_dirent_dirname(work_del_abspath,
-                                                              scratch_pool),
-                                           scratch_pool, scratch_pool));
-
-          SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*commit_base_revision));
-
-          return SVN_NO_ERROR;
-        }
-      /* else deletion of BASE node, fall through */
-    }
-
-  /* Catch replacement by local addition and deleted BASE nodes. */
-  if (have_base && !have_more_work)
-    {
-      SVN_ERR(svn_wc__db_base_get_info(&status, NULL, commit_base_revision,
-                                       repos_relpath, repos_root_url,
-                                       repos_uuid, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL,
-                                       db, local_abspath,
-                                       scratch_pool, scratch_pool));
-
-      if (status == svn_wc__db_status_not_present)
-        *commit_base_revision = SVN_INVALID_REVNUM; /* No replacement */
-    }
-
-  return SVN_NO_ERROR;
-}
-
-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)
-{
-  return svn_error_trace(svn_wc__internal_get_commit_base(
-                           revision, repos_relpath, repos_root_url, repos_uuid,
-                           wc_ctx->db, local_abspath,
-                           result_pool, scratch_pool));
-}
-
 svn_error_t *
 svn_wc__node_get_lock_info(const char **lock_token,
                            const char **lock_owner,

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/props.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/props.c Wed Nov 14 13:17:08 2012
@@ -2390,22 +2390,15 @@ svn_wc__internal_get_iprops(apr_array_he
 
       if (is_wc_root)
         {
-          const char *child_repos_relpath;
-
-          SVN_ERR(svn_wc__internal_get_repos_relpath(&child_repos_relpath,
-                                                     db, parent_abspath,
-                                                     iterpool, iterpool));
-
           /* If the WC root is also the root of the repository then by
-             definition there are no inheritable properties to be had. */
-          if (child_repos_relpath[0] != '\0')
-            {
-              /* Grab the cached inherited properties for the WC root. */
-              SVN_ERR(svn_wc__db_read_cached_iprops(&cached_iprops, db,
-                                                    parent_abspath,
-                                                    scratch_pool,
-                                                    iterpool));
-            }
+             definition there are no inheritable properties to be had,
+             but checking for that is just as expensive as fetching them
+             anyway. */
+
+          /* Grab the cached inherited properties for the WC root. */
+          SVN_ERR(svn_wc__db_read_cached_iprops(&cached_iprops, db,
+                                                parent_abspath,
+                                                scratch_pool, iterpool));
         }
 
       /* If PARENT_ABSPATH is a true parent of LOCAL_ABSPATH, then

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/status.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/status.c Wed Nov 14 13:17:08 2012
@@ -252,14 +252,15 @@ read_info(const struct svn_wc__db_info_t
 {
   struct svn_wc__db_info_t *mtb = apr_pcalloc(result_pool, sizeof(*mtb));
   const svn_checksum_t *checksum;
+  const char *original_repos_relpath;
 
   SVN_ERR(svn_wc__db_read_info(&mtb->status, &mtb->kind,
                                &mtb->revnum, &mtb->repos_relpath,
                                &mtb->repos_root_url, &mtb->repos_uuid,
                                &mtb->changed_rev, &mtb->changed_date,
                                &mtb->changed_author, &mtb->depth,
-                               &checksum, NULL, NULL, NULL, NULL,
-                               NULL, &mtb->lock, &mtb->recorded_size,
+                               &checksum, NULL, &original_repos_relpath, NULL,
+                               NULL, NULL, &mtb->lock, &mtb->recorded_size,
                                &mtb->recorded_mod_time, &mtb->changelist,
                                &mtb->conflicted, &mtb->op_root,
                                &mtb->had_props, &mtb->props_mod,
@@ -358,6 +359,7 @@ read_info(const struct svn_wc__db_info_t
     }
 
   mtb->has_checksum = (checksum != NULL);
+  mtb->copied = (original_repos_relpath != NULL);
 
 #ifdef HAVE_SYMLINK
   if (mtb->kind == svn_kind_file
@@ -676,27 +678,33 @@ assemble_status(svn_wc_status3_t **statu
             override a C text status.*/
       if (info->status == svn_wc__db_status_added)
         {
+          copied = info->copied;
           if (!info->op_root)
-            copied = TRUE; /* And keep status normal */
-          else if (info->kind == svn_kind_file
-                   && !info->have_base && !info->have_more_work)
+            { /* Keep status normal */ }
+          else if (!info->have_base && !info->have_more_work)
             {
               /* Simple addition or copy, no replacement */
               node_status = svn_wc_status_added;
-              /* If an added node has a pristine file, it was copied */
-              copied = info->has_checksum;
             }
           else
             {
-              svn_wc_schedule_t schedule;
-              SVN_ERR(svn_wc__internal_node_get_schedule(&schedule, &copied,
-                                                         db, local_abspath,
-                                                         scratch_pool));
+              svn_wc__db_status_t below_working;
+              svn_boolean_t have_base, have_work;
 
-              if (schedule == svn_wc_schedule_add)
+              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)
+                {
+                  node_status = svn_wc_status_replaced;
+                }
+              else
                 node_status = svn_wc_status_added;
-              else if (schedule == svn_wc_schedule_replace)
-                node_status = svn_wc_status_replaced;
             }
 
           /* Get moved-from info (only for potential op-roots of a move). */

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/update_editor.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/update_editor.c Wed Nov 14 13:17:08 2012
@@ -5242,9 +5242,9 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   const char *source_abspath = NULL;
   svn_skel_t *all_work_items = NULL;
   svn_skel_t *work_item;
-  const char *original_root_url;
+  const char *repos_root_url;
+  const char *repos_uuid;
   const char *original_repos_relpath;
-  const char *original_uuid;
   svn_revnum_t changed_rev;
   apr_time_t changed_date;
   const char *changed_author;
@@ -5281,10 +5281,10 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                                                           scratch_pool));
       }
 
-  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, &repos_root_url,
+                               &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, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                db, dir_abspath, scratch_pool, scratch_pool));
 
   switch (status)
@@ -5319,26 +5319,30 @@ svn_wc_add_repos_file4(svn_wc_context_t 
     {
       /* Find the repository_root via the parent directory, which
          is always versioned before this function is called */
-      SVN_ERR(svn_wc__internal_get_repos_info(&original_root_url,
-                                              &original_uuid,
-                                              wc_ctx->db,
-                                              dir_abspath,
-                                              pool, pool));
+
+      if (!repos_root_url)
+        {
+          /* The parent is an addition, scan upwards to find the right info */
+          SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
+                                           &repos_root_url, &repos_uuid,
+                                           NULL, NULL, NULL, NULL, NULL, NULL,
+                                           wc_ctx->db, dir_abspath,
+                                           scratch_pool, scratch_pool));
+        }
+      SVN_ERR_ASSERT(repos_root_url);
 
       original_repos_relpath =
-        svn_uri_skip_ancestor(original_root_url, copyfrom_url, pool);
+          svn_uri_skip_ancestor(repos_root_url, copyfrom_url, scratch_pool);
 
       if (!original_repos_relpath)
         return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                  _("Copyfrom-url '%s' has different repository"
                                    " root than '%s'"),
-                                 copyfrom_url, original_root_url);
+                                 copyfrom_url, repos_root_url);
     }
   else
     {
-      original_root_url = NULL;
       original_repos_relpath = NULL;
-      original_uuid = NULL;
       copyfrom_rev = SVN_INVALID_REVNUM;  /* Just to be sure.  */
     }
 
@@ -5475,8 +5479,9 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                                   changed_date,
                                   changed_author,
                                   original_repos_relpath,
-                                  original_root_url,
-                                  original_uuid,
+                                  original_repos_relpath ? repos_root_url
+                                                         : NULL,
+                                  original_repos_relpath ? repos_uuid : NULL,
                                   copyfrom_rev,
                                   new_text_base_sha1_checksum,
                                   TRUE,

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/wc.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/wc.h Wed Nov 14 13:17:08 2012
@@ -576,35 +576,6 @@ svn_wc__internal_node_get_schedule(svn_w
                                    const char *local_abspath,
                                    apr_pool_t *scratch_pool);
 
-/**
- * Set @a *copyfrom_url to the corresponding copy-from URL (allocated
- * from @a result_pool), and @a copyfrom_rev to the corresponding
- * copy-from revision, of @a local_abspath, using @a db.  Set @a
- * is_copy_target to TRUE iff @a local_abspath was the target of a
- * copy information (versus being a member of the subtree beneath such
- * a copy target).
- *
- * @a copyfrom_root_url and @a copyfrom_repos_relpath return the exact same
- * information as @a copyfrom_url, just still separated as root and relpath.
- *
- * If @a local_abspath is not copied, set @a *copyfrom_root_url,
- * @a *copyfrom_repos_relpath and @a copyfrom_url to NULL and
- * @a *copyfrom_rev to @c SVN_INVALID_REVNUM.
- *
- * Any out parameters may be NULL if the caller doesn't care about those
- * values.
- */
-svn_error_t *
-svn_wc__internal_get_copyfrom_info(const char **copyfrom_root_url,
-                                   const char **copyfrom_repos_relpath,
-                                   const char **copyfrom_url,
-                                   svn_revnum_t *copyfrom_rev,
-                                   svn_boolean_t *is_copy_target,
-                                   svn_wc__db_t *db,
-                                   const char *local_abspath,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool);
-
 /* Internal version of svn_wc__node_get_origin() */
 svn_error_t *
 svn_wc__internal_get_origin(svn_boolean_t *is_copy,
@@ -619,18 +590,6 @@ svn_wc__internal_get_origin(svn_boolean_
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
-/* Internal version of svn_wc__node_get_commit_base() */
-svn_error_t *
-svn_wc__internal_get_commit_base(svn_revnum_t *commit_base_revision,
-                                 const char **repos_relpath,
-                                 const char **repos_root_url,
-                                 const char **repos_uuid,
-                                 svn_wc__db_t *db,
-                                 const char *local_abspath,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
-
 /* Internal version of svn_wc__node_get_repos_info() */
 svn_error_t *
 svn_wc__internal_get_repos_info(const char **repos_root_url,

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.c Wed Nov 14 13:17:08 2012
@@ -8057,6 +8057,7 @@ read_children_info(void *baton,
           child->recorded_mod_time = svn_sqlite__column_int64(stmt, 13);
           child->recorded_size = get_recorded_size(stmt, 7);
           child->has_checksum = !svn_sqlite__column_is_null(stmt, 6);
+          child->copied = op_depth > 0 && !svn_sqlite__column_is_null(stmt, 2);
           child->had_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 14);
 #ifdef HAVE_SYMLINK
           if (child->had_props)

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db.h Wed Nov 14 13:17:08 2012
@@ -1918,6 +1918,7 @@ struct svn_wc__db_info_t {
   svn_boolean_t op_root;
 
   svn_boolean_t has_checksum;
+  svn_boolean_t copied;
   svn_boolean_t had_props;
   svn_boolean_t props_mod;
 

Modified: subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db_update_move.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_wc/wc_db_update_move.c Wed Nov 14 13:17:08 2012
@@ -431,6 +431,11 @@ static const svn_editor_cb_many_t editor
  * Driver code.
  */
 
+/* Set *OPERATION, *LOCAL_CHANGE, *INCOMING_CHANGE, *OLD_VERSION, *NEW_VERSION
+ * to reflect the tree conflict on the victim SRC_ABSPATH in DB.
+ *
+ * If SRC_ABSPATH is not a tree-conflict victim, return an error.
+ */
 static svn_error_t *
 get_tc_info(svn_wc_operation_t *operation,
             svn_wc_conflict_reason_t *local_change,
@@ -510,6 +515,8 @@ get_tc_info(svn_wc_operation_t *operatio
   return SVN_NO_ERROR;
 }
 
+/* ### Drive TC_EDITOR so as to ...
+ */
 static svn_error_t *
 update_moved_away_file(svn_editor_t *tc_editor,
                        const char *src_relpath,
@@ -545,6 +552,8 @@ update_moved_away_file(svn_editor_t *tc_
   return SVN_NO_ERROR;
 }
 
+/* ### Drive TC_EDITOR so as to ...
+ */
 static svn_error_t *
 update_moved_away_dir(svn_editor_t *tc_editor,
                       const char *src_relpath,
@@ -564,6 +573,8 @@ update_moved_away_dir(svn_editor_t *tc_e
   return SVN_NO_ERROR;
 }
 
+/* ### Drive TC_EDITOR so as to ...
+ */
 static svn_error_t *
 update_moved_away_subtree(svn_editor_t *tc_editor,
                           const char *src_relpath,
@@ -639,6 +650,8 @@ update_moved_away_subtree(svn_editor_t *
   return SVN_NO_ERROR;
 }
 
+/* ### Drive TC_EDITOR so as to ...
+ */
 static svn_error_t *
 drive_tree_conflict_editor(svn_editor_t *tc_editor,
                            const char *src_relpath,
@@ -708,7 +721,8 @@ struct update_moved_away_conflict_victim
   apr_pool_t *result_pool;
 };
 
-/* An implementation of svn_wc__db_txn_callback_t. */
+/* The body of svn_wc__db_update_moved_away_conflict_victim(), which see.
+ * An implementation of svn_wc__db_txn_callback_t. */
 static svn_error_t *
 update_moved_away_conflict_victim(void *baton,
                                   svn_wc__db_wcroot_t *wcroot,

Modified: subversion/branches/tree-read-api/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/mod_dav_svn/authz.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/tree-read-api/subversion/mod_dav_svn/authz.c Wed Nov 14 13:17:08 2012
@@ -97,6 +97,55 @@ dav_svn__allow_read(request_rec *r,
 }
 
 
+svn_boolean_t
+dav_svn__allow_list_repos(request_rec *r,
+                          const char *repos_name,
+                          apr_pool_t *pool)
+{
+  const char *uri;
+  request_rec *subreq;
+  svn_boolean_t allowed = FALSE;
+  authz_svn__subreq_bypass_func_t allow_read_bypass = NULL;
+
+  /* Easy out:  if the admin has explicitly set 'SVNPathAuthz Off',
+     then this whole callback does nothing. */
+  if (! dav_svn__get_pathauthz_flag(r))
+    {
+      return TRUE;
+    }
+
+  /* If bypass is specified and authz has exported the provider.
+     Otherwise, we fall through to the full version.  This should be
+     safer than allowing or disallowing all accesses if there is a
+     configuration error.
+     XXX: Is this the proper thing to do in this case? */
+  allow_read_bypass = dav_svn__get_pathauthz_bypass(r);
+  if (allow_read_bypass != NULL)
+    {
+      if (allow_read_bypass(r, "/", repos_name) == OK)
+        return TRUE;
+      else
+        return FALSE;
+    }
+
+  /* Build a Public Resource uri representing repository root. */
+  uri =  svn_urlpath__join(dav_svn__get_root_dir(r),
+                           svn_path_uri_encode(repos_name, pool), pool);
+
+  /* Check if GET would work against this uri. */
+  subreq = ap_sub_req_method_uri("GET", uri, r, r->output_filters);
+
+  if (subreq)
+    {
+      if (subreq->status == HTTP_OK)
+        allowed = TRUE;
+
+      ap_destroy_sub_req(subreq);
+    }
+
+  return allowed;
+}
+
 /* This function implements 'svn_repos_authz_func_t', specifically
    for read authorization.
 

Modified: subversion/branches/tree-read-api/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/mod_dav_svn/dav_svn.h?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/tree-read-api/subversion/mod_dav_svn/dav_svn.h Wed Nov 14 13:17:08 2012
@@ -746,6 +746,20 @@ dav_svn__allow_read_resource(const dav_r
                              apr_pool_t *pool);
 
 
+/* Return TRUE iff the current user (as determined by Apache's
+   authentication system) has permission to read repository REPOS_NAME.
+   This will invoke any authz modules loaded into Apache unless this
+   Subversion location has been configured to bypass those in favor of a
+   direct lookup in the Subversion authz subsystem. Use POOL for any
+   temporary allocation.
+   IMPORTANT: R must be request for DAV_SVN_RESTYPE_PARENTPATH_COLLECTION
+   resource.
+*/
+svn_boolean_t
+dav_svn__allow_list_repos(request_rec *r,
+                          const char *repos_name,
+                          apr_pool_t *pool);
+
 /* If authz is enabled in the specified BATON, return a read authorization
    function. Otherwise, return NULL. */
 svn_repos_authz_func_t

Modified: subversion/branches/tree-read-api/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/mod_dav_svn/repos.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/tree-read-api/subversion/mod_dav_svn/repos.c Wed Nov 14 13:17:08 2012
@@ -3469,9 +3469,9 @@ deliver(const dav_resource *resource, ap
             }
           else
             {
-              /* ### TODO:  We could test for readability of the root
-                     directory of each repository and hide those that
-                     the user can't see. */
+                if (! dav_svn__allow_list_repos(resource->info->r,
+                                                entry->name, entry_pool))
+                  continue;
             }
 
           /* append a trailing slash onto the name for directories. we NEED

Modified: subversion/branches/tree-read-api/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/svn/add-cmd.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/svn/add-cmd.c (original)
+++ subversion/branches/tree-read-api/subversion/svn/add-cmd.c Wed Nov 14 13:17:08 2012
@@ -75,10 +75,11 @@ svn_cl__add(apr_getopt_t *os,
       svn_pool_clear(iterpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
       SVN_ERR(svn_cl__try
-              (svn_client_add4(target,
+              (svn_client_add5(target,
                                opt_state->depth,
                                opt_state->force, opt_state->no_ignore,
-                               opt_state->parents, ctx, iterpool),
+                               opt_state->no_autoprops, opt_state->parents,
+                               ctx, iterpool),
                errors, opt_state->quiet,
                SVN_ERR_ENTRY_EXISTS,
                SVN_ERR_WC_PATH_NOT_FOUND,

Modified: subversion/branches/tree-read-api/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/svn/import-cmd.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/svn/import-cmd.c (original)
+++ subversion/branches/tree-read-api/subversion/svn/import-cmd.c Wed Nov 14 13:17:08 2012
@@ -118,6 +118,7 @@ svn_cl__import(apr_getopt_t *os,
                               url,
                               opt_state->depth,
                               opt_state->no_ignore,
+                              opt_state->no_autoprops,
                               opt_state->force,
                               opt_state->revprop_table,
                               NULL, NULL,  /* filter callback / baton */

Modified: subversion/branches/tree-read-api/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/svn/main.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/svn/main.c (original)
+++ subversion/branches/tree-read-api/subversion/svn/main.c Wed Nov 14 13:17:08 2012
@@ -217,7 +217,8 @@ const apr_getopt_option_t svn_cl__option
   {"stop-on-copy",  opt_stop_on_copy, 0,
                     N_("do not cross copies while traversing history")},
   {"no-ignore",     opt_no_ignore, 0,
-                    N_("disregard default and svn:ignore property ignores")},
+                    N_("disregard default and svn:ignore and\n"
+                       "svn:global-ignore property ignores")},
   {"no-auth-cache", opt_no_auth_cache, 0,
                     N_("do not cache authentication tokens")},
   {"trust-server-cert", opt_trust_server_cert, 0,

Modified: subversion/branches/tree-read-api/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/svnmucc/svnmucc.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/tree-read-api/subversion/svnmucc/svnmucc.c Wed Nov 14 13:17:08 2012
@@ -203,15 +203,14 @@ change_props(const svn_delta_editor_t *e
       for (hi = apr_hash_first(pool, child->prop_mods);
            hi; hi = apr_hash_next(hi))
         {
-          const void *key;
-          void *val;
+          const char *propname = svn__apr_hash_index_key(hi);
+          const svn_string_t *val = svn__apr_hash_index_val(hi);
 
           svn_pool_clear(iterpool);
-          apr_hash_this(hi, &key, NULL, &val);
           if (child->kind == svn_node_dir)
-            SVN_ERR(editor->change_dir_prop(baton, key, val, iterpool));
+            SVN_ERR(editor->change_dir_prop(baton, propname, val, iterpool));
           else
-            SVN_ERR(editor->change_file_prop(baton, key, val, iterpool));
+            SVN_ERR(editor->change_file_prop(baton, propname, val, iterpool));
         }
     }
 
@@ -234,14 +233,11 @@ drive(struct operation *operation,
   for (hi = apr_hash_first(pool, operation->children);
        hi; hi = apr_hash_next(hi))
     {
-      const void *key;
-      void *val;
-      struct operation *child;
+      const char *key = svn__apr_hash_index_key(hi);
+      struct operation *child = svn__apr_hash_index_val(hi);
       void *file_baton = NULL;
 
       svn_pool_clear(subpool);
-      apr_hash_this(hi, &key, NULL, &val);
-      child = val;
 
       /* Deletes and replacements are simple -- delete something. */
       if (child->operation == OP_DELETE || child->operation == OP_REPLACE)
@@ -284,22 +280,18 @@ drive(struct operation *operation,
           svn_txdelta_window_handler_t handler;
           void *handler_baton;
           svn_stream_t *contents;
-          apr_file_t *f = NULL;
 
           SVN_ERR(editor->apply_textdelta(file_baton, NULL, subpool,
                                           &handler, &handler_baton));
-          if (strcmp(child->src_file, "-"))
+          if (strcmp(child->src_file, "-") != 0)
             {
-              SVN_ERR(svn_io_file_open(&f, child->src_file, APR_READ,
-                                       APR_OS_DEFAULT, pool));
+              SVN_ERR(svn_stream_open_readonly(&contents, child->src_file,
+                                               pool, pool));
             }
           else
             {
-              apr_status_t apr_err = apr_file_open_stdin(&f, pool);
-              if (apr_err)
-                return svn_error_wrap_apr(apr_err, "Can't open stdin");
+              SVN_ERR(svn_stream_for_stdin(&contents, pool));
             }
-          contents = svn_stream_from_aprfile2(f, FALSE, pool);
           SVN_ERR(svn_txdelta_send_stream(contents, handler,
                                           handler_baton, NULL, pool));
         }
@@ -316,15 +308,12 @@ drive(struct operation *operation,
       /* If we opened, added, or replaced a directory, we need to
          recurse, apply outstanding propmods, and then close it. */
       if ((child->kind == svn_node_dir)
-          && (child->operation == OP_OPEN
-              || child->operation == OP_ADD
-              || child->operation == OP_REPLACE))
+          && child->operation != OP_DELETE)
         {
+          SVN_ERR(change_props(editor, child->baton, child, subpool));
+
           SVN_ERR(drive(child, head, editor, subpool));
-          if (child->kind == svn_node_dir)
-            {
-              SVN_ERR(change_props(editor, child->baton, child, subpool));
-            }
+
           SVN_ERR(editor->close_directory(child->baton, subpool));
         }
     }
@@ -766,12 +755,27 @@ execute(const apr_array_header_t *action
                               pool));
   SVN_ERR(svn_ra_open4(&session, NULL, anchor, NULL, ra_callbacks,
                        NULL, config, pool));
+  /* Open, then reparent to avoid AUTHZ errors when opening the reposroot */
   SVN_ERR(svn_ra_open4(&aux_session, NULL, anchor, NULL, ra_callbacks,
                        NULL, config, pool));
   SVN_ERR(svn_ra_get_repos_root2(aux_session, &repos_root, pool));
   SVN_ERR(svn_ra_reparent(aux_session, repos_root, pool));
-
   SVN_ERR(svn_ra_get_latest_revnum(session, &head, pool));
+
+  /* Reparent to ANCHOR's dir, if ANCHOR is not a directory. */
+  {
+    svn_node_kind_t kind;
+
+    SVN_ERR(svn_ra_check_path(aux_session,
+                              svn_uri_skip_ancestor(repos_root, anchor, pool),
+                              head, &kind, pool));
+    if (kind != svn_node_dir)
+      {
+        anchor = svn_uri_dirname(anchor, pool);
+        SVN_ERR(svn_ra_reparent(session, anchor, pool));
+      }
+  }
+
   if (SVN_IS_VALID_REVNUM(base_revision))
     {
       if (base_revision > head)
@@ -781,8 +785,13 @@ execute(const apr_array_header_t *action
       head = base_revision;
     }
 
+  memset(&root, 0, sizeof(root));
   root.children = apr_hash_make(pool);
   root.operation = OP_OPEN;
+  root.kind = svn_node_dir; /* For setting properties */
+  root.prop_mods = apr_hash_make(pool);
+  root.prop_dels = apr_array_make(pool, 1, sizeof(const char *));
+
   for (i = 0; i < actions->nelts; ++i)
     {
       struct action *action = APR_ARRAY_IDX(actions, i, struct action *);
@@ -845,11 +854,17 @@ execute(const apr_array_header_t *action
                                     commit_callback, NULL, NULL, FALSE, pool));
 
   SVN_ERR(editor->open_root(editor_baton, head, pool, &root.baton));
-  err = drive(&root, head, editor, pool);
+  err = change_props(editor, root.baton, &root, pool);
+  if (!err)
+    err = drive(&root, head, editor, pool);
+  if (!err)
+    err = editor->close_directory(root.baton, pool);
   if (!err)
     err = editor->close_edit(editor_baton, pool);
+
   if (err)
-    svn_error_clear(editor->abort_edit(editor_baton, pool));
+    err = svn_error_compose_create(err,
+                                   editor->abort_edit(editor_baton, pool));
 
   return err;
 }
@@ -861,11 +876,8 @@ read_propvalue_file(const svn_string_t *
 {
   svn_stringbuf_t *value;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
-  apr_file_t *f;
 
-  SVN_ERR(svn_io_file_open(&f, filename, APR_READ | APR_BINARY | APR_BUFFERED,
-                           APR_OS_DEFAULT, scratch_pool));
-  SVN_ERR(svn_stringbuf_from_aprfile(&value, f, scratch_pool));
+  SVN_ERR(svn_stringbuf_from_file2(&value, filename, scratch_pool));
   *value_p = svn_string_create_from_buf(value, pool);
   svn_pool_destroy(scratch_pool);
   return SVN_NO_ERROR;
@@ -1133,7 +1145,7 @@ main(int argc, const char **argv)
     {
       int j, num_url_args;
       const char *action_string = APR_ARRAY_IDX(action_args, i, const char *);
-      struct action *action = apr_palloc(pool, sizeof(*action));
+      struct action *action = apr_pcalloc(pool, sizeof(*action));
 
       /* First, parse the action. */
       if (! strcmp(action_string, "mv"))
@@ -1195,8 +1207,8 @@ main(int argc, const char **argv)
       if (action->action == ACTION_PUT)
         {
           action->path[1] =
-            svn_dirent_canonicalize(APR_ARRAY_IDX(action_args, i,
-                                                  const char *), pool);
+            svn_dirent_internal_style(APR_ARRAY_IDX(action_args, i,
+                                                    const char *), pool);
           if (++i == action_args->nelts)
             insufficient(pool);
         }
@@ -1226,8 +1238,8 @@ main(int argc, const char **argv)
           else
             {
               const char *propval_file =
-                svn_dirent_canonicalize(APR_ARRAY_IDX(action_args, i,
-                                                      const char *), pool);
+                svn_dirent_internal_style(APR_ARRAY_IDX(action_args, i,
+                                                        const char *), pool);
 
               if (++i == action_args->nelts)
                 insufficient(pool);
@@ -1291,9 +1303,12 @@ main(int argc, const char **argv)
           url = sanitize_url(url, pool);
           action->path[j] = url;
 
-          /* The cp source could be the anchor, but the other URLs should be
-             children of the anchor. */
-          if (! (action->action == ACTION_CP && j == 0))
+          /* The first URL arguments to 'cp', 'pd', 'ps' could be the anchor,
+             but the other URLs should be children of the anchor. */
+          if (! (action->action == ACTION_CP && j == 0)
+              && action->action != ACTION_PROPDEL
+              && action->action != ACTION_PROPSET
+              && action->action != ACTION_PROPSETF)
             url = svn_uri_dirname(url, pool);
           if (! anchor)
             anchor = url;

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/autoprop_tests.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/autoprop_tests.py Wed Nov 14 13:17:08 2012
@@ -345,10 +345,12 @@ enable-auto-props = %s
   svntest.main.create_config_dir(config_dir, config_contents)
 
 #----------------------------------------------------------------------
-def check_inheritable_autoprops(sbox, auto_props_enabled):
+def check_inheritable_autoprops(sbox, auto_props_cfg_enabled,
+                                inheritable_auto_props_enabled):
   """Check that the autoprops added or imported by inheritable_autoprops_test
-     are as expected based on whether traditional auto props are active or
-     not, as indicated by AUTO_PROPS_ENABLED."""
+     are as expected based on whether auto props are active or
+     not, as indicated by AUTO_PROPS_CFG_ENABLED and
+     INHERITABLE_AUTO_PROPS_ENABLED."""
 
   foo_path = sbox.ospath('foo.c')
   bar_path = sbox.ospath('B/bar.c')
@@ -358,7 +360,7 @@ def check_inheritable_autoprops(sbox, au
   snk_path = sbox.ospath('D/H/snk.py')
   sir_path = sbox.ospath('D/H/sir.c')
 
-  if auto_props_enabled:
+  if auto_props_cfg_enabled:
     check_proplist(foo_path, {'svn:eol-style':'CRLF',
                               'svn:keywords':'Author Date Id Rev URL'})
     check_proplist(bar_path, {'svn:eol-style':'CR',
@@ -371,7 +373,8 @@ def check_inheritable_autoprops(sbox, au
     check_proplist(snk_path, {'svn:mime-type':'text/x-python'})
     check_proplist(sir_path, {'svn:eol-style':'CRLF',
                               'svn:keywords':'Author Date Id Rev URL'})
-  else:
+  elif inheritable_auto_props_enabled: # Config auto-props disabled,
+                                          # but not svn:auto-props.
     check_proplist(foo_path, {'svn:eol-style':'CRLF'})
     check_proplist(bar_path, {'svn:eol-style':'CR',
                               'svn:keywords':'Date'})
@@ -381,6 +384,14 @@ def check_inheritable_autoprops(sbox, au
     check_proplist(rip_path, {'svn:executable':'*'})
     check_proplist(snk_path, {'svn:mime-type':'text/x-python'})
     check_proplist(sir_path, {'svn:eol-style':'CRLF'})
+  else: # No autoprops of any kind.
+    check_proplist(foo_path, {})
+    check_proplist(bar_path, {})
+    check_proplist(baf_path, {})
+    check_proplist(qux_path, {})
+    check_proplist(rip_path, {})
+    check_proplist(snk_path, {})
+    check_proplist(sir_path, {})
 
 #----------------------------------------------------------------------
 def inheritable_autoprops_test(sbox, cmd, cfgenable, clienable, subdir,
@@ -421,14 +432,16 @@ def inheritable_autoprops_test(sbox, cmd
   create_inherited_autoprops_config(config_dir, cfgenable)
 
   # add comandline flags
+  inheritable_auto_props_enabled = 1
   if clienable == 1:
     parameters = parameters + ['--auto-props']
-    enable_flag = 1
+    auto_props_cfg_enabled = 1
   elif clienable == -1:
     parameters = parameters + ['--no-auto-props']
-    enable_flag = 0
+    auto_props_cfg_enabled = 0
+    inheritable_auto_props_enabled = 0
   else:
-    enable_flag = cfgenable
+    auto_props_cfg_enabled = cfgenable
 
   # setup subdirectory if needed
   if len(subdir) > 0:
@@ -503,7 +516,8 @@ def inheritable_autoprops_test(sbox, cmd
       svntest.main.run_svn(None, 'checkout', repos_url + '/A', files_wc_dir,
                           '--config-dir', config_dir)
 
-    check_inheritable_autoprops(sbox, enable_flag)
+    check_inheritable_autoprops(sbox, auto_props_cfg_enabled,
+                                inheritable_auto_props_enabled)
 
   return config_dir
 
@@ -608,8 +622,40 @@ def svn_prop_inheritable_autoprops_add_v
   svntest.main.run_svn(None, 'add', '.', '--force', '--config-dir',
                        config_dir)
   os.chdir(saved_wd)
+  check_inheritable_autoprops(sbox, True, True)
+
+  # Revert additions and try with --no-auto-props
+  svntest.main.run_svn(None, 'revert', '-R', sbox.wc_dir)
+  os.chdir(sbox.wc_dir)
+  svntest.main.run_svn(None, 'add', '.', '--force', '--no-auto-props',
+                       '--config-dir', config_dir)
+  os.chdir(saved_wd)
+  check_inheritable_autoprops(sbox, False, False)
+
+  # Create a new config with auto-props disabled.
+  #
+  # Then revert the previous additions and add again, only the
+  # svn:auto-props should be applied.
+  tmp_dir = os.path.abspath(svntest.main.temp_dir)
+  config_dir = os.path.join(tmp_dir,
+                            'autoprops_config_disabled_' + sbox.name)
+  create_inherited_autoprops_config(config_dir, False)
 
-  check_inheritable_autoprops(sbox, True)
+  svntest.main.run_svn(None, 'revert', '-R', sbox.wc_dir)
+  os.chdir(sbox.wc_dir)
+  svntest.main.run_svn(None, 'add', '.', '--force',
+                       '--config-dir', config_dir)
+  os.chdir(saved_wd)
+  check_inheritable_autoprops(sbox, False, True)
+
+  # Revert  a final time and add again with the --auto-props switch.
+  # Both the config defined and svn:auto-props should be applied.
+  svntest.main.run_svn(None, 'revert', '-R', sbox.wc_dir)
+  os.chdir(sbox.wc_dir)
+  svntest.main.run_svn(None, 'add', '.', '--force', '--auto-props',
+                       '--config-dir', config_dir)
+  os.chdir(saved_wd)
+  check_inheritable_autoprops(sbox, True, True)
 
 #----------------------------------------------------------------------
 # Can't set svn:auto-props on files.

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/depth_tests.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/depth_tests.py Wed Nov 14 13:17:08 2012
@@ -106,7 +106,7 @@ def verify_depth(msg, depth, path="."):
                                                              [], "info", path)
     for line in out:
       if line.startswith("Depth:"):
-        raise svntest.failure(msg)
+        raise svntest.Failure(msg)
   else:
     expected_stdout = svntest.verify.ExpectedOutput("Depth: %s\n" % depth,
                                                     match_all=False)
@@ -2905,6 +2905,28 @@ def revert_depth_files(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'revert', '--depth=files', sbox.ospath('A'))
 
+@Issue(4257)
+def spurious_nodes_row(sbox):
+  "update produces no spurious rows"
+
+  sbox.build(read_only = True)
+  return
+
+  val1 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+  expected_output = svntest.wc.State(sbox.wc_dir, { })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  svntest.actions.run_and_verify_update(sbox.wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None, None, None, None, False,
+                                        "--depth=empty", sbox.wc_dir)
+  val2 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+  if (val1 != val2):
+    # ra_neon added a spurious not-present row that does not show up in status
+    raise svntest.Failure("count changed from '%s' to '%s'" % (val1, val2))
+
 
 #----------------------------------------------------------------------
 # list all tests here, starting with None:
@@ -2955,6 +2977,7 @@ test_list = [ None,
               update_below_depth_empty,
               commit_then_immediates_update,
               revert_depth_files,
+              spurious_nodes_row,
               ]
 
 if __name__ == "__main__":

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/import_tests.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/import_tests.py Wed Nov 14 13:17:08 2012
@@ -458,7 +458,7 @@ def import_inherited_ignores(sbox):
   file2_path = os.path.join('DIR3.foo', 'file2.txt')
   dir4_path  = os.path.join('DIR4.goo')
   file3_path = os.path.join('DIR4.goo', 'file3.txt')
-  file4_path = os.path.join('DIR4.goo', 'file4.txt')
+  file4_path = os.path.join('DIR4.goo', 'file4.noo')
   dir5_path  = os.path.join('DIR5.moo')
   file5_path = os.path.join('DIR5.moo', 'file5.txt')
   dir6_path  = os.path.join('DIR6')
@@ -468,7 +468,7 @@ def import_inherited_ignores(sbox):
   dir8_path  = os.path.join('DIR6', 'DIR7', 'DIR8.noo')
 
   # Import the tree to ^/A/B/E.
-  # We should never see any *.noo paths because those are blocked at the
+  # We should not see any *.noo paths because those are blocked at the
   # root of the repository by the svn:global-ignores property.  Likewise
   # *.doo paths are blocked by the svn:global-ignores on ^/A/B.  Nor
   # should we see and *.boo or *.goo paths, as those are blocked by the
@@ -517,8 +517,8 @@ def import_inherited_ignores(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
 
   # Import the tree to ^/A/B/F with the --no-ignore option.
-  # Now only the ignores present in the svn:global-ignores property
-  # should be considered.
+  # No ignores should be considered and the whole tree should
+  # be imported.
   svntest.actions.run_and_verify_svn(None, None, [], 'import',
                                      '--config-dir', config_dir,
                                      '--no-ignore', import_tree_dir,
@@ -527,16 +527,21 @@ def import_inherited_ignores(sbox):
   F_path = os.path.join(wc_dir, 'A', 'B', 'F')
   expected_output = svntest.verify.UnorderedOutput(
     ["Updating '" + wc_dir + "':\n",
+     'A    ' + os.path.join(F_path, dir1_path)  + '\n',
+     'A    ' + os.path.join(F_path, dir2_path)  + '\n',
+     'A    ' + os.path.join(F_path, file1_path) + '\n',
      'A    ' + os.path.join(F_path, dir3_path)  + '\n',
      'A    ' + os.path.join(F_path, file2_path) + '\n',
      'A    ' + os.path.join(F_path, dir4_path)  + '\n',
      'A    ' + os.path.join(F_path, file3_path) + '\n',
+     'A    ' + os.path.join(F_path, file4_path) + '\n',
      'A    ' + os.path.join(F_path, dir5_path)  + '\n',
      'A    ' + os.path.join(F_path, file5_path) + '\n',
      'A    ' + os.path.join(F_path, dir6_path)  + '\n',
      'A    ' + os.path.join(F_path, file6_path) + '\n',
      'A    ' + os.path.join(F_path, dir7_path)  + '\n',
      'A    ' + os.path.join(F_path, file7_path) + '\n',
+     'A    ' + os.path.join(F_path, dir8_path)  + '\n',
      'Updated to revision 5.\n'])
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
 

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/special_tests.py Wed Nov 14 13:17:08 2012
@@ -1123,22 +1123,29 @@ def incoming_symlink_changes(sbox):
   sbox.simple_add_symlink('iota', 's-type')
   sbox.simple_append('s-reverse', 'link iota')
   sbox.simple_add('s-reverse')
-  # Sleep here so that the subsequent s-in-place change is detected.
-  svntest.actions.do_sleep_for_timestamps()
   sbox.simple_commit() # r2
-  svntest.actions.no_sleep_for_timestamps()
 
   # Replace s-replace
   sbox.simple_rm('s-replace')
-  sbox.simple_add_symlink('A/mu', 's-replace')
+  # Note that we don't use 'A/mu' as the length of that matches 'iota', which
+  # would make us depend on timestamp changes for detecting differences.
+  sbox.simple_add_symlink('A/D/G/pi', 's-replace')
 
   # Change target of s-in-place
   if svntest.main.is_posix_os():
     os.remove(sbox.ospath('s-in-place'))
-    os.symlink('A/mu', sbox.ospath('s-in-place'))
+    os.symlink('A/D/G/pi', sbox.ospath('s-in-place'))
   else:
-    sbox.simple_append('s-in-place', 'link A/mu', truncate = True)
-  sbox.simple_commit() # r3
+    sbox.simple_append('s-in-place', 'link A/D/G/pi', truncate = True)
+
+  # r3
+  expected_output = svntest.wc.State(wc_dir, {
+    's-replace'         : Item(verb='Replacing'),
+    's-in-place'        : Item(verb='Sending'),
+  })
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output, None, None,
+                                        wc_dir)
 
   # r4
   svntest.main.run_svnmucc('propdel', 'svn:special',

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svnmucc_tests.py Wed Nov 14 13:17:08 2012
@@ -312,11 +312,38 @@ def basic_svnmucc(sbox):
                 'cp', '17', 'a', 'b')
 
 
+def propset_root_internal(sbox, target):
+  ## propset on ^/
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                                         'propset', 'foo', 'bar',
+                                         target)
+  svntest.actions.run_and_verify_svn(None, 'bar', [],
+                                     'propget', '--strict', 'foo',
+                                     target)
+
+  ## propdel on ^/
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                                         'propdel', 'foo',
+                                         target)
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'propget', '--strict', 'foo',
+                                     target)
+
+@Issues(3663)
+def propset_root(sbox):
+  "propset/propdel on repos root"
+
+  sbox.build(create_wc=False)
+  propset_root_internal(sbox, sbox.repo_url)
+  propset_root_internal(sbox, sbox.repo_url + '/iota')
+
+
 ######################################################################
 
 test_list = [ None,
               reject_bogus_mergeinfo,
               basic_svnmucc,
+              propset_root,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/main.py Wed Nov 14 13:17:08 2012
@@ -337,9 +337,10 @@ def get_fsfs_format_file_path(repo_dir):
   return os.path.join(repo_dir, "db", "format")
 
 def filter_dbg(lines):
-  for line in lines:
-    if not line.startswith('DBG:'):
-      yield line
+  excluded = filter(lambda line: line.startswith('DBG:'), lines)
+  included = filter(lambda line: not line.startswith('DBG:'), lines)
+  sys.stdout.write(''.join(excluded))
+  return included
 
 # Run any binary, logging the command line and return code
 def run_command(command, error_expected, binary_mode=0, *varargs):
@@ -537,7 +538,7 @@ def run_command_stdin(command, error_exp
     raise Failure
 
   return exit_code, \
-         [line for line in stdout_lines if not line.startswith("DBG:")], \
+         filter_dbg(stdout_lines), \
          stderr_lines
 
 def create_config_dir(cfgdir, config_contents=None, server_contents=None,
@@ -713,7 +714,7 @@ def run_entriesdump(path):
   class Entry(object):
     pass
   entries = { }
-  exec(''.join([line for line in stdout_lines if not line.startswith("DBG:")]))
+  exec(''.join(filter_dbg(stdout_lines)))
   return entries
 
 def run_entriesdump_subdirs(path):
@@ -722,7 +723,7 @@ def run_entriesdump_subdirs(path):
   # to stdout in verbose mode.
   exit_code, stdout_lines, stderr_lines = spawn_process(entriesdump_binary,
                                                         0, 0, None, '--subdirs', path)
-  return [line.strip() for line in stdout_lines if not line.startswith("DBG:")]
+  return map(lambda line: line.strip(), filter_dbg(stdout_lines))
 
 def run_atomic_ra_revprop_change(url, revision, propname, skel, want_error):
   """Run the atomic-ra-revprop-change helper, returning its exit code, stdout,

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/verify.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/verify.py Wed Nov 14 13:17:08 2012
@@ -362,7 +362,7 @@ def compare_and_display_lines(message, l
 
   if isinstance(actual, str):
     actual = [actual]
-  actual = [line for line in actual if not line.startswith('DBG:')]
+  actual = svntest.main.filter_dbg(actual)
 
   if not expected.matches(actual, except_re):
     expected.display_differences(message, label, actual)

Modified: subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/branches/tree-read-api/subversion/tests/cmdline/svntest/wc.py Wed Nov 14 13:17:08 2012
@@ -886,6 +886,14 @@ def text_base_path(file_path):
 
   raise svntest.Failure("No pristine text for " + relpath)
 
+def sqlite_stmt(wc_root_path, stmt):
+  """Execute STMT on the SQLite wc.db in WC_ROOT_PATH and return the
+     results."""
+
+  db = open_wc_db(wc_root_path)[0]
+  c = db.cursor()
+  c.execute(stmt)
+  return c.fetchall()
 
 # ------------
 ### probably toss these at some point. or major rework. or something.

Modified: subversion/branches/tree-read-api/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/libsvn_client/client-test.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/tree-read-api/subversion/tests/libsvn_client/client-test.c Wed Nov 14 13:17:08 2012
@@ -636,8 +636,8 @@ test_16k_add(const svn_test_opts_t *opts
                                        svn_io_file_del_none,
                                        iterpool, iterpool));
 
-      SVN_ERR(svn_client_add4(path, svn_depth_unknown, FALSE, FALSE, FALSE,
-                              ctx, iterpool));
+      SVN_ERR(svn_client_add5(path, svn_depth_unknown, FALSE, FALSE, FALSE,
+                              FALSE, ctx, iterpool));
     }
 
   targets = apr_array_make(pool, 1, sizeof(const char *));

Modified: subversion/branches/tree-read-api/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1409189&r1=1409188&r2=1409189&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/tree-read-api/subversion/tests/libsvn_subr/dirent_uri-test.c Wed Nov 14 13:17:08 2012
@@ -886,14 +886,17 @@ static const testcase_canonicalize_t uri
     { "svn://SERVER:443/",     "svn://server:443" },
     { "file:///C%7C/temp/REPOS", "file:///C%7C/temp/REPOS" },
     { "file:///C|/temp/REPOS", "file:///C%7C/temp/REPOS" },
+    { "file:///C:/",           "file:///C:" },
 #ifdef SVN_USE_DOS_PATHS
     { "file:///c:/temp/repos", "file:///C:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///C:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
+    { "file:///c:/",           "file:///C:" },
 #else /* !SVN_USE_DOS_PATHS */
     { "file:///c:/temp/repos", "file:///c:/temp/repos" },
     { "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
+    { "file:///c:/",           "file:///c:" },
 #endif /* SVN_USE_DOS_PATHS */
   /* svn_uri_is_canonical() was a private function in the 1.6 API, and
      has since taken a MAJOR change of direction, namely that only
@@ -2369,7 +2372,7 @@ test_file_url_from_dirent(apr_pool_t *po
   } tests[] = {
 #ifdef SVN_USE_DOS_PATHS
     { "C:/file",                   "file:///C:/file" },
-    { "C:/",                       "file:///C:/" },
+    { "C:/",                       "file:///C:" },
     { "C:/File#$",                 "file:///C:/File%23$" },
     /* We can't check these as svn_dirent_get_absolute() won't work
        on shares that don't exist */
@@ -2396,6 +2399,8 @@ test_file_url_from_dirent(apr_pool_t *po
                                  "svn_uri_get_file_url_from_dirent(\"%s\") "
                                  "returned \"%s\" expected \"%s\"",
                                  tests[i].dirent, result, tests[i].result);
+
+      SVN_TEST_ASSERT(svn_uri_is_canonical(result, pool));
     }
 
   return SVN_NO_ERROR;