Author: rhuijben
Date: Fri Feb 20 12:45:15 2015
New Revision: 1661110

URL: http://svn.apache.org/r1661110
Log:
Fix an old bug (and a slight performance issue) when walking entries using
the <= 1.6 api.

This api still checked for excluded nodes via the depth=excluded, while
we moved away from that starting in wc format 15 during 1.7 development.

Another reason for this is that we should avoid the ugly
svn_wc__db_node_hidden() function.

* subversion/libsvn_wc/entries.c
  (svn_wc_walk_entries3): Check for all hidden kinds using the results
    from svn_wc__db_read_info instead of invalid or slow other ways.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1661110&r1=1661109&r2=1661110&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Feb 20 12:45:15 2015
@@ -2708,11 +2708,11 @@ svn_wc_walk_entries3(const char *path,
   svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
   svn_error_t *err;
   svn_node_kind_t kind;
-  svn_depth_t depth;
+  svn_wc__db_status_t status;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
-  err = svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, &depth, NULL, NULL,
+  err = svn_wc__db_read_info(&status, &kind, 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,
@@ -2731,7 +2731,9 @@ svn_wc_walk_entries3(const char *path,
         walk_baton, pool);
     }
 
-  if (kind == svn_node_file || depth == svn_depth_exclude)
+  if (kind == svn_node_file
+      || status == svn_wc__db_status_excluded
+      || status == svn_wc__db_status_server_excluded)
     {
       const svn_wc_entry_t *entry;
 
@@ -2740,27 +2742,24 @@ svn_wc_walk_entries3(const char *path,
          ### we should not call handle_error for an error the *callback*
          ###   gave us. let it deal with the problem before returning.  */
 
-      if (!show_hidden)
+      if (!show_hidden
+          && (status == svn_wc__db_status_not_present
+              || status == svn_wc__db_status_excluded
+              || status == svn_wc__db_status_server_excluded))
         {
-          svn_boolean_t hidden;
-          SVN_ERR(svn_wc__db_node_hidden(&hidden, db, local_abspath, pool));
+          /* The fool asked to walk a "hidden" node. Report the node as
+              unversioned.
 
-          if (hidden)
-            {
-              /* The fool asked to walk a "hidden" node. Report the node as
-                 unversioned.
-
-                 ### this is incorrect behavior. see depth_test 36. the walk
-                 ### API will be revamped to avoid entry structures. we should
-                 ### be able to solve the problem with the new API. (since we
-                 ### shouldn't return a hidden entry here)  */
-              return walk_callbacks->handle_error(
-                               path, svn_error_createf(
-                                  SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                  _("'%s' is not under version control"),
-                                  svn_dirent_local_style(local_abspath, pool)),
-                               walk_baton, pool);
-            }
+              ### this is incorrect behavior. see depth_test 36. the walk
+              ### API will be revamped to avoid entry structures. we should
+              ### be able to solve the problem with the new API. (since we
+              ### shouldn't return a hidden entry here)  */
+          return walk_callbacks->handle_error(
+                            path, svn_error_createf(
+                              SVN_ERR_UNVERSIONED_RESOURCE, NULL,
+                              _("'%s' is not under version control"),
+                              svn_dirent_local_style(local_abspath, pool)),
+                            walk_baton, pool);
         }
 
       SVN_ERR(svn_wc__get_entry(&entry, db, local_abspath, FALSE,


Reply via email to