Author: rhuijben
Date: Tue Feb 17 16:09:26 2015
New Revision: 1660432

URL: http://svn.apache.org/r1660432
Log:
Stop creating empty ACTUAL_NODE records for directories when using
'svn changelist --depth infinty new WC'

* subversion/libsvn_wc/wc-queries.sql
  (STMT_INSERT_ACTUAL_EMPTIES_FILES): New query.
  (STMT_DELETE_ACTUAL_EMPTIES): Also try delete node itself.

* subversion/libsvn_wc/wc_db.c
  (set_changelist_txn): Use STMT_INSERT_ACTUAL_EMPTIES_FILES to
    avoid creating unneeded records.

* subversion/svn/changelist-cmd.c
  (svn_cl__changelist): Remove long outdated comment. This bad
    pattern was fixed a long time ago.

* subversion/tests/libsvn_wc/wc-queries-test.c
  (slow_statements): Add STMT_INSERT_ACTUAL_EMPTIES_FILES.
  (parse_explanation_item): Handle new output style in recent Sqlite versions.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/svn/changelist-cmd.c
    subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1660432&r1=1660431&r2=1660432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Feb 17 16:09:26 
2015
@@ -722,6 +722,13 @@ INSERT OR IGNORE INTO actual_node (
 SELECT wc_id, local_relpath, parent_relpath
 FROM targets_list
 
+-- STMT_INSERT_ACTUAL_EMPTIES_FILES
+INSERT OR IGNORE INTO actual_node (
+     wc_id, local_relpath, parent_relpath)
+SELECT wc_id, local_relpath, parent_relpath
+FROM targets_list
+WHERE kind=MAP_FILE
+
 -- STMT_DELETE_ACTUAL_EMPTY
 DELETE FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
@@ -736,7 +743,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2
 -- STMT_DELETE_ACTUAL_EMPTIES
 DELETE FROM actual_node
 WHERE wc_id = ?1
-  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
+  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND properties IS NULL
   AND conflict_data IS NULL
   AND changelist IS NULL

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1660432&r1=1660431&r2=1660432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Feb 17 16:09:26 2015
@@ -6388,7 +6388,7 @@ set_changelist_txn(void *baton,
   if (scb->new_changelist)
     {
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_INSERT_ACTUAL_EMPTIES));
+                                        STMT_INSERT_ACTUAL_EMPTIES_FILES));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 

Modified: subversion/trunk/subversion/svn/changelist-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/changelist-cmd.c?rev=1660432&r1=1660431&r2=1660432&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/changelist-cmd.c (original)
+++ subversion/trunk/subversion/svn/changelist-cmd.c Tue Feb 17 16:09:26 2015
@@ -72,25 +72,7 @@ svn_cl__changelist(apr_getopt_t *os,
   SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
 
   if (opt_state->quiet)
-    /* FIXME: This is required because svn_client_create_context()
-       always initializes ctx->notify_func2 to a wrapper function
-       which calls ctx->notify_func() if it isn't NULL.  In other
-       words, typically, ctx->notify_func2 is never NULL.  This isn't
-       usually a problem, but the changelist logic generates
-       svn_error_t's as part of its notification.
-
-       So, svn_wc_set_changelist() checks its notify_func (our
-       ctx->notify_func2) for NULL-ness, and seeing non-NULL-ness,
-       generates a notificaton object and svn_error_t to describe some
-       problem.  It passes that off to its notify_func (our
-       ctx->notify_func2) which drops the notification on the floor
-       (because it wraps a NULL ctx->notify_func).  But svn_error_t's
-       dropped on the floor cause SEGFAULTs at pool cleanup time --
-       they need instead to be cleared.
-
-       SOOOooo... we set our ctx->notify_func2 to NULL so the WC code
-       doesn't even generate the errors.  */
-    ctx->notify_func2 = NULL;
+    ctx->notify_func2 = NULL; /* Easy out: avoid unneeded work */
 
   if (depth == svn_depth_unknown)
     depth = svn_depth_empty;

Modified: subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1660432&r1=1660431&r2=1660432&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c Tue Feb 17 
16:09:26 2015
@@ -97,6 +97,7 @@ static const int slow_statements[] =
 
   /* Full temporary table read */
   STMT_INSERT_ACTUAL_EMPTIES,
+  STMT_INSERT_ACTUAL_EMPTIES_FILES,
   STMT_SELECT_REVERT_LIST_RECURSIVE,
   STMT_SELECT_DELETE_LIST,
   STMT_SELECT_UPDATE_MOVE_LIST,
@@ -302,14 +303,21 @@ parse_explanation_item(struct explanatio
       item->search = TRUE; /* Search or scan */
       token = apr_strtok(NULL, " ", &last);
 
-      if (!MATCH_TOKEN(token, "TABLE"))
+      if (MATCH_TOKEN(token, "TABLE"))
+        {
+          item->table = apr_strtok(NULL, " ", &last);
+        }
+      else if (MATCH_TOKEN(token, "SUBQUERY"))
+        {
+          item->table = apr_psprintf(result_pool, "SUBQUERY-%s",
+                                     apr_strtok(NULL, " ", &last));
+        }
+      else
         {
           printf("DBG: Expected 'TABLE', got '%s' in '%s'\n", token, text);
           return SVN_NO_ERROR; /* Nothing to parse */
         }
 
-      item->table = apr_strtok(NULL, " ", &last);
-
       token = apr_strtok(NULL, " ", &last);
 
       /* Skip alias */


Reply via email to