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

svn commit: r896078 - in /subversion/trunk/subversion/libsvn_wc: entries.c wc_db.c

Author: rhuijben
Date: Tue Jan  5 15:07:53 2010
New Revision: 896078

URL: http://svn.apache.org/viewvc?rev=896078&view=rev
Log:
Following up on r880117 (the introduction of the separate excluded status
in WC-NG), remove some obsolete depth updating.

* subversion/libsvn_wc/entries.c
  (svn_wc__set_depth): Remove check on asserted value and add comment.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_op_set_dir_depth): Remove obsolete check on exclude
   and remove the parent updating as excluded nodes are alway recorded
   in a different way. Make sure we flush the parent entries anyway.

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

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=896078&r1=896077&r2=896078&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Jan  5 15:07:53 2010
@@ -1568,29 +1568,25 @@
 
       if (entry != NULL)
         {
+          /* The entries in the parent stub only store excluded vs infinity. */
           entry->depth = (depth == svn_depth_exclude) ? svn_depth_exclude
                                                       : svn_depth_infinity;
         }
     }
 
-  /* ### setting depth exclude on a wcroot breaks svn_wc_crop() */
-  if (depth != svn_depth_exclude)
+   /* Fetch the entries for the directory, and write our depth there. */
+  adm_access = svn_wc__adm_retrieve_internal2(db, local_dir_abspath,
+                                              scratch_pool);
+  if (adm_access != NULL)
     {
-       /* We aren't excluded, so fetch the entries for the directory, and write
-        our depth there. */
-      adm_access = svn_wc__adm_retrieve_internal2(db, local_dir_abspath,
-                                                  scratch_pool);
-      if (adm_access != NULL)
-        {
-          apr_hash_t *entries = svn_wc__adm_access_entries(adm_access);
+      apr_hash_t *entries = svn_wc__adm_access_entries(adm_access);
 
-          entry = (entries != NULL)
-                           ? apr_hash_get(entries, "", APR_HASH_KEY_STRING)
-                           : NULL;
+      entry = (entries != NULL)
+                       ? apr_hash_get(entries, "", APR_HASH_KEY_STRING)
+                       : NULL;
 
-          if (entry != NULL)
-            entry->depth = depth;
-        }
+      if (entry != NULL)
+        entry->depth = depth;
     }
 
   return svn_error_return(svn_wc__db_temp_op_set_dir_depth(db,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=896078&r1=896077&r2=896078&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Jan  5 15:07:53 2010
@@ -3085,23 +3085,18 @@
   if (flush_entry_cache)
     flush_entries(pdh);
 
+  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_DEPTH));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
+  SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
+  SVN_ERR(svn_sqlite__step_done(stmt));
 
-  /* ### setting depth exclude on a wcroot breaks svn_wc_crop() */
-  if (strcmp(current_relpath, "") != 0 || depth != svn_depth_exclude)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_DEPTH));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
-      SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_WORKING_DEPTH));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
-      SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-    }
+  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_WORKING_DEPTH));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
+  SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
+  SVN_ERR(svn_sqlite__step_done(stmt));
 
   /* Check if we should also set depth in the parent db */
-  if (strcmp(current_relpath, "") == 0)
+  if (flush_entry_cache && strcmp(current_relpath, "") == 0)
     {
       svn_error_t *err;
 
@@ -3117,26 +3112,7 @@
       else
         SVN_ERR(err);
 
-      if (flush_entry_cache)
-        flush_entries(pdh);
-
-      depth = (depth == svn_depth_exclude) ? svn_depth_exclude
-                                           : svn_depth_infinity;
-
-      VERIFY_USABLE_PDH(pdh);
-      wcroot = pdh->wcroot;
-      sdb = wcroot->sdb;
-      current_relpath = svn_dirent_basename(local_abspath, NULL);
-
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_DEPTH));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
-      SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
-      SVN_ERR(svn_sqlite__step_done(stmt));
-
-      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_WORKING_DEPTH));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
-      SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
-      SVN_ERR(svn_sqlite__step_done(stmt));
+      flush_entries(pdh);
     }
 
   return SVN_NO_ERROR;