subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r936608 - /subversion/trunk/subversion/libsvn_wc/status.c
Date Thu, 22 Apr 2010 04:09:18 GMT
Author: gstein
Date: Thu Apr 22 04:09:18 2010
New Revision: 936608

URL: http://svn.apache.org/viewvc?rev=936608&view=rev
Log:
Fix an entry-fetching bug in the status code. It was passing on-disk kind
information as if was the entry's kind.

* subversion/libsvn_wc/status.c:
  (handle_dir_entry): rename KIND/SPECIAL to PATH_KIND/PATH_SPECIAL like
    other params in this file to enforce the notion these are talking
    about the PATH, not the entry's kind. Update some comments and add
    some assertions in here.
  (get_dir_status): compute NODE_ABSPATH early in the loop since all
    branches want this value. fix the first get_entry() call to pass
    svn_node_unknown since we *don't* know anything about the entry.

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

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=936608&r1=936607&r2=936608&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Thu Apr 22 04:09:18 2010
@@ -818,8 +818,8 @@ handle_dir_entry(const struct walk_statu
                  const char *local_abspath,
                  const svn_wc_entry_t *dir_entry,
                  const svn_wc_entry_t *entry,
-                 svn_node_kind_t kind,
-                 svn_boolean_t special,
+                 svn_node_kind_t path_kind,
+                 svn_boolean_t path_special,
                  const apr_array_header_t *ignores,
                  svn_depth_t depth,
                  svn_boolean_t get_all,
@@ -831,12 +831,16 @@ handle_dir_entry(const struct walk_statu
                  void *cancel_baton,
                  apr_pool_t *pool)
 {
-  if (kind == svn_node_dir)
+  SVN_ERR_ASSERT(dir_entry != NULL);
+  SVN_ERR_ASSERT(entry != NULL);
+
+  /* We are looking at a directory on-disk.  */
+  if (path_kind == svn_node_dir)
     {
       /* Descend only if the subdirectory is a working copy directory (which
          we've discovered because we got a THIS_DIR entry. And only descend
          if DEPTH permits it, of course.  */
-      if (!*entry->name
+      if (*entry->name == '\0'
           && (depth == svn_depth_unknown
               || depth == svn_depth_immediates
               || depth == svn_depth_infinity))
@@ -848,19 +852,20 @@ handle_dir_entry(const struct walk_statu
         }
       else
         {
-          /* FULL_ENTRY is still a stub (an obstructed subdir), or DEPTH
-             is limiting us. Send just this directory.  */
+          /* ENTRY is a child entry (file or parent stub). Or we have a
+             directory entry but DEPTH is limiting our recursion.  */
           SVN_ERR(send_status_structure(wb, local_abspath, entry,
-                                        dir_entry, kind, special, get_all,
-                                        FALSE,
+                                        dir_entry, path_kind, path_special,
+                                        get_all, FALSE,
                                         status_func, status_baton, pool));
         }
     }
   else
     {
-      /* File entries are ... just fine! */
+      /* This is a file/symlink on-disk.  */
       SVN_ERR(send_status_structure(wb, local_abspath, entry,
-                                    dir_entry, kind, special, get_all, FALSE,
+                                    dir_entry, path_kind, path_special,
+                                    get_all, FALSE,
                                     status_func, status_baton, pool));
     }
   return SVN_NO_ERROR;
@@ -1051,6 +1056,8 @@ get_dir_status(const struct walk_status_
 
       apr_hash_this(hi, &key, &klen, NULL);
 
+      node_abspath = svn_dirent_join(local_abspath, key, iterpool);
+
       dirent_p = apr_hash_get(dirents, key, klen);
 
       if (apr_hash_get(nodes, key, klen))
@@ -1058,9 +1065,7 @@ get_dir_status(const struct walk_status_
           /* Versioned node */
           svn_error_t *err;
           const svn_wc_entry_t *entry;
-
           svn_boolean_t hidden;
-          node_abspath = svn_dirent_join(local_abspath, key, iterpool);
 
           SVN_ERR(svn_wc__db_node_hidden(&hidden, wb->db, node_abspath,
                                          iterpool));
@@ -1068,13 +1073,15 @@ get_dir_status(const struct walk_status_
           if (!hidden || get_excluded)
             {
               err = svn_wc__get_entry(&entry, wb->db, node_abspath, FALSE,
-                                      dirent_p ? dirent_p->kind
-                                               : svn_node_unknown,
-                                      FALSE, iterpool, iterpool);
+                                      svn_node_unknown, FALSE,
+                                      iterpool, iterpool);
               if (err)
                 {
                   if (err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
-                    svn_error_clear(err);
+                    {
+                      /* We asked for the contents, but got the stub.  */
+                      svn_error_clear(err);
+                    }
                   else if (err && err->apr_err == SVN_ERR_WC_MISSING)
                     {
                       svn_error_clear(err);
@@ -1098,7 +1105,7 @@ get_dir_status(const struct walk_status_
               if (depth == svn_depth_files && entry->kind == svn_node_dir)
                 continue;
 
-              /* Handle this directory entry (possibly recursing). */
+              /* Handle this entry (possibly recursing). */
               SVN_ERR(handle_dir_entry(wb,
                                        node_abspath,
                                        dir_entry,
@@ -1128,8 +1135,7 @@ get_dir_status(const struct walk_status_
                                             iterpool));
 
           SVN_ERR(send_unversioned_item(wb,
-                                        svn_dirent_join(local_abspath, key,
-                                                        iterpool),
+                                        node_abspath,
                                         dirent_p ? dirent_p->kind
                                                  : svn_node_none,
                                         dirent_p ? dirent_p->special : FALSE,
@@ -1158,8 +1164,7 @@ get_dir_status(const struct walk_status_
                                         iterpool));
 
       SVN_ERR(send_unversioned_item(wb,
-                                    svn_dirent_join(local_abspath, key,
-                                                    iterpool),
+                                    node_abspath,
                                     dirent_p->kind,
                                     dirent_p->special,
                                     patterns,



Mime
View raw message