You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/05/16 03:07:12 UTC

svn commit: r1103589 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db_pristine.c wc_db_private.h wc_db_wcroot.c

Author: stefan2
Date: Mon May 16 01:07:11 2011
New Revision: 1103589

URL: http://svn.apache.org/viewvc?rev=1103589&view=rev
Log:
Eliminate unnecessary stat calls during checkout, part 2 of 2.

If provided as parameter, svn_wc__db_wcroot_parse_local_abspath
does not need to use a stat call to detect the kind of node 
behind the given abspath. For many *frequent* callers that 
is known.

* subversion/libsvn_wc/wc_db_private.h
  (svn_wc__db_wcroot_parse_local_abspath): add kind parameter
* subversion/libsvn_wc/wc_db_wcroot.c
  (svn_wc__db_wcroot_parse_local_abspath): stat for kind of
   if it is not already known

* subversion/libsvn_wc/wc_db_pristine.c
  (svn_wc__db_pristine_get_path, svn_wc__db_pristine_read,
   svn_wc__db_pristine_get_tempdir, svn_wc__db_pristine_install,
   svn_wc__db_pristine_get_md5, svn_wc__db_pristine_get_sha1,
   svn_wc__db_pristine_remove, svn_wc__db_pristine_cleanup,
   svn_wc__db_pristine_check): don't use the optimization

* subversion/libsvn_wc/wc_db.c
  (kind_by_filesize): new utility function

  (get_statement_for_path, svn_wc__db_to_relpath, 
   svn_wc__db_from_relpath, svn_wc__db_get_wcroot,
   svn_wc__db_base_add_symlink, add_absent_excluded_not_present_node,
   svn_wc__db_base_get_info, svn_wc__db_base_get_children,
   svn_wc__db_base_clear_dav_cache_recursive, svn_wc__db_external_add_file,
   svn_wc__db_external_add_symlink, svn_wc__db_external_remove,
   svn_wc__db_external_read, svn_wc__db_external_read_pristine_props,
   svn_wc__db_external_read_props, svn_wc__db_op_copy,
   svn_wc__db_op_copy_shadowed_layer, svn_wc__db_op_copy_file,
   svn_wc__db_op_copy_symlink, svn_wc__db_op_add_symlink,
   svn_wc__db_op_set_props, svn_wc__db_op_set_changelist,
   svn_wc__db_op_mark_resolved, svn_wc__db_op_set_tree_conflict,
   svn_wc__db_op_revert, svn_wc__db_revert_list_read,
   svn_wc__db_revert_list_notify, svn_wc__db_op_read_all_tree_conflicts,
   svn_wc__db_op_read_tree_conflict, svn_wc__db_op_remove_node,
   svn_wc__db_temp_op_remove_working, svn_wc__db_op_delete,
   svn_wc__db_read_info, svn_wc__db_read_pristine_info,
   svn_wc__db_read_node_install_info, svn_wc__db_read_url,
   svn_wc__db_read_props, svn_wc__db_read_props_streamily,
   svn_wc__db_read_pristine_props, svn_wc__db_read_children_of_working_node,
   svn_wc__db_node_check_replace, svn_wc__db_read_children,
   svn_wc__db_global_commit, svn_wc__db_global_update,
   svn_wc__db_op_bump_revisions_post_update, svn_wc__db_lock_add,
   svn_wc__db_lock_remove, svn_wc__db_scan_base_repos,
   svn_wc__db_scan_addition, svn_wc__db_scan_deletion,
   svn_wc__db_wq_add, svn_wc__db_wq_fetch, svn_wc__db_wq_completed,
   svn_wc__db_read_conflict_victims, svn_wc__db_read_conflicts,
   svn_wc__db_read_kind, svn_wc__db_node_hidden, svn_wc__db_is_wcroot,
   svn_wc__db_temp_wcroot_tempdir, svn_wc__db_wclock_obtain,
   svn_wc__db_wclock_release, svn_wc__db_wclock_owns_lock,
   svn_wc__db_temp_op_start_directory_update, svn_wc__db_temp_op_make_copy,
   svn_wc__db_temp_op_set_text_conflict_marker_files, 
   svn_wc__db_temp_op_set_property_conflict_marker_file,
   svn_wc__db_temp_op_set_new_dir_to_incomplete,
   svn_wc__db_info_below_working, svn_wc__db_get_not_present_descendants,
   svn_wc__db_min_max_revisions, svn_wc__db_is_sparse_checkout,
   svn_wc__db_has_switched_subtrees, svn_wc__db_get_absent_subtrees,
   svn_wc__db_has_local_mods, svn_wc__db_revision_status,
   svn_wc__db_base_get_lock_tokens_recursive, svn_wc__db_verify):
   don't use the optimization

  (svn_wc__db_base_add_directory, svn_wc__db_base_get_children_info,
   svn_wc__db_external_add_dir, svn_wc__db_op_copy_dir,
   svn_wc__db_op_add_directory, svn_wc__db_op_set_base_depth,
   svn_wc__db_read_children_info, svn_wc__db_read_children_walker_info,
   svn_wc__db_global_relocate, svn_wc__db_temp_get_format,
   svn_wc__db_temp_get_access, svn_wc__db_temp_set_access,
   svn_wc__db_temp_close_access, svn_wc__db_temp_clear_access,
   svn_wc__db_temp_borrow_sdb, svn_wc__db_temp_op_end_directory_update):
   path parameters are known to be directories

  (svn_wc__db_base_add_file, svn_wc__db_op_add_file):
   path parameters are known to be files

  (svn_wc__db_external_record_fileinfo, svn_wc__db_global_record_fileinfo):
   path parameters are files, if the file length is > 0.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
    subversion/trunk/subversion/libsvn_wc/wc_db_private.h
    subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1103589&r1=1103588&r2=1103589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 16 01:07:11 2011
@@ -600,7 +600,8 @@ get_statement_for_path(svn_sqlite__stmt_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(stmt, wcroot->sdb, stmt_idx));
@@ -1416,7 +1417,8 @@ svn_wc__db_to_relpath(const char **local
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &relpath, db,
-                              wri_abspath, result_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              result_pool, scratch_pool));
 
   /* This function is indirectly called from the upgrade code, so we
      can't verify the wcroot here. Just check that it is not NULL */
@@ -1451,7 +1453,8 @@ svn_wc__db_from_relpath(const char **loc
 #endif
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &unused_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   *local_abspath = svn_dirent_join(wcroot->abspath,
@@ -1472,7 +1475,8 @@ svn_wc__db_get_wcroot(const char **wcroo
   const char *unused_relpath;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &unused_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
 
   /* Can't use VERIFY_USABLE_WCROOT, as this should be usable to detect
      where call upgrade */
@@ -1525,7 +1529,8 @@ svn_wc__db_base_add_directory(svn_wc__db
 #endif
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_ibb(&ibb);
@@ -1605,7 +1610,8 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
   SVN_ERR_ASSERT(checksum != NULL);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_file, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_ibb(&ibb);
@@ -1684,7 +1690,8 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
   SVN_ERR_ASSERT(target != NULL);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_ibb(&ibb);
@@ -1762,7 +1769,8 @@ add_absent_excluded_not_present_node(svn
   svn_dirent_split(&dir_abspath, &name, local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              dir_abspath, scratch_pool, scratch_pool));
+                              dir_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
@@ -1887,7 +1895,8 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, db_base_remove, NULL,
@@ -2065,7 +2074,8 @@ svn_wc__db_base_get_info(svn_wc__db_stat
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(base_get_info(status, kind, revision, repos_relpath, &repos_id,
@@ -2095,7 +2105,8 @@ svn_wc__db_base_get_children_info(apr_ha
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              dir_abspath, scratch_pool, scratch_pool));
+                              dir_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   *nodes = apr_hash_make(result_pool);
@@ -2202,7 +2213,7 @@ svn_wc__db_base_get_children(const apr_a
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -2274,7 +2285,8 @@ svn_wc__db_base_clear_dav_cache_recursiv
   svn_sqlite__stmt_t *stmt;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                             db, local_abspath,
+                                             db, local_abspath, 
+                                             svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -2766,7 +2778,8 @@ svn_wc__db_external_add_file(svn_wc__db_
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath,
@@ -2850,7 +2863,8 @@ svn_wc__db_external_add_symlink(svn_wc__
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath,
@@ -2923,7 +2937,8 @@ svn_wc__db_external_add_dir(svn_wc__db_t
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath,
@@ -2988,7 +3003,8 @@ svn_wc__db_external_remove(svn_wc__db_t 
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
@@ -3008,6 +3024,15 @@ svn_wc__db_external_remove(svn_wc__db_t 
 #endif
 }
 
+/* Only files may have a file SIZE > 0. 
+ * Return svn_node_unknown for everything else */
+static svn_node_kind_t
+kind_by_filesize(svn_filesize_t size)
+{
+  /* > 0 implies != SVN_INVALID_FILESIZE */
+  return size > 0 ? svn_node_file : svn_node_unknown; 
+}
+
 svn_error_t *
 svn_wc__db_external_record_fileinfo(svn_wc__db_t *db,
                                     const char *local_abspath,
@@ -3024,7 +3049,8 @@ svn_wc__db_external_record_fileinfo(svn_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, kind_by_filesize(recorded_size), 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -3080,7 +3106,8 @@ svn_wc__db_external_read(svn_wc__db_stat
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
@@ -3296,7 +3323,8 @@ svn_wc__db_external_read_pristine_props(
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
@@ -3363,7 +3391,8 @@ svn_wc__db_external_read_props(apr_hash_
     wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR_ASSERT(svn_dirent_is_ancestor(wcroot->abspath, local_abspath));
@@ -3886,12 +3915,14 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.src_wcroot,
                                                 &ocb.src_relpath, db,
                                                 src_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(ocb.src_wcroot);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.dst_wcroot,
                                                 &ocb.dst_relpath,
                                                 db, dst_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
 
@@ -4196,12 +4227,14 @@ svn_wc__db_op_copy_shadowed_layer(svn_wc
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.src_wcroot,
                                                 &ocb.src_relpath, db,
                                                 src_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(ocb.src_wcroot);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.dst_wcroot,
                                                 &ocb.dst_relpath,
                                                 db, dst_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
 
@@ -4404,7 +4437,8 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
   SVN_ERR_ASSERT(conflict == NULL);  /* ### can't handle yet  */
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4478,7 +4512,8 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
   SVN_ERR_ASSERT(conflict == NULL);  /* ### can't handle yet  */
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4547,7 +4582,8 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t 
   SVN_ERR_ASSERT(conflict == NULL);  /* ### can't handle yet  */
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4601,7 +4637,8 @@ svn_wc__db_op_add_directory(svn_wc__db_t
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4633,7 +4670,8 @@ svn_wc__db_op_add_file(svn_wc__db_t *db,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_file,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4667,7 +4705,8 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
   SVN_ERR_ASSERT(target != NULL);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   blank_iwb(&iwb);
@@ -4730,7 +4769,8 @@ svn_wc__db_global_record_fileinfo(svn_wc
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, kind_by_filesize(translated_size), 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   rb.translated_size = translated_size;
@@ -4855,7 +4895,8 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
+                              db, local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   spb.props = props;
@@ -5173,6 +5214,7 @@ svn_wc__db_op_set_changelist(svn_wc__db_
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -5225,7 +5267,8 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
   SVN_ERR_ASSERT(!resolved_tree);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* ### these two statements are not transacted together. is this a
@@ -5335,7 +5378,8 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
+                              db, local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, set_tc_txn,
@@ -5572,7 +5616,8 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
     }
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
+                              db, local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, with_triggers, &wtb,
@@ -5678,7 +5723,8 @@ svn_wc__db_revert_list_read(svn_boolean_
                                      result_pool};
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, scratch_pool));
+                              db, local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, revert_list_read, &b,
@@ -5700,7 +5746,8 @@ svn_wc__db_revert_list_notify(svn_wc_not
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                              db, local_abspath, scratch_pool, iterpool));
+                              db, local_abspath, svn_node_unknown,
+                              scratch_pool, iterpool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   like_arg = construct_like_arg(local_relpath, scratch_pool);
@@ -5812,7 +5859,8 @@ svn_wc__db_op_read_all_tree_conflicts(ap
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(read_all_tree_conflicts(tree_conflicts, wcroot, local_relpath,
@@ -5882,7 +5930,8 @@ svn_wc__db_op_read_tree_conflict(
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
 
   SVN_ERR(read_tree_conflict(tree_conflict, wcroot, local_relpath,
                              result_pool, scratch_pool));
@@ -5974,7 +6023,8 @@ svn_wc__db_op_remove_node(svn_wc__db_t *
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   rnb.not_present_rev = not_present_revision;
@@ -6002,7 +6052,8 @@ svn_wc__db_temp_op_remove_working(svn_wc
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
@@ -6062,7 +6113,8 @@ svn_wc__db_op_set_base_depth(svn_wc__db_
   SVN_ERR_ASSERT(depth >= svn_depth_empty && depth <= svn_depth_infinity);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* ### We set depth on working and base to match entry behavior.
@@ -6358,6 +6410,7 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -6766,7 +6819,8 @@ svn_wc__db_read_info(svn_wc__db_status_t
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(read_info(status, kind, revision, repos_relpath, &repos_id,
@@ -7032,7 +7086,7 @@ svn_wc__db_read_children_info(apr_hash_t
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &dir_relpath, db,
-                                                dir_abspath,
+                                                dir_abspath, svn_node_dir,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -7073,7 +7127,8 @@ svn_wc__db_read_pristine_info(svn_wc__db
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                                local_abspath,
+                                                local_abspath, 
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -7208,7 +7263,7 @@ svn_wc__db_read_children_walker_info(apr
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &dir_relpath, db,
-                                             dir_abspath,
+                                             dir_abspath, svn_node_dir,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -7279,7 +7334,8 @@ svn_wc__db_read_node_install_info(const 
     wri_abspath = local_abspath;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   if (local_abspath != wri_abspath
@@ -7519,7 +7575,7 @@ svn_wc__db_read_url(const char **url,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                                local_abspath,
+                                                local_abspath, svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -7595,7 +7651,8 @@ svn_wc__db_read_props(apr_hash_t **props
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   rpb.result_pool = result_pool;
@@ -7718,7 +7775,8 @@ svn_wc__db_read_props_streamily(svn_wc__
                  (depth == svn_depth_infinity));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, local_abspath,
+                                                db, local_abspath, 
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -7896,7 +7954,8 @@ svn_wc__db_read_pristine_props(apr_hash_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(db_read_pristine_props(props, wcroot, local_relpath,
@@ -7918,7 +7977,7 @@ svn_wc__db_read_children_of_working_node
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -8073,7 +8132,7 @@ svn_wc__db_node_check_replace(svn_boolea
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -8113,7 +8172,7 @@ svn_wc__db_read_children(const apr_array
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -8197,7 +8256,8 @@ svn_wc__db_global_relocate(svn_wc__db_t 
   /* ### assert that we were passed a directory?  */
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_dir_relpath,
-                           db, local_dir_abspath, scratch_pool, scratch_pool));
+                           db, local_dir_abspath, svn_node_dir,
+                           scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
   local_relpath = local_dir_relpath;
 
@@ -8659,7 +8719,8 @@ svn_wc__db_global_commit(svn_wc__db_t *d
   SVN_ERR_ASSERT(new_checksum == NULL || new_children == NULL);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   cb.new_revision = new_revision;
@@ -8738,7 +8799,8 @@ svn_wc__db_global_update(svn_wc__db_t *d
                      && new_target != NULL));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   ub.new_repos_relpath = new_repos_relpath;
@@ -9015,7 +9077,8 @@ svn_wc__db_op_bump_revisions_post_update
   struct bump_revisions_baton_t brb;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
 
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -9087,7 +9150,8 @@ svn_wc__db_lock_add(svn_wc__db_t *db,
   SVN_ERR_ASSERT(lock != NULL);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, lock_add_txn,
@@ -9137,7 +9201,8 @@ svn_wc__db_lock_remove(svn_wc__db_t *db,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, lock_remove_txn, NULL,
@@ -9166,7 +9231,8 @@ svn_wc__db_scan_base_repos(const char **
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(base_get_info(NULL, NULL, NULL, repos_relpath, &repos_id,
@@ -9496,7 +9562,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(scan_addition(status, &op_root_relpath, repos_relpath, repos_id_p,
@@ -9765,7 +9832,8 @@ svn_wc__db_scan_deletion(const char **ba
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(scan_deletion(&base_del_relpath, &moved_to_relpath,
@@ -10040,7 +10108,8 @@ svn_wc__db_wq_add(svn_wc__db_t *db,
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* Add the work item(s) to the WORK_QUEUE.  */
@@ -10067,7 +10136,8 @@ svn_wc__db_wq_fetch(apr_uint64_t *id,
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -10109,7 +10179,8 @@ svn_wc__db_wq_completed(svn_wc__db_t *db
   SVN_ERR_ASSERT(id != 0);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -10134,7 +10205,8 @@ svn_wc__db_temp_get_format(int *format,
   /* ### assert that we were passed a directory?  */
 
   err = svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                local_dir_abspath, scratch_pool, scratch_pool);
+                                local_dir_abspath, svn_node_dir,
+                                scratch_pool, scratch_pool);
 
   /* If we hit an error examining this directory, then declare this
      directory to not be a working copy.  */
@@ -10178,7 +10250,8 @@ svn_wc__db_temp_get_access(svn_wc__db_t 
      ### ideally: the caller would never ask us about a non-directory.  */
 
   err = svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                            db, local_dir_abspath, scratch_pool, scratch_pool);
+                            db, local_dir_abspath, svn_node_dir,
+                            scratch_pool, scratch_pool);
   if (err)
     {
       svn_error_clear(err);
@@ -10208,7 +10281,8 @@ svn_wc__db_temp_set_access(svn_wc__db_t 
   /* ### assert that we were passed a directory?  */
 
   err = svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                            db, local_dir_abspath, scratch_pool, scratch_pool);
+                            db, local_dir_abspath, svn_node_dir,
+                            scratch_pool, scratch_pool);
   if (err)
     {
       /* We don't even have a wcroot, so just bail. */
@@ -10239,7 +10313,8 @@ svn_wc__db_temp_close_access(svn_wc__db_
   /* ### assert that we were passed a directory?  */
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_dir_abspath, scratch_pool, scratch_pool));
+                              local_dir_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   apr_hash_set(wcroot->access_cache, local_dir_abspath,
                APR_HASH_KEY_STRING, NULL);
 
@@ -10261,7 +10336,8 @@ svn_wc__db_temp_clear_access(svn_wc__db_
   /* ### assert that we were passed a directory?  */
 
   err = svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                            db, local_dir_abspath, scratch_pool, scratch_pool);
+                            db, local_dir_abspath, svn_node_dir,
+                            scratch_pool, scratch_pool);
   if (err)
     {
       svn_error_clear(err);
@@ -10307,7 +10383,8 @@ svn_wc__db_temp_borrow_sdb(svn_sqlite__d
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                            local_dir_abspath, scratch_pool, scratch_pool));
+                            local_dir_abspath, svn_node_dir,
+                            scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   *sdb = wcroot->sdb;
@@ -10331,7 +10408,8 @@ svn_wc__db_read_conflict_victims(const a
 
   /* The parent should be a working copy directory. */
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* ### This will be much easier once we have all conflicts in one
@@ -10377,7 +10455,8 @@ svn_wc__db_read_conflicts(const apr_arra
 
   /* The parent should be a working copy directory. */
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* ### This will be much easier once we have all conflicts in one
@@ -10486,7 +10565,8 @@ svn_wc__db_read_kind(svn_wc__db_kind_t *
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt_info, wcroot->sdb,
@@ -10532,7 +10612,8 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(read_info(&status, NULL, NULL, NULL, NULL, NULL,
@@ -10562,7 +10643,8 @@ svn_wc__db_is_wcroot(svn_boolean_t *is_r
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   if (*local_relpath != '\0')
@@ -10592,7 +10674,8 @@ svn_wc__db_temp_wcroot_tempdir(const cha
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   *temp_dir_abspath = svn_dirent_join_many(result_pool,
@@ -10811,7 +10894,8 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                             db, local_abspath,
+                                             db, local_abspath, 
+                                             svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -10923,7 +11007,8 @@ svn_wc__db_wclock_release(svn_wc__db_t *
   apr_array_header_t *owned_locks;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
 
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11030,7 +11115,8 @@ svn_wc__db_wclock_owns_lock(svn_boolean_
   const char *local_relpath;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
 
   if (!wcroot)
     return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
@@ -11082,7 +11168,8 @@ svn_wc__db_temp_op_end_directory_update(
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_dir_abspath, scratch_pool, scratch_pool));
+                              local_dir_abspath, svn_node_dir,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, end_directory_update,
@@ -11143,7 +11230,8 @@ svn_wc__db_temp_op_start_directory_updat
   SVN_ERR_ASSERT(svn_relpath_is_canonical(new_repos_relpath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   du.new_rev = new_rev;
@@ -11312,7 +11400,8 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* The update editor is supposed to call this function when there is
@@ -11407,7 +11496,7 @@ svn_wc__db_temp_op_set_text_conflict_mar
   SVN_ERR_ASSERT(!wrk_abspath || svn_dirent_is_absolute(wrk_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11497,7 +11586,7 @@ svn_wc__db_temp_op_set_property_conflict
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                                             local_abspath,
+                                             local_abspath, svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11564,6 +11653,7 @@ svn_wc__db_temp_op_set_new_dir_to_incomp
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
 
   VERIFY_USABLE_WCROOT(wcroot);
@@ -11604,7 +11694,8 @@ svn_wc__db_info_below_working(svn_boolea
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
   SVN_ERR(info_below_working(have_base, have_work, status,
                              wcroot, local_relpath, -1, scratch_pool));
@@ -11627,7 +11718,8 @@ svn_wc__db_get_not_present_descendants(c
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              local_abspath, scratch_pool, scratch_pool));
+                              local_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -11725,7 +11817,8 @@ svn_wc__db_min_max_revisions(svn_revnum_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, local_abspath,
+                                                db, local_abspath, 
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11775,6 +11868,7 @@ svn_wc__db_is_sparse_checkout(svn_boolea
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11886,6 +11980,7 @@ svn_wc__db_has_switched_subtrees(svn_boo
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -11909,6 +12004,7 @@ svn_wc__db_get_absent_subtrees(apr_hash_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -12072,6 +12168,7 @@ svn_wc__db_has_local_mods(svn_boolean_t 
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -12183,6 +12280,7 @@ svn_wc__db_revision_status(svn_revnum_t 
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -12210,6 +12308,7 @@ svn_wc__db_base_get_lock_tokens_recursiv
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, local_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -12349,6 +12448,7 @@ svn_wc__db_verify(svn_wc__db_t *db,
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
                                                 db, wri_abspath,
+                                                svn_node_unknown,
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c?rev=1103589&r1=1103588&r2=1103589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c Mon May 16 01:07:11 2011
@@ -113,7 +113,8 @@ svn_wc__db_pristine_get_path(const char 
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                             db, wri_abspath,
+                                             db, wri_abspath, 
+                                             svn_node_unknown,
                                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
@@ -229,7 +230,8 @@ svn_wc__db_pristine_read(svn_stream_t **
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   b.contents = contents;
@@ -272,7 +274,8 @@ svn_wc__db_pristine_get_tempdir(const ch
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown,
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   *temp_dir_abspath = pristine_get_tempdir(wcroot, result_pool, scratch_pool);
@@ -416,7 +419,8 @@ svn_wc__db_pristine_install(svn_wc__db_t
                                    scratch_pool);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   b.tempfile_abspath = tempfile_abspath;
@@ -455,7 +459,8 @@ svn_wc__db_pristine_get_md5(const svn_ch
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_PRISTINE));
@@ -493,7 +498,8 @@ svn_wc__db_pristine_get_sha1(const svn_c
   SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -646,7 +652,8 @@ svn_wc__db_pristine_remove(svn_wc__db_t 
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* If the work queue is not empty, don't delete any pristine text because
@@ -710,7 +717,8 @@ svn_wc__db_pristine_cleanup(svn_wc__db_t
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   SVN_ERR(pristine_cleanup_wcroot(wcroot, scratch_pool));
@@ -743,7 +751,8 @@ svn_wc__db_pristine_check(svn_boolean_t 
   SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
-                              wri_abspath, scratch_pool, scratch_pool));
+                              wri_abspath, svn_node_unknown, 
+                              scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
   /* Check that there is an entry in the PRISTINE table. */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_private.h?rev=1103589&r1=1103588&r2=1103589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_private.h Mon May 16 01:07:11 2011
@@ -125,7 +125,10 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
 
 
 /* For a given LOCAL_ABSPATH, figure out what sqlite database (WCROOT) to
-   use and the RELPATH within that wcroot.
+   use and the RELPATH within that wcroot. KIND serves to prevent unnecessary
+   stat calls and may be set to svn_node_file, if LOCAL_ABSPATH is known to
+   refer to a file. Similarly, svn_node_dir may be used for directories. 
+   Otherwise, it must be svn_node_unknown.
 
    *LOCAL_RELPATH will be allocated within RESULT_POOL. Temporary allocations
    will be made in SCRATCH_POOL.
@@ -139,6 +142,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
                                       const char **local_relpath,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
+                                      svn_node_kind_t kind,
                                       apr_pool_t *result_pool,
                                       apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c?rev=1103589&r1=1103588&r2=1103589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c Mon May 16 01:07:11 2011
@@ -344,12 +344,12 @@ svn_wc__db_wcroot_parse_local_abspath(sv
                                       const char **local_relpath,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
+                                      svn_node_kind_t kind,
                                       apr_pool_t *result_pool,
                                       apr_pool_t *scratch_pool)
 {
   const char *local_dir_abspath;
   const char *original_abspath = local_abspath;
-  svn_node_kind_t kind;
   const char *build_relpath;
   svn_wc__db_wcroot_t *probe_wcroot;
   svn_wc__db_wcroot_t *found_wcroot = NULL;
@@ -380,11 +380,15 @@ svn_wc__db_wcroot_parse_local_abspath(sv
       return SVN_NO_ERROR;
     }
 
-  /* ### at some point in the future, we may need to find a way to get
-     ### rid of this stat() call. it is going to happen for EVERY call
-     ### into wc_db which references a file. calls for directories could
-     ### get an early-exit in the hash lookup just above.  */
-  SVN_ERR(get_path_kind(db, local_abspath, &kind, scratch_pool));
+  if (kind == svn_node_unknown)
+    {
+      /* ### at some point in the future, we may need to find a way to get
+         ### rid of this stat() call. it is going to happen for EVERY call
+         ### into wc_db which references a file. calls for directories could
+         ### get an early-exit in the hash lookup just above.  */
+      SVN_ERR(get_path_kind(db, local_abspath, &kind, scratch_pool));
+    }
+    
   if (kind != svn_node_dir)
     {
       /* If the node specified by the path is NOT present, then it cannot



RE: svn commit: r1103589 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db_pristine.c wc_db_private.h wc_db_wcroot.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: maandag 16 mei 2011 3:07
> To: commits@subversion.apache.org
> Subject: svn commit: r1103589 - in /subversion/trunk/subversion/libsvn_wc:
> wc_db.c wc_db_pristine.c wc_db_private.h wc_db_wcroot.c
> 
> Author: stefan2
> Date: Mon May 16 01:07:11 2011
> New Revision: 1103589
> 
> URL: http://svn.apache.org/viewvc?rev=1103589&view=rev
> Log:
> Eliminate unnecessary stat calls during checkout, part 2 of 2.
> 
> If provided as parameter, svn_wc__db_wcroot_parse_local_abspath
> does not need to use a stat call to detect the kind of node
> behind the given abspath. For many *frequent* callers that
> is known.
> 
> * subversion/libsvn_wc/wc_db_private.h
>   (svn_wc__db_wcroot_parse_local_abspath): add kind parameter
> * subversion/libsvn_wc/wc_db_wcroot.c
>   (svn_wc__db_wcroot_parse_local_abspath): stat for kind of
>    if it is not already known


Why do you use svn_node_kind_t instead of svn_wc__db_kind_t?

The changes to svn_wc__db_base_*() you applied all assume that the working copy files match what the functions receive, while in general you can't assume that. Once a node is shadowed by a WORKING node, or by some unversioned obstruction all bets are off. That is what this function tested for.

In the old entries-world, you would never get an access baton for a directory that was obstructed this way, so this simply can't happen. And now we have to check for that in another way.

This parse path function does that for us in a lot of places (and probably in more places than it should), but we can't avoid it in all cases as ignoring it one time to many will just break both working copies. (It just overwrites the inner, with information from the outer. So both will be out of sync).

Summarized:
What the DB thinks there should be in a specific layer doesn't have to match what is in the working copy.

> * subversion/libsvn_wc/wc_db_pristine.c
>   (svn_wc__db_pristine_get_path, svn_wc__db_pristine_read,
>    svn_wc__db_pristine_get_tempdir, svn_wc__db_pristine_install,
>    svn_wc__db_pristine_get_md5, svn_wc__db_pristine_get_sha1,
>    svn_wc__db_pristine_remove, svn_wc__db_pristine_cleanup,
>    svn_wc__db_pristine_check): don't use the optimization

All these have a wri_abspath, so you can't use the optimization. A wri_abspath can be any path in a working copy (versioned or unversioned).

> * subversion/libsvn_wc/wc_db.c
>   (kind_by_filesize): new utility function

About svn_wc__db_global_record_fileinfo:
This function is only called for files... Why perform a check to guess if a node is maybe a directory?

Directories don't have a valid recorded_*; never had.

> 
>   (get_statement_for_path, svn_wc__db_to_relpath,
>    svn_wc__db_from_relpath, svn_wc__db_get_wcroot,
>    svn_wc__db_base_add_symlink,
> add_absent_excluded_not_present_node,
>    svn_wc__db_base_get_info, svn_wc__db_base_get_children,
>    svn_wc__db_base_clear_dav_cache_recursive,
> svn_wc__db_external_add_file,
>    svn_wc__db_external_add_symlink, svn_wc__db_external_remove,
>    svn_wc__db_external_read, svn_wc__db_external_read_pristine_props,
>    svn_wc__db_external_read_props, svn_wc__db_op_copy,
>    svn_wc__db_op_copy_shadowed_layer, svn_wc__db_op_copy_file,
>    svn_wc__db_op_copy_symlink, svn_wc__db_op_add_symlink,
>    svn_wc__db_op_set_props, svn_wc__db_op_set_changelist,
>    svn_wc__db_op_mark_resolved, svn_wc__db_op_set_tree_conflict,
>    svn_wc__db_op_revert, svn_wc__db_revert_list_read,
>    svn_wc__db_revert_list_notify, svn_wc__db_op_read_all_tree_conflicts,
>    svn_wc__db_op_read_tree_conflict, svn_wc__db_op_remove_node,
>    svn_wc__db_temp_op_remove_working, svn_wc__db_op_delete,
>    svn_wc__db_read_info, svn_wc__db_read_pristine_info,
>    svn_wc__db_read_node_install_info, svn_wc__db_read_url,
>    svn_wc__db_read_props, svn_wc__db_read_props_streamily,
>    svn_wc__db_read_pristine_props,
> svn_wc__db_read_children_of_working_node,
>    svn_wc__db_node_check_replace, svn_wc__db_read_children,
>    svn_wc__db_global_commit, svn_wc__db_global_update,
>    svn_wc__db_op_bump_revisions_post_update, svn_wc__db_lock_add,
>    svn_wc__db_lock_remove, svn_wc__db_scan_base_repos,
>    svn_wc__db_scan_addition, svn_wc__db_scan_deletion,
>    svn_wc__db_wq_add, svn_wc__db_wq_fetch,
> svn_wc__db_wq_completed,
>    svn_wc__db_read_conflict_victims, svn_wc__db_read_conflicts,
>    svn_wc__db_read_kind, svn_wc__db_node_hidden,
> svn_wc__db_is_wcroot,
>    svn_wc__db_temp_wcroot_tempdir, svn_wc__db_wclock_obtain,
>    svn_wc__db_wclock_release, svn_wc__db_wclock_owns_lock,
>    svn_wc__db_temp_op_start_directory_update,
> svn_wc__db_temp_op_make_copy,
>    svn_wc__db_temp_op_set_text_conflict_marker_files,
>    svn_wc__db_temp_op_set_property_conflict_marker_file,
>    svn_wc__db_temp_op_set_new_dir_to_incomplete,
>    svn_wc__db_info_below_working,
> svn_wc__db_get_not_present_descendants,
>    svn_wc__db_min_max_revisions, svn_wc__db_is_sparse_checkout,
>    svn_wc__db_has_switched_subtrees, svn_wc__db_get_absent_subtrees,
>    svn_wc__db_has_local_mods, svn_wc__db_revision_status,
>    svn_wc__db_base_get_lock_tokens_recursive, svn_wc__db_verify):
>    don't use the optimization
> 
>   (svn_wc__db_base_add_directory, svn_wc__db_base_get_children_info,
>    svn_wc__db_external_add_dir, svn_wc__db_op_copy_dir,
>    svn_wc__db_op_add_directory, svn_wc__db_op_set_base_depth,
>    svn_wc__db_read_children_info,
> svn_wc__db_read_children_walker_info,
>    svn_wc__db_global_relocate, svn_wc__db_temp_get_format,
>    svn_wc__db_temp_get_access, svn_wc__db_temp_set_access,
>    svn_wc__db_temp_close_access, svn_wc__db_temp_clear_access,
>    svn_wc__db_temp_borrow_sdb,
> svn_wc__db_temp_op_end_directory_update):
>    path parameters are known to be directories

'when they apply to existing directories on disk', which is generally unknown. This moves the requirement to check that to the caller, which is not always a safe assumption.
> 
>   (svn_wc__db_base_add_file, svn_wc__db_op_add_file):
>    path parameters are known to be files

The update editor has no problem adding a base node under an existing WORKING directory (aka 'A shadowed update'), so the reason why is not correct. But I think adds are performed below a parent, so you can just assume file for that reason.
(But maybe this would need a better argument to match that instead).

>   (svn_wc__db_external_record_fileinfo,
> svn_wc__db_global_record_fileinfo):
>    path parameters are files, if the file length is > 0.

Did you get any calls for directories here?

I really hope you didn't.

	Bert 



RE: svn commit: r1103589 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c wc_db_pristine.c wc_db_private.h wc_db_wcroot.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: maandag 16 mei 2011 3:07
> To: commits@subversion.apache.org
> Subject: svn commit: r1103589 - in /subversion/trunk/subversion/libsvn_wc:
> wc_db.c wc_db_pristine.c wc_db_private.h wc_db_wcroot.c
> 
> Author: stefan2
> Date: Mon May 16 01:07:11 2011
> New Revision: 1103589
> 
> URL: http://svn.apache.org/viewvc?rev=1103589&view=rev
> Log:
> Eliminate unnecessary stat calls during checkout, part 2 of 2.
> 
> If provided as parameter, svn_wc__db_wcroot_parse_local_abspath
> does not need to use a stat call to detect the kind of node
> behind the given abspath. For many *frequent* callers that
> is known.
> 
> * subversion/libsvn_wc/wc_db_private.h
>   (svn_wc__db_wcroot_parse_local_abspath): add kind parameter
> * subversion/libsvn_wc/wc_db_wcroot.c
>   (svn_wc__db_wcroot_parse_local_abspath): stat for kind of
>    if it is not already known


Why do you use svn_node_kind_t instead of svn_wc__db_kind_t?

The changes to svn_wc__db_base_*() you applied all assume that the working copy files match what the functions receive, while in general you can't assume that. Once a node is shadowed by a WORKING node, or by some unversioned obstruction all bets are off. That is what this function tested for.

In the old entries-world, you would never get an access baton for a directory that was obstructed this way, so this simply can't happen. And now we have to check for that in another way.

This parse path function does that for us in a lot of places (and probably in more places than it should), but we can't avoid it in all cases as ignoring it one time to many will just break both working copies. (It just overwrites the inner, with information from the outer. So both will be out of sync).

Summarized:
What the DB thinks there should be in a specific layer doesn't have to match what is in the working copy.

> * subversion/libsvn_wc/wc_db_pristine.c
>   (svn_wc__db_pristine_get_path, svn_wc__db_pristine_read,
>    svn_wc__db_pristine_get_tempdir, svn_wc__db_pristine_install,
>    svn_wc__db_pristine_get_md5, svn_wc__db_pristine_get_sha1,
>    svn_wc__db_pristine_remove, svn_wc__db_pristine_cleanup,
>    svn_wc__db_pristine_check): don't use the optimization

All these have a wri_abspath, so you can't use the optimization. A wri_abspath can be any path in a working copy (versioned or unversioned).

> * subversion/libsvn_wc/wc_db.c
>   (kind_by_filesize): new utility function

About svn_wc__db_global_record_fileinfo:
This function is only called for files... Why perform a check to guess if a node is maybe a directory?

Directories don't have a valid recorded_*; never had.

> 
>   (get_statement_for_path, svn_wc__db_to_relpath,
>    svn_wc__db_from_relpath, svn_wc__db_get_wcroot,
>    svn_wc__db_base_add_symlink,
> add_absent_excluded_not_present_node,
>    svn_wc__db_base_get_info, svn_wc__db_base_get_children,
>    svn_wc__db_base_clear_dav_cache_recursive,
> svn_wc__db_external_add_file,
>    svn_wc__db_external_add_symlink, svn_wc__db_external_remove,
>    svn_wc__db_external_read, svn_wc__db_external_read_pristine_props,
>    svn_wc__db_external_read_props, svn_wc__db_op_copy,
>    svn_wc__db_op_copy_shadowed_layer, svn_wc__db_op_copy_file,
>    svn_wc__db_op_copy_symlink, svn_wc__db_op_add_symlink,
>    svn_wc__db_op_set_props, svn_wc__db_op_set_changelist,
>    svn_wc__db_op_mark_resolved, svn_wc__db_op_set_tree_conflict,
>    svn_wc__db_op_revert, svn_wc__db_revert_list_read,
>    svn_wc__db_revert_list_notify, svn_wc__db_op_read_all_tree_conflicts,
>    svn_wc__db_op_read_tree_conflict, svn_wc__db_op_remove_node,
>    svn_wc__db_temp_op_remove_working, svn_wc__db_op_delete,
>    svn_wc__db_read_info, svn_wc__db_read_pristine_info,
>    svn_wc__db_read_node_install_info, svn_wc__db_read_url,
>    svn_wc__db_read_props, svn_wc__db_read_props_streamily,
>    svn_wc__db_read_pristine_props,
> svn_wc__db_read_children_of_working_node,
>    svn_wc__db_node_check_replace, svn_wc__db_read_children,
>    svn_wc__db_global_commit, svn_wc__db_global_update,
>    svn_wc__db_op_bump_revisions_post_update, svn_wc__db_lock_add,
>    svn_wc__db_lock_remove, svn_wc__db_scan_base_repos,
>    svn_wc__db_scan_addition, svn_wc__db_scan_deletion,
>    svn_wc__db_wq_add, svn_wc__db_wq_fetch,
> svn_wc__db_wq_completed,
>    svn_wc__db_read_conflict_victims, svn_wc__db_read_conflicts,
>    svn_wc__db_read_kind, svn_wc__db_node_hidden,
> svn_wc__db_is_wcroot,
>    svn_wc__db_temp_wcroot_tempdir, svn_wc__db_wclock_obtain,
>    svn_wc__db_wclock_release, svn_wc__db_wclock_owns_lock,
>    svn_wc__db_temp_op_start_directory_update,
> svn_wc__db_temp_op_make_copy,
>    svn_wc__db_temp_op_set_text_conflict_marker_files,
>    svn_wc__db_temp_op_set_property_conflict_marker_file,
>    svn_wc__db_temp_op_set_new_dir_to_incomplete,
>    svn_wc__db_info_below_working,
> svn_wc__db_get_not_present_descendants,
>    svn_wc__db_min_max_revisions, svn_wc__db_is_sparse_checkout,
>    svn_wc__db_has_switched_subtrees, svn_wc__db_get_absent_subtrees,
>    svn_wc__db_has_local_mods, svn_wc__db_revision_status,
>    svn_wc__db_base_get_lock_tokens_recursive, svn_wc__db_verify):
>    don't use the optimization
> 
>   (svn_wc__db_base_add_directory, svn_wc__db_base_get_children_info,
>    svn_wc__db_external_add_dir, svn_wc__db_op_copy_dir,
>    svn_wc__db_op_add_directory, svn_wc__db_op_set_base_depth,
>    svn_wc__db_read_children_info,
> svn_wc__db_read_children_walker_info,
>    svn_wc__db_global_relocate, svn_wc__db_temp_get_format,
>    svn_wc__db_temp_get_access, svn_wc__db_temp_set_access,
>    svn_wc__db_temp_close_access, svn_wc__db_temp_clear_access,
>    svn_wc__db_temp_borrow_sdb,
> svn_wc__db_temp_op_end_directory_update):
>    path parameters are known to be directories

'when they apply to existing directories on disk', which is generally unknown. This moves the requirement to check that to the caller, which is not always a safe assumption.
> 
>   (svn_wc__db_base_add_file, svn_wc__db_op_add_file):
>    path parameters are known to be files

The update editor has no problem adding a base node under an existing WORKING directory (aka 'A shadowed update'), so the reason why is not correct. But I think adds are performed below a parent, so you can just assume file for that reason.
(But maybe this would need a better argument to match that instead).

>   (svn_wc__db_external_record_fileinfo,
> svn_wc__db_global_record_fileinfo):
>    path parameters are files, if the file length is > 0.

Did you get any calls for directories here?

I really hope you didn't.

	Bert