You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/12/13 21:39:32 UTC

svn commit: r1421507 [3/6] - in /subversion/branches/ev2-export: ./ build/ contrib/server-side/svncutter/ subversion/bindings/swig/ subversion/bindings/swig/python/tests/ subversion/include/ subversion/include/private/ subversion/libsvn_auth_kwallet/ s...

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/util.c?rev=1421507&r1=1421506&r2=1421507&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/util.c Thu Dec 13 20:39:17 2012
@@ -610,8 +610,9 @@ svn_wc__fetch_base_func(const char **fil
 
   err = svn_wc__db_base_get_info(NULL, NULL, NULL, NULL, NULL, NULL,
                                  NULL, NULL, NULL, NULL, &checksum,
-                                 NULL, NULL, NULL, NULL, sfb->db,
-                                 local_abspath, scratch_pool, scratch_pool);
+                                 NULL, NULL, NULL, NULL, NULL,
+                                 sfb->db, local_abspath,
+                                 scratch_pool, scratch_pool);
   if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
     {
       svn_error_clear(err);

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql?rev=1421507&r1=1421506&r2=1421507&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-metadata.sql Thu Dec 13 20:39:17 2012
@@ -181,8 +181,8 @@ CREATE TABLE ACTUAL_NODE (
   PRIMARY KEY (wc_id, local_relpath)
   );
 
-CREATE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath);
-CREATE INDEX I_ACTUAL_CHANGELIST ON ACTUAL_NODE (changelist);
+CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath,
+                                                    local_relpath);
 
 
 /* ------------------------------------------------------------------------- */
@@ -408,8 +408,11 @@ CREATE TABLE NODES (
   /* the kind of the new node. may be "unknown" if the node is not present. */
   kind  TEXT NOT NULL,
 
-  /* serialized skel of this node's properties. NULL if we
-     have no information about the properties (a non-present node). */
+  /* serialized skel of this node's properties (when presence is 'normal' or
+     'incomplete'); an empty skel or NULL indicates no properties.  NULL if
+     we have no information about the properties (any other presence).
+     TODO: Choose & require a single representation for 'no properties'.
+  */
   properties  BLOB,
 
   /* NULL depth means "default" (typically svn_depth_infinity) */
@@ -483,7 +486,8 @@ CREATE TABLE NODES (
 
   );
 
-CREATE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath, op_depth);
+CREATE UNIQUE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath,
+                                             local_relpath, op_depth);
 /* I_NODES_MOVED is introduced in format 30 */
 CREATE UNIQUE INDEX I_NODES_MOVED ON NODES (wc_id, moved_to, op_depth);
 
@@ -553,7 +557,7 @@ CREATE TABLE EXTERNALS (
   /* Repository location fields */
   repos_id  INTEGER NOT NULL REFERENCES REPOSITORY (id),
 
-  /* Either 'normal' or 'excluded' */
+  /* Either MAP_NORMAL or MAP_EXCLUDED */
   presence  TEXT NOT NULL,
 
   /* the kind of the external. */
@@ -574,7 +578,6 @@ CREATE TABLE EXTERNALS (
   PRIMARY KEY (wc_id, local_relpath)
 );
 
-CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath);
 CREATE UNIQUE INDEX I_EXTERNALS_DEFINED ON EXTERNALS (wc_id,
                                                       def_local_relpath,
                                                       local_relpath);
@@ -667,6 +670,9 @@ PRAGMA user_version = 22;
 -- STMT_UPGRADE_TO_23
 PRAGMA user_version = 23;
 
+-- STMT_UPGRADE_23_HAS_WORKING_NODES
+SELECT 1 FROM nodes WHERE op_depth > 0
+LIMIT 1
 
 /* ------------------------------------------------------------------------- */
 
@@ -820,6 +826,8 @@ WHERE wc_id = ?1 and local_relpath = ?2
    inherited properties */
 -- STMT_UPGRADE_TO_31
 ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
+DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST;
+DROP INDEX IF EXISTS I_EXTERNALS_PARENT;
 
 PRAGMA user_version = 31;
 
@@ -846,6 +854,23 @@ WHERE (l.local_relpath = '' AND l.repos_
                                  '/'))
 
 /* ------------------------------------------------------------------------- */
+/* Format 32 ....  */
+-- STMT_UPGRADE_TO_32
+
+/* Drop old index. ### Remove this part from the upgrade to 31 once bumped */
+DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST;
+DROP INDEX IF EXISTS I_EXTERNALS_PARENT;
+CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath);
+
+DROP INDEX I_NODES_PARENT;
+CREATE UNIQUE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath,
+                                             local_relpath, op_depth);
+
+DROP INDEX I_ACTUAL_PARENT;
+CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL (wc_id, parent_relpath,
+                                               local_relpath);
+
+/* ------------------------------------------------------------------------- */
 
 /* Format YYY introduces new handling for conflict information.  */
 -- format: YYY
@@ -902,8 +927,8 @@ CREATE TABLE ACTUAL_NODE (
   PRIMARY KEY (wc_id, local_relpath)
   );
 
-CREATE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath);
-CREATE INDEX I_ACTUAL_CHANGELIST ON ACTUAL_NODE (changelist);
+CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath,
+                                                    local_relpath);
 
 INSERT INTO ACTUAL_NODE SELECT
   wc_id, local_relpath, parent_relpath, properties, conflict_old,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql?rev=1421507&r1=1421506&r2=1421507&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql Thu Dec 13 20:39:17 2012
@@ -98,7 +98,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 -- STMT_SELECT_LOWEST_WORKING_NODE
 SELECT op_depth, presence
 FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3
 ORDER BY op_depth
 LIMIT 1
 
@@ -157,7 +157,7 @@ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, 
 SELECT local_relpath, kind FROM nodes n
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND presence in ('normal', 'incomplete')
+  AND presence in (MAP_NORMAL, MAP_INCOMPLETE)
   AND NOT EXISTS(SELECT 1 FROM NODES w
                  WHERE w.wc_id = ?1 AND w.local_relpath = n.local_relpath
                    AND op_depth > 0)
@@ -168,7 +168,7 @@ SELECT local_relpath, kind, checksum, tr
 FROM nodes n
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence in ('normal', 'incomplete')
+  AND presence in (MAP_NORMAL, MAP_INCOMPLETE)
   AND op_depth = (SELECT MAX(op_depth)
                   FROM NODES w
                   WHERE w.wc_id = ?1
@@ -198,12 +198,12 @@ WHERE wc_id = ?1 AND IS_STRICT_DESCENDAN
                  WHERE w.wc_id = ?1
                    AND w.local_relpath = actual_node.local_relpath
                    AND op_depth > 0
-                   AND presence in ('normal', 'incomplete', 'not-present'))
+                   AND presence in (MAP_NORMAL, MAP_INCOMPLETE, MAP_NOT_PRESENT))
 
 -- STMT_DELETE_WORKING_BASE_DELETE
 DELETE FROM nodes
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence = 'base-deleted'
+  AND presence = MAP_BASE_DELETED
   AND op_depth > 0
   AND op_depth = (SELECT MIN(op_depth) FROM nodes n
                     WHERE n.wc_id = ?1
@@ -220,15 +220,43 @@ DELETE FROM nodes
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
 
+-- STMT_DELETE_WORKING_OP_DEPTH
+DELETE FROM nodes
+WHERE wc_id = ?1 
+  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND op_depth = ?3
+
+-- STMT_SELECT_LOCAL_RELPATH_OP_DEPTH
+SELECT local_relpath
+FROM nodes
+WHERE wc_id = ?1
+  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND op_depth = ?3
+
+-- STMT_COPY_NODE_MOVE
+INSERT OR REPLACE INTO nodes (
+    wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+    revision, presence, depth, kind, changed_revision, changed_date,
+    changed_author, checksum, properties, translated_size, last_mod_time,
+    symlink_target, moved_here )
+SELECT
+    wc_id, ?4 /*local_relpath */, ?5 /*op_depth*/, ?6 /* parent_relpath */,
+    repos_id,
+    repos_path, revision, presence, depth, kind, changed_revision,
+    changed_date, changed_author, checksum, properties, translated_size,
+    last_mod_time, symlink_target, 1
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
+
 -- STMT_SELECT_OP_DEPTH_CHILDREN
-SELECT local_relpath FROM nodes
+SELECT local_relpath, kind FROM nodes
 WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3
   AND (?3 != 0 OR file_external is NULL)
 
 -- STMT_SELECT_GE_OP_DEPTH_CHILDREN
 SELECT 1 FROM nodes
 WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND (op_depth > ?3 OR (op_depth = ?3 AND presence != 'base-deleted'))
+  AND (op_depth > ?3 OR (op_depth = ?3 AND presence != MAP_BASE_DELETED))
 UNION ALL
 SELECT 1 FROM ACTUAL_NODE
 WHERE wc_id = ?1 AND parent_relpath = ?2
@@ -239,21 +267,21 @@ DELETE FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND (op_depth < ?3
-       OR (op_depth = ?3 AND presence = 'base-deleted'))
+       OR (op_depth = ?3 AND presence = MAP_BASE_DELETED))
 
 /* Get not-present descendants of a copied node. Not valid for the wc-root */
 -- STMT_SELECT_NOT_PRESENT_DESCENDANTS
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1 AND op_depth = ?3
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND presence = 'not-present'
+  AND presence = MAP_NOT_PRESENT
 
 -- STMT_COMMIT_DESCENDANT_TO_BASE
 UPDATE NODES SET op_depth = 0, repos_id = ?4, repos_path = ?5, revision = ?6,
   moved_here = NULL, moved_to = NULL, dav_cache = NULL,
-  presence = CASE presence WHEN 'normal' THEN 'normal'
-                           WHEN 'excluded' THEN 'excluded'
-                           ELSE 'not-present' END
+  presence = CASE presence WHEN MAP_NORMAL THEN MAP_NORMAL
+                           WHEN MAP_EXCLUDED THEN MAP_EXCLUDED
+                           ELSE MAP_NOT_PRESENT END
 WHERE wc_id = ?1 AND local_relpath = ?2 and op_depth = ?3
 
 -- STMT_SELECT_NODE_CHILDREN
@@ -274,11 +302,7 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
        OR
        (op_depth = (SELECT MAX(op_depth) FROM nodes
                     WHERE wc_id = ?1 AND local_relpath = ?2)
-        AND presence != 'base-deleted'))
-
--- STMT_SELECT_BASE_PROPS
-SELECT properties FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+        AND presence != MAP_BASE_DELETED))
 
 -- STMT_SELECT_NODE_PROPS
 SELECT properties, presence FROM nodes
@@ -289,17 +313,6 @@ ORDER BY op_depth DESC
 SELECT properties FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
 
--- STMT_UPDATE_NODE_BASE_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-
--- STMT_UPDATE_NODE_WORKING_PROPS
-UPDATE nodes SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2
-  AND op_depth =
-   (SELECT MAX(op_depth) FROM nodes
-    WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
-
 -- STMT_UPDATE_ACTUAL_PROPS
 UPDATE actual_node SET properties = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2
@@ -423,7 +436,7 @@ WHERE wc_id = ?1
   AND local_relpath = (SELECT local_relpath FROM targets_list AS t
                        WHERE wc_id = ?1
                          AND t.local_relpath = actual_node.local_relpath
-                         AND kind = 'file')
+                         AND kind = MAP_FILE)
 
 -- STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST
 UPDATE actual_node SET changelist = NULL
@@ -436,7 +449,7 @@ SELECT wc_id, local_relpath, 7, ?3
 FROM targets_list
 WHERE wc_id = ?1
   AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
-  AND kind = 'dir'
+  AND kind = MAP_DIR
 
 -- STMT_RESET_ACTUAL_WITH_CHANGELIST
 REPLACE INTO actual_node (
@@ -512,7 +525,7 @@ SELECT wc_id, local_relpath, parent_relp
 FROM nodes_current
 WHERE wc_id = ?1
   AND parent_relpath = ?2
-  AND kind = 'file'
+  AND kind = MAP_FILE
 
 -- STMT_INSERT_TARGET_DEPTH_IMMEDIATES
 INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind)
@@ -544,7 +557,7 @@ SELECT N.wc_id, N.local_relpath, N.paren
     ON A.wc_id = N.wc_id AND A.local_relpath = N.local_relpath
  WHERE N.wc_id = ?1
    AND N.parent_relpath = ?2
-   AND kind = 'file'
+   AND kind = MAP_FILE
    AND A.changelist = ?3
 
 -- STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES
@@ -612,8 +625,8 @@ WHERE wc_id = ?1 AND local_relpath = ?2
 DELETE FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2
   AND op_depth = (SELECT MIN(op_depth) FROM nodes
-                  WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
-  AND presence = 'base-deleted'
+                  WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3)
+  AND presence = MAP_BASE_DELETED
 
 -- STMT_DELETE_ALL_LAYERS
 DELETE FROM nodes
@@ -644,7 +657,7 @@ WHERE wc_id = ?1
   AND (changelist IS NULL
        OR NOT EXISTS (SELECT 1 FROM nodes_current c
                       WHERE c.wc_id = ?1 AND c.local_relpath = ?2
-                        AND c.kind = 'file'))
+                        AND c.kind = MAP_FILE))
 
 -- STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE
 DELETE FROM actual_node
@@ -655,7 +668,7 @@ WHERE wc_id = ?1
        OR NOT EXISTS (SELECT 1 FROM nodes_current c
                       WHERE c.wc_id = ?1 
                         AND c.local_relpath = actual_node.local_relpath
-                        AND c.kind = 'file'))
+                        AND c.kind = MAP_FILE))
 
 -- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST
 UPDATE actual_node
@@ -684,7 +697,7 @@ WHERE wc_id = ?1
 -- STMT_UPDATE_NODE_BASE_DEPTH
 UPDATE nodes SET depth = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-  AND kind='dir'
+  AND kind=MAP_DIR
 
 -- STMT_UPDATE_NODE_BASE_PRESENCE
 UPDATE nodes SET presence = ?3
@@ -738,6 +751,9 @@ WHERE refcount = 0
 DELETE FROM pristine
 WHERE checksum = ?1 AND refcount = 0
 
+-- STMT_VACUUM
+VACUUM
+
 -- STMT_SELECT_CONFLICT_VICTIMS
 SELECT local_relpath, conflict_data
 FROM actual_node
@@ -803,23 +819,20 @@ VALUES (?1, ?2, 0,
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth,
     parent_relpath, presence, kind)
-SELECT wc_id, local_relpath, ?3 /*op_depth*/,
-       parent_relpath, ?4 /*presence*/, kind
-FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+VALUES(?1, ?2, ?3, ?4, MAP_BASE_DELETED, ?5)
 
 /* If this query is updated, STMT_INSERT_DELETE_LIST should too. */
 -- STMT_INSERT_DELETE_FROM_NODE_RECURSIVE
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
-SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, 'base-deleted',
+SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
        kind
 FROM nodes
 WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = ?3
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
+  AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -838,7 +851,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
 SELECT wc_id, local_relpath, ?3 /*op_depth*/, parent_relpath,
-    'base-deleted', kind
+    MAP_BASE_DELETED, kind
 FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
@@ -857,7 +870,7 @@ LIMIT 1
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND op_depth = 0 AND presence = 'server-excluded'
+  AND op_depth = 0 AND presence = MAP_SERVER_EXCLUDED
 LIMIT 1
 
 /* Select all excluded nodes. Not valid on the WC-root */
@@ -866,7 +879,7 @@ SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND (presence = 'server-excluded' OR presence = 'excluded')
+  AND (presence = MAP_SERVER_EXCLUDED OR presence = MAP_EXCLUDED)
 
 /* Creates a copy from one top level NODE to a different location */
 -- STMT_INSERT_WORKING_NODE_COPY_FROM
@@ -941,7 +954,7 @@ WHERE wc_id = ?1
 DELETE FROM externals
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND kind != 'dir'
+  AND kind != MAP_DIR
 
 -- STMT_DELETE_EXTERNAL_REGISTATIONS
 DELETE FROM externals
@@ -1004,7 +1017,7 @@ WHERE wc_id = ?1 AND local_relpath = ?2
  * WHERE wc_id = ?1
  *   AND (local_relpath = ?2
  *        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
- *   AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+ *   AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
  * ### But it would take a double table scan execution plan for it.
  * ### Maybe there is something else going on? */
 SELECT IFNULL((SELECT properties FROM actual_node a
@@ -1013,7 +1026,7 @@ SELECT IFNULL((SELECT properties FROM ac
        local_relpath, depth
 FROM nodes_current n
 WHERE wc_id = ?1 AND local_relpath = ?2
-  AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+  AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
 UNION ALL
 SELECT IFNULL((SELECT properties FROM actual_node a
                WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath),
@@ -1021,7 +1034,7 @@ SELECT IFNULL((SELECT properties FROM ac
        local_relpath, depth
 FROM nodes_current n
 WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND kind = 'dir' AND presence IN ('normal', 'incomplete')
+  AND kind = MAP_DIR AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
 
 -- STMT_SELECT_CURRENT_PROPS_RECURSIVE
 /* ### Ugly OR to make sqlite use the proper optimizations */
@@ -1059,16 +1072,12 @@ VALUES (?1, ?2, ?3, ?4)
 
 -- STMT_SELECT_ALL_FILES
 SELECT local_relpath FROM nodes_current
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file'
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = MAP_FILE
 
 -- STMT_UPDATE_NODE_PROPS
 UPDATE nodes SET properties = ?4
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
 
--- STMT_HAS_WORKING_NODES
-SELECT 1 FROM nodes WHERE op_depth > 0
-LIMIT 1
-
 /* --------------------------------------------------------------------------
  * Complex queries for callback walks, caching results in a temporary table.
  *
@@ -1097,13 +1106,13 @@ INSERT INTO target_prop_cache(local_relp
    JOIN nodes_current AS n ON t.wc_id= n.wc_id
                           AND t.local_relpath = n.local_relpath
   WHERE t.wc_id = ?1
-    AND (presence='normal' OR presence='incomplete')
+    AND (presence=MAP_NORMAL OR presence=MAP_INCOMPLETE)
 
 -- STMT_CACHE_TARGET_PRISTINE_PROPS
 INSERT INTO target_prop_cache(local_relpath, kind, properties)
  SELECT n.local_relpath, n.kind,
         CASE n.presence
-          WHEN 'base-deleted'
+          WHEN MAP_BASE_DELETED
           THEN (SELECT properties FROM nodes AS p
                  WHERE p.wc_id = n.wc_id
                    AND p.local_relpath = n.local_relpath
@@ -1114,9 +1123,9 @@ INSERT INTO target_prop_cache(local_relp
   JOIN nodes_current AS n ON t.wc_id= n.wc_id
                           AND t.local_relpath = n.local_relpath
   WHERE t.wc_id = ?1
-    AND (presence = 'normal'
-         OR presence = 'incomplete'
-         OR presence = 'base-deleted')
+    AND (presence = MAP_NORMAL
+         OR presence = MAP_INCOMPLETE
+         OR presence = MAP_BASE_DELETED)
 
 -- STMT_SELECT_ALL_TARGET_PROP_CACHE
 SELECT local_relpath, properties FROM target_prop_cache
@@ -1239,7 +1248,7 @@ WHERE wc_id = ?1
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
+  AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list
@@ -1259,7 +1268,7 @@ SELECT MIN(revision), MAX(revision),
   WHERE wc_id = ?1
     AND (local_relpath = ?2
          OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
-    AND presence IN ('normal', 'incomplete')
+    AND presence IN (MAP_NORMAL, MAP_INCOMPLETE)
     AND file_external IS NULL
     AND op_depth = 0
 
@@ -1269,8 +1278,8 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND (presence IN ('server-excluded', 'excluded')
-        OR depth NOT IN ('infinity', 'unknown'))
+  AND (presence IN (MAP_SERVER_EXCLUDED, MAP_EXCLUDED)
+        OR depth NOT IN (MAP_DEPTH_INFINITY, MAP_DEPTH_UNKNOWN))
   AND file_external IS NULL
 LIMIT 1
 
@@ -1365,8 +1374,8 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND kind='file'
-  AND presence='normal'
+  AND kind=MAP_FILE
+  AND presence=MAP_NORMAL
   AND file_external IS NULL
 
 /* ### FIXME: op-depth?  What about multiple moves? */

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc.h?rev=1421507&r1=1421506&r2=1421507&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc.h Thu Dec 13 20:39:17 2012
@@ -188,6 +188,16 @@ extern "C" {
 /* A version < this has no work queue (see workqueue.h).  */
 #define SVN_WC__HAS_WORK_QUEUE 13
 
+/* Return a string indicating the released version (or versions) of
+ * Subversion that used WC format number WC_FORMAT, or some other
+ * suitable string if no released version used WC_FORMAT.
+ *
+ * ### It's not ideal to encode this sort of knowledge in this low-level
+ * library.  On the other hand, it doesn't need to be updated often and
+ * should be easily found when it does need to be updated.  */
+const char *
+svn_wc__version_string_from_format(int wc_format);
+
 /* Return true iff error E indicates an "is not a working copy" type
    of error, either because something wasn't a working copy at all, or
    because it's a working copy from a previous version (in need of
@@ -378,17 +388,24 @@ svn_wc__internal_file_modified_p(svn_boo
                                  apr_pool_t *scratch_pool);
 
 
-/* Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
-   TARGET_ABSPATH, return the appropriate work queue operations in
-   *WORK_ITEMS.
-
-   Note that, in the case of updating, the update can have sent new
-   properties, which could affect the way the wc target is
-   detranslated and compared with LEFT and RIGHT for merging.
-
-   The merge result is stored in *MERGE_OUTCOME and merge conflicts
-   are marked in MERGE_RESULT using LEFT_LABEL, RIGHT_LABEL and
-   TARGET_LABEL.
+/* Prepare to merge a file content change into the working copy.  This
+   does not merge properties; see svn_wc__merge_props() for that.  This
+   ### [does | does not]
+   change the working file on disk as well as returning work items.
+
+   Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
+   TARGET_ABSPATH.
+
+   Set *WORK_ITEMS to the appropriate work queue operations.
+
+   If there are any conflicts, append a conflict description to
+   *CONFLICT_SKEL.  (First allocate *CONFLICT_SKEL from RESULT_POOL if
+   it is initially NULL.  CONFLICT_SKEL itself must not be NULL.)
+   Also, unless it is considered to be a 'binary' file, mark any
+   conflicts in the text of the file TARGET_ABSPATH using LEFT_LABEL,
+   RIGHT_LABEL and TARGET_LABEL.
+
+   Set *MERGE_OUTCOME to indicate the result.
 
    When DRY_RUN is true, no actual changes are made to the working copy.
 
@@ -402,11 +419,17 @@ svn_wc__internal_file_modified_p(svn_boo
    retrieved. (Interesting for merging file externals).
 
    ACTUAL_PROPS is the set of actual properties before merging; used for
-   detranslating the file before merging.
+   detranslating the file before merging.  This is necessary because, in
+   the case of updating, the update can have sent new properties, so we
+   cannot simply fetch and use the current actual properties.
+
+     ### Is ACTUAL_PROPS still necessary, now that we first prepare the
+         content change and property change and then apply them both to
+         the WC together?
 
    Property changes sent by the update are provided in PROP_DIFF.
 
-   For a complete description, see svn_wc_merge3() for which this is
+   For a complete description, see svn_wc_merge5() for which this is
    the (loggy) implementation.
 
    *WORK_ITEMS will be allocated in RESULT_POOL. All temporary allocations