subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1659418 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c
Date Thu, 12 Feb 2015 21:41:53 GMT
Author: rhuijben
Date: Thu Feb 12 21:41:53 2015
New Revision: 1659418

URL: http://svn.apache.org/r1659418
Log:
Resolve an old TODO from one of the op-depth bump helper functions:
Cleanup some test code.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_LAYER_FOR_REPLACE): Remove unused inner query.

* subversion/libsvn_wc/wc_db.c
  (db_extend_parent_delete): Remove unused diagnostics argument.
  (insert_base_node): Update caller.
  (svn_wc__db_op_copy_layer_internal): Use a simple check to see
    when a parent delete might need extension.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.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=1659418&r1=1659417&r2=1659418&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Feb 12 21:41:53 2015
@@ -262,15 +262,12 @@ The op_root must exist (or there is no l
    always has presence 'normal' */
 -- STMT_SELECT_LAYER_FOR_REPLACE
 SELECT s.local_relpath, s.kind,
-  RELPATH_SKIP_JOIN(?2, ?4, s.local_relpath) drp, 'normal', 0
+  RELPATH_SKIP_JOIN(?2, ?4, s.local_relpath) drp, 'normal'
 FROM nodes s
 WHERE s.wc_id = ?1 AND s.local_relpath = ?2 AND s.op_depth = ?3
 UNION ALL
 SELECT s.local_relpath, s.kind,
-  RELPATH_SKIP_JOIN(?2, ?4, s.local_relpath) drp, d.presence,
-  EXISTS(SELECT * FROM nodes sh
-         WHERE sh.wc_id = ?1 AND sh.op_depth > ?5
-           AND sh.local_relpath = d.local_relpath) shadowed
+  RELPATH_SKIP_JOIN(?2, ?4, s.local_relpath) drp, d.presence
 FROM nodes s
 LEFT OUTER JOIN nodes d ON d.wc_id= ?1 AND d.op_depth = ?5
      AND d.local_relpath = drp

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1659418&r1=1659417&r2=1659418&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Feb 12 21:41:53 2015
@@ -611,8 +611,7 @@ blank_ibb(insert_base_baton_t *pibb)
    was recorded, otherwise to FALSE.
  */
 static svn_error_t *
-db_extend_parent_delete(svn_boolean_t *added_delete,
-                        svn_wc__db_wcroot_t *wcroot,
+db_extend_parent_delete(svn_wc__db_wcroot_t *wcroot,
                         const char *local_relpath,
                         svn_node_kind_t kind,
                         int op_depth,
@@ -625,9 +624,6 @@ db_extend_parent_delete(svn_boolean_t *a
 
   SVN_ERR_ASSERT(local_relpath[0]);
 
-  if (added_delete)
-    *added_delete = FALSE;
-
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_LOWEST_WORKING_NODE));
   SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, parent_relpath,
@@ -654,9 +650,6 @@ db_extend_parent_delete(svn_boolean_t *a
                                     local_relpath, parent_op_depth,
                                     parent_relpath, kind_map, kind));
           SVN_ERR(svn_sqlite__update(NULL, stmt));
-
-          if (added_delete)
-            *added_delete = TRUE;
         }
     }
 
@@ -881,8 +874,7 @@ insert_base_node(const insert_base_baton
               || (pibb->status == svn_wc__db_status_incomplete))
           && ! pibb->file_external)
         {
-          SVN_ERR(db_extend_parent_delete(NULL,
-                                          wcroot, local_relpath,
+          SVN_ERR(db_extend_parent_delete(wcroot, local_relpath,
                                           pibb->kind, 0,
                                           scratch_pool));
         }
@@ -4899,50 +4891,29 @@ svn_wc__db_op_copy_layer_internal(svn_wc
       if (err)
         break;
 
-      if (strlen(dst_relpath) > strlen(dst_op_relpath))
+      /* The node can't be deleted where it is added, so extension of
+         an existing shadowing is only interesting 2 levels deep. */
+      if (relpath_depth(dst_relpath) > (dst_op_depth+1))
         {
-          svn_boolean_t added_delete = FALSE;
-          svn_node_kind_t kind = svn_sqlite__column_token(stmt, 1, kind_map);
-
-          /* The op root can't be shadowed, so extension of a parent delete
-             is only needed when the parent can be deleted */
-          if (relpath_depth(dst_relpath) > (dst_op_depth+1))
-            {
-              err = db_extend_parent_delete(&added_delete, wcroot, dst_relpath,
-                                            kind, dst_op_depth, iterpool);
-
-              if (err)
-                break;
-            }
-
           if (exists)
             {
               svn_wc__db_status_t presence;
 
               presence = svn_sqlite__column_token(stmt, 3, presence_map);
 
-              if (presence == svn_wc__db_status_not_present)
+              if (presence != svn_wc__db_status_normal)
                 exists = FALSE;
             }
 
-          /* ### Fails in a few tests... Needs further research */
-          /*SVN_ERR_ASSERT(!(exists && added_delete));*/
-
           if (!exists)
             {
-              svn_boolean_t shadowed;
+              svn_node_kind_t kind = svn_sqlite__column_token(stmt, 1, kind_map);
 
-              shadowed = svn_sqlite__column_int(stmt, 4);
+              err = db_extend_parent_delete(wcroot, dst_relpath,
+                                            kind, dst_op_depth, iterpool);
 
-              /*if (!shadowed && !added_delete)
-                {
-                  err = svn_error_createf(
-                              SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
-                              _("Node '%s' was unexpectedly added unshadowed"),
-                                path_for_error_message(wcroot, dst_relpath,
-                                                       iterpool));
-                  break;
-                }*/
+              if (err)
+                break;
             }
         }
 



Mime
View raw message