aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_wc/wc-queries.h
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2015-10-12 08:54:49 +0000
committerPeter Wemm <peter@FreeBSD.org>2015-10-12 08:54:49 +0000
commitdc5d469d6574e9fb03bdd793658bb371315b306a (patch)
tree013c2e6845398e5a9ca4901dcc077769c7520e1d /subversion/libsvn_wc/wc-queries.h
parent58218291fa73a17020ef0447398e9e8a78f9e8c7 (diff)
downloadsrc-dc5d469d6574e9fb03bdd793658bb371315b306a.tar.gz
src-dc5d469d6574e9fb03bdd793658bb371315b306a.zip
Vendor import of subversion-1.9.2vendor/subversion/subversion-1.9.2
Notes
Notes: svn path=/vendor/subversion/dist/; revision=289177 svn path=/vendor/subversion/subversion-1.9.2/; revision=289178; tag=vendor/subversion/subversion-1.9.2
Diffstat (limited to 'subversion/libsvn_wc/wc-queries.h')
-rw-r--r--subversion/libsvn_wc/wc-queries.h1960
1 files changed, 1097 insertions, 863 deletions
diff --git a/subversion/libsvn_wc/wc-queries.h b/subversion/libsvn_wc/wc-queries.h
index 50a1d9770dbf..523a6a169076 100644
--- a/subversion/libsvn_wc/wc-queries.h
+++ b/subversion/libsvn_wc/wc-queries.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.8.14/subversion/libsvn_wc/token-map.h.
+/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.9.2/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_SELECT_NODE_INFO 0
@@ -55,6 +55,15 @@
#define STMT_4_INFO {"STMT_SELECT_BASE_CHILDREN_INFO", NULL}
#define STMT_4 \
"SELECT local_relpath, nodes.repos_id, nodes.repos_path, presence, kind, " \
+ " revision, depth, file_external " \
+ "FROM nodes " \
+ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 " \
+ ""
+
+#define STMT_SELECT_BASE_CHILDREN_INFO_LOCK 5
+#define STMT_5_INFO {"STMT_SELECT_BASE_CHILDREN_INFO_LOCK", NULL}
+#define STMT_5 \
+ "SELECT local_relpath, nodes.repos_id, nodes.repos_path, presence, kind, " \
" revision, depth, file_external, " \
" lock_token, lock_owner, lock_comment, lock_date " \
"FROM nodes " \
@@ -63,9 +72,9 @@
"WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_SELECT_WORKING_NODE 5
-#define STMT_5_INFO {"STMT_SELECT_WORKING_NODE", NULL}
-#define STMT_5 \
+#define STMT_SELECT_WORKING_NODE 6
+#define STMT_6_INFO {"STMT_SELECT_WORKING_NODE", NULL}
+#define STMT_6 \
"SELECT op_depth, presence, kind, checksum, translated_size, " \
" changed_revision, changed_date, changed_author, depth, symlink_target, " \
" repos_id, repos_path, revision, " \
@@ -76,19 +85,19 @@
"LIMIT 1 " \
""
-#define STMT_SELECT_DEPTH_NODE 6
-#define STMT_6_INFO {"STMT_SELECT_DEPTH_NODE", NULL}
-#define STMT_6 \
+#define STMT_SELECT_DEPTH_NODE 7
+#define STMT_7_INFO {"STMT_SELECT_DEPTH_NODE", NULL}
+#define STMT_7 \
"SELECT repos_id, repos_path, presence, kind, revision, checksum, " \
" translated_size, changed_revision, changed_date, changed_author, depth, " \
- " symlink_target, last_mod_time, properties " \
+ " symlink_target, properties, moved_to, moved_here " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_SELECT_LOWEST_WORKING_NODE 7
-#define STMT_7_INFO {"STMT_SELECT_LOWEST_WORKING_NODE", NULL}
-#define STMT_7 \
+#define STMT_SELECT_LOWEST_WORKING_NODE 8
+#define STMT_8_INFO {"STMT_SELECT_LOWEST_WORKING_NODE", NULL}
+#define STMT_8 \
"SELECT op_depth, presence, kind, moved_to " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 " \
@@ -96,9 +105,9 @@
"LIMIT 1 " \
""
-#define STMT_SELECT_HIGHEST_WORKING_NODE 8
-#define STMT_8_INFO {"STMT_SELECT_HIGHEST_WORKING_NODE", NULL}
-#define STMT_8 \
+#define STMT_SELECT_HIGHEST_WORKING_NODE 9
+#define STMT_9_INFO {"STMT_SELECT_HIGHEST_WORKING_NODE", NULL}
+#define STMT_9 \
"SELECT op_depth " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth < ?3 " \
@@ -106,17 +115,17 @@
"LIMIT 1 " \
""
-#define STMT_SELECT_ACTUAL_NODE 9
-#define STMT_9_INFO {"STMT_SELECT_ACTUAL_NODE", NULL}
-#define STMT_9 \
+#define STMT_SELECT_ACTUAL_NODE 10
+#define STMT_10_INFO {"STMT_SELECT_ACTUAL_NODE", NULL}
+#define STMT_10 \
"SELECT changelist, properties, conflict_data " \
"FROM actual_node " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_SELECT_NODE_CHILDREN_INFO 10
-#define STMT_10_INFO {"STMT_SELECT_NODE_CHILDREN_INFO", NULL}
-#define STMT_10 \
+#define STMT_SELECT_NODE_CHILDREN_INFO 11
+#define STMT_11_INFO {"STMT_SELECT_NODE_CHILDREN_INFO", NULL}
+#define STMT_11 \
"SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision, " \
" checksum, translated_size, changed_revision, changed_date, changed_author, " \
" depth, symlink_target, last_mod_time, properties, lock_token, lock_owner, " \
@@ -125,51 +134,67 @@
"LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id " \
" AND nodes.repos_path = lock.repos_relpath AND op_depth = 0 " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
+ "ORDER BY local_relpath DESC, op_depth DESC " \
""
-#define STMT_SELECT_NODE_CHILDREN_WALKER_INFO 11
-#define STMT_11_INFO {"STMT_SELECT_NODE_CHILDREN_WALKER_INFO", NULL}
-#define STMT_11 \
+#define STMT_SELECT_BASE_NODE_CHILDREN_INFO 12
+#define STMT_12_INFO {"STMT_SELECT_BASE_NODE_CHILDREN_INFO", NULL}
+#define STMT_12 \
+ "SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision, " \
+ " checksum, translated_size, changed_revision, changed_date, changed_author, " \
+ " depth, symlink_target, last_mod_time, properties, lock_token, lock_owner, " \
+ " lock_comment, lock_date, local_relpath, moved_here, moved_to, file_external " \
+ "FROM nodes " \
+ "LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id " \
+ " AND nodes.repos_path = lock.repos_relpath AND op_depth = 0 " \
+ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 " \
+ "ORDER BY local_relpath DESC " \
+ ""
+
+#define STMT_SELECT_NODE_CHILDREN_WALKER_INFO 13
+#define STMT_13_INFO {"STMT_SELECT_NODE_CHILDREN_WALKER_INFO", NULL}
+#define STMT_13 \
"SELECT local_relpath, op_depth, presence, kind " \
"FROM nodes_current " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
+ "ORDER BY local_relpath " \
""
-#define STMT_SELECT_ACTUAL_CHILDREN_INFO 12
-#define STMT_12_INFO {"STMT_SELECT_ACTUAL_CHILDREN_INFO", NULL}
-#define STMT_12 \
+#define STMT_SELECT_ACTUAL_CHILDREN_INFO 14
+#define STMT_14_INFO {"STMT_SELECT_ACTUAL_CHILDREN_INFO", NULL}
+#define STMT_14 \
"SELECT local_relpath, changelist, properties, conflict_data " \
"FROM actual_node " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
""
-#define STMT_SELECT_REPOSITORY_BY_ID 13
-#define STMT_13_INFO {"STMT_SELECT_REPOSITORY_BY_ID", NULL}
-#define STMT_13 \
+#define STMT_SELECT_REPOSITORY_BY_ID 15
+#define STMT_15_INFO {"STMT_SELECT_REPOSITORY_BY_ID", NULL}
+#define STMT_15 \
"SELECT root, uuid FROM repository WHERE id = ?1 " \
""
-#define STMT_SELECT_WCROOT_NULL 14
-#define STMT_14_INFO {"STMT_SELECT_WCROOT_NULL", NULL}
-#define STMT_14 \
+#define STMT_SELECT_WCROOT_NULL 16
+#define STMT_16_INFO {"STMT_SELECT_WCROOT_NULL", NULL}
+#define STMT_16 \
"SELECT id FROM wcroot WHERE local_abspath IS NULL " \
""
-#define STMT_SELECT_REPOSITORY 15
-#define STMT_15_INFO {"STMT_SELECT_REPOSITORY", NULL}
-#define STMT_15 \
+#define STMT_SELECT_REPOSITORY 17
+#define STMT_17_INFO {"STMT_SELECT_REPOSITORY", NULL}
+#define STMT_17 \
"SELECT id FROM repository WHERE root = ?1 " \
""
-#define STMT_INSERT_REPOSITORY 16
-#define STMT_16_INFO {"STMT_INSERT_REPOSITORY", NULL}
-#define STMT_16 \
+#define STMT_INSERT_REPOSITORY 18
+#define STMT_18_INFO {"STMT_INSERT_REPOSITORY", NULL}
+#define STMT_18 \
"INSERT INTO repository (root, uuid) VALUES (?1, ?2) " \
""
-#define STMT_INSERT_NODE 17
-#define STMT_17_INFO {"STMT_INSERT_NODE", NULL}
-#define STMT_17 \
+#define STMT_INSERT_NODE 19
+#define STMT_19_INFO {"STMT_INSERT_NODE", NULL}
+#define STMT_19 \
"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, " \
@@ -180,22 +205,9 @@
" ?15, ?16, ?17, ?18, ?19, ?20, ?21, ?22, ?23) " \
""
-#define STMT_SELECT_BASE_PRESENT 18
-#define STMT_18_INFO {"STMT_SELECT_BASE_PRESENT", NULL}
-#define STMT_18 \
- "SELECT local_relpath, kind FROM nodes n " \
- "WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth = 0 " \
- " AND presence in ('normal', '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) " \
- "ORDER BY local_relpath DESC " \
- ""
-
-#define STMT_SELECT_WORKING_PRESENT 19
-#define STMT_19_INFO {"STMT_SELECT_WORKING_PRESENT", NULL}
-#define STMT_19 \
+#define STMT_SELECT_WORKING_PRESENT 20
+#define STMT_20_INFO {"STMT_SELECT_WORKING_PRESENT", NULL}
+#define STMT_20 \
"SELECT local_relpath, kind, checksum, translated_size, last_mod_time " \
"FROM nodes n " \
"WHERE wc_id = ?1 " \
@@ -208,25 +220,25 @@
"ORDER BY local_relpath DESC " \
""
-#define STMT_DELETE_NODE_RECURSIVE 20
-#define STMT_20_INFO {"STMT_DELETE_NODE_RECURSIVE", NULL}
-#define STMT_20 \
+#define STMT_DELETE_NODE_RECURSIVE 21
+#define STMT_21_INFO {"STMT_DELETE_NODE_RECURSIVE", NULL}
+#define STMT_21 \
"DELETE FROM NODES " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_DELETE_NODE 21
-#define STMT_21_INFO {"STMT_DELETE_NODE", NULL}
-#define STMT_21 \
+#define STMT_DELETE_NODE 22
+#define STMT_22_INFO {"STMT_DELETE_NODE", NULL}
+#define STMT_22 \
"DELETE " \
"FROM NODES " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE 22
-#define STMT_22_INFO {"STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE", NULL}
-#define STMT_22 \
+#define STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE 23
+#define STMT_23_INFO {"STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE", NULL}
+#define STMT_23 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND EXISTS(SELECT 1 FROM NODES b " \
@@ -240,113 +252,161 @@
" AND presence in ('normal', 'incomplete', 'not-present')) " \
""
-#define STMT_DELETE_WORKING_BASE_DELETE 23
-#define STMT_23_INFO {"STMT_DELETE_WORKING_BASE_DELETE", NULL}
-#define STMT_23 \
+#define STMT_DELETE_WORKING_BASE_DELETE 24
+#define STMT_24_INFO {"STMT_DELETE_WORKING_BASE_DELETE", NULL}
+#define STMT_24 \
"DELETE FROM nodes " \
- "WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ "WHERE wc_id = ?1 AND local_relpath = ?2 " \
" AND presence = 'base-deleted' " \
- " AND op_depth > 0 " \
+ " AND op_depth > ?3 " \
" AND op_depth = (SELECT MIN(op_depth) FROM nodes n " \
" WHERE n.wc_id = ?1 " \
" AND n.local_relpath = nodes.local_relpath " \
- " AND op_depth > 0) " \
+ " AND op_depth > ?3) " \
""
-#define STMT_DELETE_WORKING_RECURSIVE 24
-#define STMT_24_INFO {"STMT_DELETE_WORKING_RECURSIVE", NULL}
-#define STMT_24 \
- "DELETE FROM nodes " \
- "WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth > 0 " \
- ""
-
-#define STMT_DELETE_BASE_RECURSIVE 25
-#define STMT_25_INFO {"STMT_DELETE_BASE_RECURSIVE", NULL}
+#define STMT_DELETE_WORKING_BASE_DELETE_RECURSIVE 25
+#define STMT_25_INFO {"STMT_DELETE_WORKING_BASE_DELETE_RECURSIVE", NULL}
#define STMT_25 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth = 0 " \
+ " AND presence = 'base-deleted' " \
+ " AND op_depth > ?3 " \
+ " AND op_depth = (SELECT MIN(op_depth) FROM nodes n " \
+ " WHERE n.wc_id = ?1 " \
+ " AND n.local_relpath = nodes.local_relpath " \
+ " AND op_depth > ?3) " \
""
-#define STMT_DELETE_WORKING_OP_DEPTH 26
-#define STMT_26_INFO {"STMT_DELETE_WORKING_OP_DEPTH", NULL}
+#define STMT_DELETE_WORKING_RECURSIVE 26
+#define STMT_26_INFO {"STMT_DELETE_WORKING_RECURSIVE", NULL}
#define STMT_26 \
"DELETE FROM nodes " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth = ?3 " \
+ "WHERE wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ " AND op_depth > 0 " \
""
-#define STMT_DELETE_WORKING_OP_DEPTH_ABOVE 27
-#define STMT_27_INFO {"STMT_DELETE_WORKING_OP_DEPTH_ABOVE", NULL}
+#define STMT_DELETE_BASE_RECURSIVE 27
+#define STMT_27_INFO {"STMT_DELETE_BASE_RECURSIVE", NULL}
#define STMT_27 \
"DELETE FROM nodes " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth > ?3 " \
+ "WHERE wc_id = ?1 AND (local_relpath = ?2 " \
+ " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND op_depth = 0 " \
""
-#define STMT_SELECT_LOCAL_RELPATH_OP_DEPTH 28
-#define STMT_28_INFO {"STMT_SELECT_LOCAL_RELPATH_OP_DEPTH", NULL}
+#define STMT_DELETE_WORKING_OP_DEPTH 28
+#define STMT_28_INFO {"STMT_DELETE_WORKING_OP_DEPTH", NULL}
#define STMT_28 \
- "SELECT local_relpath " \
- "FROM nodes " \
+ "DELETE FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
" AND op_depth = ?3 " \
""
-#define STMT_SELECT_CHILDREN_OP_DEPTH 29
-#define STMT_29_INFO {"STMT_SELECT_CHILDREN_OP_DEPTH", NULL}
+#define STMT_SELECT_LAYER_FOR_REPLACE 29
+#define STMT_29_INFO {"STMT_SELECT_LAYER_FOR_REPLACE", NULL}
#define STMT_29 \
+ "SELECT s.local_relpath, s.kind, " \
+ " (CASE WHEN (?2) = '' THEN (CASE WHEN (?4) = '' THEN (s.local_relpath) WHEN (s.local_relpath) = '' THEN (?4) ELSE (?4) || '/' || (s.local_relpath) END) WHEN (?4) = '' THEN (CASE WHEN (?2) = '' THEN (s.local_relpath) WHEN SUBSTR((s.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(s.local_relpath) THEN '' WHEN SUBSTR((s.local_relpath), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((s.local_relpath), LENGTH(?2)+2) END END) WHEN SUBSTR((s.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(s.local_relpath) THEN (?4) WHEN SUBSTR((s.local_relpath), LENGTH(?2)+1, 1) = '/' THEN (?4) || SUBSTR((s.local_relpath), LENGTH(?2)+1) END END) 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, " \
+ " (CASE WHEN (?2) = '' THEN (CASE WHEN (?4) = '' THEN (s.local_relpath) WHEN (s.local_relpath) = '' THEN (?4) ELSE (?4) || '/' || (s.local_relpath) END) WHEN (?4) = '' THEN (CASE WHEN (?2) = '' THEN (s.local_relpath) WHEN SUBSTR((s.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(s.local_relpath) THEN '' WHEN SUBSTR((s.local_relpath), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((s.local_relpath), LENGTH(?2)+2) END END) WHEN SUBSTR((s.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(s.local_relpath) THEN (?4) WHEN SUBSTR((s.local_relpath), LENGTH(?2)+1, 1) = '/' THEN (?4) || SUBSTR((s.local_relpath), LENGTH(?2)+1) END END) 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 " \
+ "WHERE s.wc_id = ?1 " \
+ " AND (((s.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((s.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ " AND s.op_depth = ?3 " \
+ "ORDER BY s.local_relpath " \
+ ""
+
+#define STMT_SELECT_DESCENDANTS_OP_DEPTH_RV 30
+#define STMT_30_INFO {"STMT_SELECT_DESCENDANTS_OP_DEPTH_RV", NULL}
+#define STMT_30 \
"SELECT local_relpath, kind " \
"FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND op_depth = ?3 " \
+ " AND presence in ('normal', 'incomplete') " \
"ORDER BY local_relpath DESC " \
""
-#define STMT_COPY_NODE_MOVE 30
-#define STMT_30_INFO {"STMT_COPY_NODE_MOVE", NULL}
-#define STMT_30 \
+#define STMT_COPY_NODE_MOVE 31
+#define STMT_31_INFO {"STMT_COPY_NODE_MOVE", NULL}
+#define STMT_31 \
"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, moved_to ) " \
"SELECT " \
- " wc_id, ?4 , ?5 , ?6 , " \
- " repos_id, " \
- " repos_path, revision, presence, depth, kind, changed_revision, " \
- " changed_date, changed_author, checksum, properties, translated_size, " \
- " last_mod_time, symlink_target, 1, " \
- " (SELECT dst.moved_to FROM nodes AS dst " \
- " WHERE dst.wc_id = ?1 " \
- " AND dst.local_relpath = ?4 " \
- " AND dst.op_depth = ?5) " \
- "FROM nodes " \
- "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
- ""
-
-#define STMT_SELECT_OP_DEPTH_CHILDREN 31
-#define STMT_31_INFO {"STMT_SELECT_OP_DEPTH_CHILDREN", NULL}
-#define STMT_31 \
+ " s.wc_id, ?4 , ?5 , ?6 , " \
+ " s.repos_id, " \
+ " s.repos_path, s.revision, s.presence, s.depth, s.kind, s.changed_revision, " \
+ " s.changed_date, s.changed_author, s.checksum, s.properties, " \
+ " CASE WHEN d.checksum=s.checksum THEN d.translated_size END, " \
+ " CASE WHEN d.checksum=s.checksum THEN d.last_mod_time END, " \
+ " s.symlink_target, 1, d.moved_to " \
+ "FROM nodes s " \
+ "LEFT JOIN nodes d ON d.wc_id=?1 AND d.local_relpath=?4 AND d.op_depth=?5 " \
+ "WHERE s.wc_id = ?1 AND s.local_relpath = ?2 AND s.op_depth = ?3 " \
+ ""
+
+#define STMT_SELECT_NO_LONGER_MOVED_RV 32
+#define STMT_32_INFO {"STMT_SELECT_NO_LONGER_MOVED_RV", NULL}
+#define STMT_32 \
+ "SELECT d.local_relpath, (CASE WHEN (?2) = '' THEN (CASE WHEN (?4) = '' THEN (d.local_relpath) WHEN (d.local_relpath) = '' THEN (?4) ELSE (?4) || '/' || (d.local_relpath) END) WHEN (?4) = '' THEN (CASE WHEN (?2) = '' THEN (d.local_relpath) WHEN SUBSTR((d.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(d.local_relpath) THEN '' WHEN SUBSTR((d.local_relpath), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((d.local_relpath), LENGTH(?2)+2) END END) WHEN SUBSTR((d.local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(d.local_relpath) THEN (?4) WHEN SUBSTR((d.local_relpath), LENGTH(?2)+1, 1) = '/' THEN (?4) || SUBSTR((d.local_relpath), LENGTH(?2)+1) END END) srp, " \
+ " b.presence, b.op_depth " \
+ "FROM nodes d " \
+ "LEFT OUTER JOIN nodes b ON b.wc_id = ?1 AND b.local_relpath = d.local_relpath " \
+ " AND b.op_depth = (SELECT MAX(x.op_depth) FROM nodes x " \
+ " WHERE x.wc_id = ?1 " \
+ " AND x.local_relpath = b.local_relpath " \
+ " AND x.op_depth < ?3) " \
+ "WHERE d.wc_id = ?1 " \
+ " AND (((d.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((d.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ " AND d.op_depth = ?3 " \
+ " AND NOT EXISTS(SELECT * FROM nodes s " \
+ " WHERE s.wc_id = ?1 " \
+ " AND s.local_relpath = srp " \
+ " AND s.op_depth = ?5) " \
+ "ORDER BY d.local_relpath DESC " \
+ ""
+
+#define STMT_SELECT_OP_DEPTH_CHILDREN 33
+#define STMT_33_INFO {"STMT_SELECT_OP_DEPTH_CHILDREN", NULL}
+#define STMT_33 \
"SELECT local_relpath, kind FROM nodes " \
"WHERE wc_id = ?1 " \
" AND parent_relpath = ?2 " \
" AND op_depth = ?3 " \
" AND presence != 'base-deleted' " \
" AND file_external is NULL " \
+ "ORDER BY local_relpath " \
""
-#define STMT_SELECT_GE_OP_DEPTH_CHILDREN 32
-#define STMT_32_INFO {"STMT_SELECT_GE_OP_DEPTH_CHILDREN", NULL}
-#define STMT_32 \
+#define STMT_SELECT_OP_DEPTH_CHILDREN_EXISTS 34
+#define STMT_34_INFO {"STMT_SELECT_OP_DEPTH_CHILDREN_EXISTS", NULL}
+#define STMT_34 \
+ "SELECT local_relpath, kind FROM nodes " \
+ "WHERE wc_id = ?1 " \
+ " AND parent_relpath = ?2 " \
+ " AND op_depth = ?3 " \
+ " AND presence IN ('normal', 'incomplete') " \
+ "ORDER BY local_relpath " \
+ ""
+
+#define STMT_SELECT_GE_OP_DEPTH_CHILDREN 35
+#define STMT_35_INFO {"STMT_SELECT_GE_OP_DEPTH_CHILDREN", NULL}
+#define STMT_35 \
"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 IN ('normal', 'incomplete'))) " \
"UNION ALL " \
"SELECT 1 FROM ACTUAL_NODE a " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
@@ -354,9 +414,9 @@
" WHERE wc_id = ?1 AND n.local_relpath = a.local_relpath) " \
""
-#define STMT_DELETE_SHADOWED_RECURSIVE 33
-#define STMT_33_INFO {"STMT_DELETE_SHADOWED_RECURSIVE", NULL}
-#define STMT_33 \
+#define STMT_DELETE_SHADOWED_RECURSIVE 36
+#define STMT_36_INFO {"STMT_DELETE_SHADOWED_RECURSIVE", NULL}
+#define STMT_36 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -364,32 +424,33 @@
" OR (op_depth = ?3 AND presence = 'base-deleted')) " \
""
-#define STMT_CLEAR_MOVED_TO_FROM_DEST 34
-#define STMT_34_INFO {"STMT_CLEAR_MOVED_TO_FROM_DEST", NULL}
-#define STMT_34 \
+#define STMT_CLEAR_MOVED_TO_FROM_DEST 37
+#define STMT_37_INFO {"STMT_CLEAR_MOVED_TO_FROM_DEST", NULL}
+#define STMT_37 \
"UPDATE NODES SET moved_to = NULL " \
"WHERE wc_id = ?1 " \
" AND moved_to = ?2 " \
""
-#define STMT_SELECT_NOT_PRESENT_DESCENDANTS 35
-#define STMT_35_INFO {"STMT_SELECT_NOT_PRESENT_DESCENDANTS", NULL}
-#define STMT_35 \
+#define STMT_SELECT_NOT_PRESENT_DESCENDANTS 38
+#define STMT_38_INFO {"STMT_SELECT_NOT_PRESENT_DESCENDANTS", NULL}
+#define STMT_38 \
"SELECT local_relpath FROM nodes " \
"WHERE wc_id = ?1 AND op_depth = ?3 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND presence = 'not-present' " \
""
-#define STMT_COMMIT_DESCENDANTS_TO_BASE 36
-#define STMT_36_INFO {"STMT_COMMIT_DESCENDANTS_TO_BASE", NULL}
-#define STMT_36 \
+#define STMT_COMMIT_DESCENDANTS_TO_BASE 39
+#define STMT_39_INFO {"STMT_COMMIT_DESCENDANTS_TO_BASE", NULL}
+#define STMT_39 \
"UPDATE NODES SET op_depth = 0, " \
" repos_id = ?4, " \
- " repos_path = ?5 || SUBSTR(local_relpath, LENGTH(?2)+1), " \
+ " repos_path = (CASE WHEN (?2) = '' THEN (CASE WHEN (?5) = '' THEN (local_relpath) WHEN (local_relpath) = '' THEN (?5) ELSE (?5) || '/' || (local_relpath) END) WHEN (?5) = '' THEN (CASE WHEN (?2) = '' THEN (local_relpath) WHEN SUBSTR((local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(local_relpath) THEN '' WHEN SUBSTR((local_relpath), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((local_relpath), LENGTH(?2)+2) END END) WHEN SUBSTR((local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(local_relpath) THEN (?5) WHEN SUBSTR((local_relpath), LENGTH(?2)+1, 1) = '/' THEN (?5) || SUBSTR((local_relpath), LENGTH(?2)+1) END END), " \
" revision = ?6, " \
" dav_cache = NULL, " \
" moved_here = NULL, " \
+ " moved_to = NULL, " \
" presence = CASE presence " \
" WHEN 'normal' THEN 'normal' " \
" WHEN 'excluded' THEN 'excluded' " \
@@ -400,67 +461,78 @@
" AND op_depth = ?3 " \
""
-#define STMT_SELECT_NODE_CHILDREN 37
-#define STMT_37_INFO {"STMT_SELECT_NODE_CHILDREN", NULL}
-#define STMT_37 \
- "SELECT local_relpath FROM nodes " \
+#define STMT_SELECT_NODE_CHILDREN 40
+#define STMT_40_INFO {"STMT_SELECT_NODE_CHILDREN", NULL}
+#define STMT_40 \
+ "SELECT DISTINCT local_relpath FROM nodes " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
+ "ORDER BY local_relpath " \
""
-#define STMT_SELECT_WORKING_CHILDREN 38
-#define STMT_38_INFO {"STMT_SELECT_WORKING_CHILDREN", NULL}
-#define STMT_38 \
- "SELECT local_relpath FROM nodes " \
+#define STMT_SELECT_WORKING_CHILDREN 41
+#define STMT_41_INFO {"STMT_SELECT_WORKING_CHILDREN", NULL}
+#define STMT_41 \
+ "SELECT DISTINCT local_relpath FROM nodes " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
" AND (op_depth > (SELECT MAX(op_depth) FROM nodes " \
" WHERE wc_id = ?1 AND local_relpath = ?2) " \
" OR " \
" (op_depth = (SELECT MAX(op_depth) FROM nodes " \
" WHERE wc_id = ?1 AND local_relpath = ?2) " \
- " AND presence != 'base-deleted')) " \
+ " AND presence IN ('normal', 'incomplete'))) " \
+ "ORDER BY local_relpath " \
""
-#define STMT_SELECT_NODE_PROPS 39
-#define STMT_39_INFO {"STMT_SELECT_NODE_PROPS", NULL}
-#define STMT_39 \
+#define STMT_SELECT_BASE_NOT_PRESENT_CHILDREN 42
+#define STMT_42_INFO {"STMT_SELECT_BASE_NOT_PRESENT_CHILDREN", NULL}
+#define STMT_42 \
+ "SELECT local_relpath FROM nodes " \
+ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 " \
+ " AND presence = 'not-present' " \
+ "ORDER BY local_relpath " \
+ ""
+
+#define STMT_SELECT_NODE_PROPS 43
+#define STMT_43_INFO {"STMT_SELECT_NODE_PROPS", NULL}
+#define STMT_43 \
"SELECT properties, presence FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
"ORDER BY op_depth DESC " \
""
-#define STMT_SELECT_ACTUAL_PROPS 40
-#define STMT_40_INFO {"STMT_SELECT_ACTUAL_PROPS", NULL}
-#define STMT_40 \
+#define STMT_SELECT_ACTUAL_PROPS 44
+#define STMT_44_INFO {"STMT_SELECT_ACTUAL_PROPS", NULL}
+#define STMT_44 \
"SELECT properties FROM actual_node " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_UPDATE_ACTUAL_PROPS 41
-#define STMT_41_INFO {"STMT_UPDATE_ACTUAL_PROPS", NULL}
-#define STMT_41 \
+#define STMT_UPDATE_ACTUAL_PROPS 45
+#define STMT_45_INFO {"STMT_UPDATE_ACTUAL_PROPS", NULL}
+#define STMT_45 \
"UPDATE actual_node SET properties = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_INSERT_ACTUAL_PROPS 42
-#define STMT_42_INFO {"STMT_INSERT_ACTUAL_PROPS", NULL}
-#define STMT_42 \
+#define STMT_INSERT_ACTUAL_PROPS 46
+#define STMT_46_INFO {"STMT_INSERT_ACTUAL_PROPS", NULL}
+#define STMT_46 \
"INSERT INTO actual_node (wc_id, local_relpath, parent_relpath, properties) " \
"VALUES (?1, ?2, ?3, ?4) " \
""
-#define STMT_INSERT_LOCK 43
-#define STMT_43_INFO {"STMT_INSERT_LOCK", NULL}
-#define STMT_43 \
+#define STMT_INSERT_LOCK 47
+#define STMT_47_INFO {"STMT_INSERT_LOCK", NULL}
+#define STMT_47 \
"INSERT OR REPLACE INTO lock " \
"(repos_id, repos_relpath, lock_token, lock_owner, lock_comment, " \
" lock_date) " \
"VALUES (?1, ?2, ?3, ?4, ?5, ?6) " \
""
-#define STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE 44
-#define STMT_44_INFO {"STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE", NULL}
-#define STMT_44 \
+#define STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE 48
+#define STMT_48_INFO {"STMT_SELECT_BASE_NODE_LOCK_TOKENS_RECURSIVE", NULL}
+#define STMT_48 \
"SELECT nodes.repos_id, nodes.repos_path, lock_token " \
"FROM nodes " \
"LEFT JOIN lock ON nodes.repos_id = lock.repos_id " \
@@ -469,93 +541,73 @@
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_INSERT_WCROOT 45
-#define STMT_45_INFO {"STMT_INSERT_WCROOT", NULL}
-#define STMT_45 \
+#define STMT_INSERT_WCROOT 49
+#define STMT_49_INFO {"STMT_INSERT_WCROOT", NULL}
+#define STMT_49 \
"INSERT INTO wcroot (local_abspath) " \
"VALUES (?1) " \
""
-#define STMT_UPDATE_BASE_NODE_DAV_CACHE 46
-#define STMT_46_INFO {"STMT_UPDATE_BASE_NODE_DAV_CACHE", NULL}
-#define STMT_46 \
+#define STMT_UPDATE_BASE_NODE_DAV_CACHE 50
+#define STMT_50_INFO {"STMT_UPDATE_BASE_NODE_DAV_CACHE", NULL}
+#define STMT_50 \
"UPDATE nodes SET dav_cache = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_SELECT_BASE_DAV_CACHE 47
-#define STMT_47_INFO {"STMT_SELECT_BASE_DAV_CACHE", NULL}
-#define STMT_47 \
+#define STMT_SELECT_BASE_DAV_CACHE 51
+#define STMT_51_INFO {"STMT_SELECT_BASE_DAV_CACHE", NULL}
+#define STMT_51 \
"SELECT dav_cache FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_SELECT_DELETION_INFO 48
-#define STMT_48_INFO {"STMT_SELECT_DELETION_INFO", NULL}
-#define STMT_48 \
- "SELECT (SELECT b.presence FROM nodes AS b " \
- " WHERE b.wc_id = ?1 AND b.local_relpath = ?2 AND b.op_depth = 0), " \
- " work.presence, work.op_depth " \
- "FROM nodes_current AS work " \
- "WHERE work.wc_id = ?1 AND work.local_relpath = ?2 AND work.op_depth > 0 " \
- "LIMIT 1 " \
- ""
-
-#define STMT_SELECT_DELETION_INFO_SCAN 49
-#define STMT_49_INFO {"STMT_SELECT_DELETION_INFO_SCAN", NULL}
-#define STMT_49 \
- "SELECT (SELECT b.presence FROM nodes AS b " \
- " WHERE b.wc_id = ?1 AND b.local_relpath = ?2 AND b.op_depth = 0), " \
- " work.presence, work.op_depth, moved.moved_to " \
- "FROM nodes_current AS work " \
- "LEFT OUTER JOIN nodes AS moved " \
- " ON moved.wc_id = work.wc_id " \
- " AND moved.local_relpath = work.local_relpath " \
- " AND moved.moved_to IS NOT NULL " \
- "WHERE work.wc_id = ?1 AND work.local_relpath = ?2 AND work.op_depth > 0 " \
+#define STMT_SELECT_DELETION_INFO 52
+#define STMT_52_INFO {"STMT_SELECT_DELETION_INFO", NULL}
+#define STMT_52 \
+ "SELECT b.presence, w.presence, w.op_depth, w.moved_to " \
+ "FROM nodes w " \
+ "LEFT JOIN nodes b ON b.wc_id = ?1 AND b.local_relpath = ?2 AND b.op_depth = 0 " \
+ "WHERE w.wc_id = ?1 AND w.local_relpath = ?2 " \
+ " AND w.op_depth = (SELECT MAX(op_depth) FROM nodes d " \
+ " WHERE d.wc_id = ?1 AND d.local_relpath = ?2 " \
+ " AND d.op_depth > 0) " \
"LIMIT 1 " \
""
-#define STMT_SELECT_MOVED_TO_NODE 50
-#define STMT_50_INFO {"STMT_SELECT_MOVED_TO_NODE", NULL}
-#define STMT_50 \
+#define STMT_SELECT_MOVED_TO_NODE 53
+#define STMT_53_INFO {"STMT_SELECT_MOVED_TO_NODE", NULL}
+#define STMT_53 \
"SELECT op_depth, moved_to " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND moved_to IS NOT NULL " \
"ORDER BY op_depth DESC " \
""
-#define STMT_SELECT_OP_DEPTH_MOVED_TO 51
-#define STMT_51_INFO {"STMT_SELECT_OP_DEPTH_MOVED_TO", NULL}
-#define STMT_51 \
- "SELECT op_depth, moved_to, repos_path, revision " \
+#define STMT_SELECT_OP_DEPTH_MOVED_TO 54
+#define STMT_54_INFO {"STMT_SELECT_OP_DEPTH_MOVED_TO", NULL}
+#define STMT_54 \
+ "SELECT op_depth, moved_to " \
"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 > ?3) " \
- "ORDER BY op_depth DESC " \
+ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 " \
+ " AND EXISTS(SELECT * from nodes " \
+ " WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
+ " AND presence IN ('normal', 'incomplete')) " \
+ "ORDER BY op_depth ASC " \
+ "LIMIT 1 " \
""
-#define STMT_SELECT_MOVED_TO 52
-#define STMT_52_INFO {"STMT_SELECT_MOVED_TO", NULL}
-#define STMT_52 \
+#define STMT_SELECT_MOVED_TO 55
+#define STMT_55_INFO {"STMT_SELECT_MOVED_TO", NULL}
+#define STMT_55 \
"SELECT moved_to " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_SELECT_MOVED_HERE 53
-#define STMT_53_INFO {"STMT_SELECT_MOVED_HERE", NULL}
-#define STMT_53 \
- "SELECT moved_here, presence, repos_path, revision " \
- "FROM nodes " \
- "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth >= ?3 " \
- "ORDER BY op_depth " \
- ""
-
-#define STMT_SELECT_MOVED_BACK 54
-#define STMT_54_INFO {"STMT_SELECT_MOVED_BACK", NULL}
-#define STMT_54 \
+#define STMT_SELECT_MOVED_BACK 56
+#define STMT_56_INFO {"STMT_SELECT_MOVED_BACK", NULL}
+#define STMT_56 \
"SELECT u.local_relpath, " \
" u.presence, u.repos_id, u.repos_path, u.revision, " \
" l.presence, l.repos_id, l.repos_path, l.revision, " \
@@ -581,81 +633,71 @@
" AND u.op_depth = ?4 " \
""
-#define STMT_DELETE_MOVED_BACK 55
-#define STMT_55_INFO {"STMT_DELETE_MOVED_BACK", NULL}
-#define STMT_55 \
- "DELETE FROM nodes " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 " \
- " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth = ?3 " \
- ""
-
-#define STMT_DELETE_LOCK 56
-#define STMT_56_INFO {"STMT_DELETE_LOCK", NULL}
-#define STMT_56 \
+#define STMT_DELETE_LOCK 57
+#define STMT_57_INFO {"STMT_DELETE_LOCK", NULL}
+#define STMT_57 \
"DELETE FROM lock " \
"WHERE repos_id = ?1 AND repos_relpath = ?2 " \
""
-#define STMT_DELETE_LOCK_RECURSIVELY 57
-#define STMT_57_INFO {"STMT_DELETE_LOCK_RECURSIVELY", NULL}
-#define STMT_57 \
+#define STMT_DELETE_LOCK_RECURSIVELY 58
+#define STMT_58_INFO {"STMT_DELETE_LOCK_RECURSIVELY", NULL}
+#define STMT_58 \
"DELETE FROM lock " \
"WHERE repos_id = ?1 AND (repos_relpath = ?2 OR (((repos_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((repos_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE 58
-#define STMT_58_INFO {"STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE", NULL}
-#define STMT_58 \
+#define STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE 59
+#define STMT_59_INFO {"STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE", NULL}
+#define STMT_59 \
"UPDATE nodes SET dav_cache = NULL " \
"WHERE dav_cache IS NOT NULL AND wc_id = ?1 AND op_depth = 0 " \
" AND (local_relpath = ?2 " \
" OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_RECURSIVE_UPDATE_NODE_REPO 59
-#define STMT_59_INFO {"STMT_RECURSIVE_UPDATE_NODE_REPO", NULL}
-#define STMT_59 \
+#define STMT_RECURSIVE_UPDATE_NODE_REPO 60
+#define STMT_60_INFO {"STMT_RECURSIVE_UPDATE_NODE_REPO", NULL}
+#define STMT_60 \
"UPDATE nodes SET repos_id = ?4, dav_cache = NULL " \
"WHERE (wc_id = ?1 AND local_relpath = ?2 AND repos_id = ?3) " \
" OR (wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND repos_id = ?3) " \
""
-#define STMT_UPDATE_LOCK_REPOS_ID 60
-#define STMT_60_INFO {"STMT_UPDATE_LOCK_REPOS_ID", NULL}
-#define STMT_60 \
+#define STMT_UPDATE_LOCK_REPOS_ID 61
+#define STMT_61_INFO {"STMT_UPDATE_LOCK_REPOS_ID", NULL}
+#define STMT_61 \
"UPDATE lock SET repos_id = ?2 " \
"WHERE repos_id = ?1 " \
""
-#define STMT_UPDATE_NODE_FILEINFO 61
-#define STMT_61_INFO {"STMT_UPDATE_NODE_FILEINFO", NULL}
-#define STMT_61 \
+#define STMT_UPDATE_NODE_FILEINFO 62
+#define STMT_62_INFO {"STMT_UPDATE_NODE_FILEINFO", NULL}
+#define STMT_62 \
"UPDATE nodes SET translated_size = ?3, last_mod_time = ?4 " \
"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) " \
""
-#define STMT_INSERT_ACTUAL_CONFLICT 62
-#define STMT_62_INFO {"STMT_INSERT_ACTUAL_CONFLICT", NULL}
-#define STMT_62 \
+#define STMT_INSERT_ACTUAL_CONFLICT 63
+#define STMT_63_INFO {"STMT_INSERT_ACTUAL_CONFLICT", NULL}
+#define STMT_63 \
"INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath) " \
"VALUES (?1, ?2, ?3, ?4) " \
""
-#define STMT_UPDATE_ACTUAL_CONFLICT 63
-#define STMT_63_INFO {"STMT_UPDATE_ACTUAL_CONFLICT", NULL}
-#define STMT_63 \
+#define STMT_UPDATE_ACTUAL_CONFLICT 64
+#define STMT_64_INFO {"STMT_UPDATE_ACTUAL_CONFLICT", NULL}
+#define STMT_64 \
"UPDATE actual_node SET conflict_data = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_UPDATE_ACTUAL_CHANGELISTS 64
-#define STMT_64_INFO {"STMT_UPDATE_ACTUAL_CHANGELISTS", NULL}
-#define STMT_64 \
+#define STMT_UPDATE_ACTUAL_CHANGELISTS 65
+#define STMT_65_INFO {"STMT_UPDATE_ACTUAL_CHANGELISTS", NULL}
+#define STMT_65 \
"UPDATE actual_node SET changelist = ?3 " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
@@ -665,16 +707,16 @@
" AND kind = 'file') " \
""
-#define STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST 65
-#define STMT_65_INFO {"STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST", NULL}
-#define STMT_65 \
+#define STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST 66
+#define STMT_66_INFO {"STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST", NULL}
+#define STMT_66 \
"UPDATE actual_node SET changelist = NULL " \
" WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_MARK_SKIPPED_CHANGELIST_DIRS 66
-#define STMT_66_INFO {"STMT_MARK_SKIPPED_CHANGELIST_DIRS", NULL}
-#define STMT_66 \
+#define STMT_MARK_SKIPPED_CHANGELIST_DIRS 67
+#define STMT_67_INFO {"STMT_MARK_SKIPPED_CHANGELIST_DIRS", NULL}
+#define STMT_67 \
"INSERT INTO changelist_list (wc_id, local_relpath, notify, changelist) " \
"SELECT wc_id, local_relpath, 7, ?3 " \
"FROM targets_list " \
@@ -683,17 +725,17 @@
" AND kind = 'dir' " \
""
-#define STMT_RESET_ACTUAL_WITH_CHANGELIST 67
-#define STMT_67_INFO {"STMT_RESET_ACTUAL_WITH_CHANGELIST", NULL}
-#define STMT_67 \
+#define STMT_RESET_ACTUAL_WITH_CHANGELIST 68
+#define STMT_68_INFO {"STMT_RESET_ACTUAL_WITH_CHANGELIST", NULL}
+#define STMT_68 \
"REPLACE INTO actual_node ( " \
" wc_id, local_relpath, parent_relpath, changelist) " \
"VALUES (?1, ?2, ?3, ?4) " \
""
-#define STMT_CREATE_CHANGELIST_LIST 68
-#define STMT_68_INFO {"STMT_CREATE_CHANGELIST_LIST", NULL}
-#define STMT_68 \
+#define STMT_CREATE_CHANGELIST_LIST 69
+#define STMT_69_INFO {"STMT_CREATE_CHANGELIST_LIST", NULL}
+#define STMT_69 \
"DROP TABLE IF EXISTS changelist_list; " \
"CREATE TEMPORARY TABLE changelist_list ( " \
" wc_id INTEGER NOT NULL, " \
@@ -704,9 +746,9 @@
") " \
""
-#define STMT_CREATE_CHANGELIST_TRIGGER 69
-#define STMT_69_INFO {"STMT_CREATE_CHANGELIST_TRIGGER", NULL}
-#define STMT_69 \
+#define STMT_CREATE_CHANGELIST_TRIGGER 70
+#define STMT_70_INFO {"STMT_CREATE_CHANGELIST_TRIGGER", NULL}
+#define STMT_70 \
"DROP TRIGGER IF EXISTS trigger_changelist_list_change; " \
"CREATE TEMPORARY TRIGGER trigger_changelist_list_change " \
"BEFORE UPDATE ON actual_node " \
@@ -721,25 +763,25 @@
"END " \
""
-#define STMT_FINALIZE_CHANGELIST 70
-#define STMT_70_INFO {"STMT_FINALIZE_CHANGELIST", NULL}
-#define STMT_70 \
+#define STMT_FINALIZE_CHANGELIST 71
+#define STMT_71_INFO {"STMT_FINALIZE_CHANGELIST", NULL}
+#define STMT_71 \
"DROP TRIGGER trigger_changelist_list_change; " \
"DROP TABLE changelist_list; " \
"DROP TABLE targets_list " \
""
-#define STMT_SELECT_CHANGELIST_LIST 71
-#define STMT_71_INFO {"STMT_SELECT_CHANGELIST_LIST", NULL}
-#define STMT_71 \
+#define STMT_SELECT_CHANGELIST_LIST 72
+#define STMT_72_INFO {"STMT_SELECT_CHANGELIST_LIST", NULL}
+#define STMT_72 \
"SELECT wc_id, local_relpath, notify, changelist " \
"FROM changelist_list " \
"ORDER BY wc_id, local_relpath ASC, notify DESC " \
""
-#define STMT_CREATE_TARGETS_LIST 72
-#define STMT_72_INFO {"STMT_CREATE_TARGETS_LIST", NULL}
-#define STMT_72 \
+#define STMT_CREATE_TARGETS_LIST 73
+#define STMT_73_INFO {"STMT_CREATE_TARGETS_LIST", NULL}
+#define STMT_73 \
"DROP TABLE IF EXISTS targets_list; " \
"CREATE TEMPORARY TABLE targets_list ( " \
" wc_id INTEGER NOT NULL, " \
@@ -750,15 +792,15 @@
" ); " \
""
-#define STMT_DROP_TARGETS_LIST 73
-#define STMT_73_INFO {"STMT_DROP_TARGETS_LIST", NULL}
-#define STMT_73 \
+#define STMT_DROP_TARGETS_LIST 74
+#define STMT_74_INFO {"STMT_DROP_TARGETS_LIST", NULL}
+#define STMT_74 \
"DROP TABLE targets_list " \
""
-#define STMT_INSERT_TARGET 74
-#define STMT_74_INFO {"STMT_INSERT_TARGET", NULL}
-#define STMT_74 \
+#define STMT_INSERT_TARGET 75
+#define STMT_75_INFO {"STMT_INSERT_TARGET", NULL}
+#define STMT_75 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT wc_id, local_relpath, parent_relpath, kind " \
"FROM nodes_current " \
@@ -766,9 +808,9 @@
" AND local_relpath = ?2 " \
""
-#define STMT_INSERT_TARGET_DEPTH_FILES 75
-#define STMT_75_INFO {"STMT_INSERT_TARGET_DEPTH_FILES", NULL}
-#define STMT_75 \
+#define STMT_INSERT_TARGET_DEPTH_FILES 76
+#define STMT_76_INFO {"STMT_INSERT_TARGET_DEPTH_FILES", NULL}
+#define STMT_76 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT wc_id, local_relpath, parent_relpath, kind " \
"FROM nodes_current " \
@@ -777,9 +819,9 @@
" AND kind = 'file' " \
""
-#define STMT_INSERT_TARGET_DEPTH_IMMEDIATES 76
-#define STMT_76_INFO {"STMT_INSERT_TARGET_DEPTH_IMMEDIATES", NULL}
-#define STMT_76 \
+#define STMT_INSERT_TARGET_DEPTH_IMMEDIATES 77
+#define STMT_77_INFO {"STMT_INSERT_TARGET_DEPTH_IMMEDIATES", NULL}
+#define STMT_77 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT wc_id, local_relpath, parent_relpath, kind " \
"FROM nodes_current " \
@@ -787,9 +829,9 @@
" AND parent_relpath = ?2 " \
""
-#define STMT_INSERT_TARGET_DEPTH_INFINITY 77
-#define STMT_77_INFO {"STMT_INSERT_TARGET_DEPTH_INFINITY", NULL}
-#define STMT_77 \
+#define STMT_INSERT_TARGET_DEPTH_INFINITY 78
+#define STMT_78_INFO {"STMT_INSERT_TARGET_DEPTH_INFINITY", NULL}
+#define STMT_78 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT wc_id, local_relpath, parent_relpath, kind " \
"FROM nodes_current " \
@@ -797,9 +839,9 @@
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_INSERT_TARGET_WITH_CHANGELIST 78
-#define STMT_78_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST", NULL}
-#define STMT_78 \
+#define STMT_INSERT_TARGET_WITH_CHANGELIST 79
+#define STMT_79_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST", NULL}
+#define STMT_79 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \
" FROM actual_node AS A JOIN nodes_current AS N " \
@@ -809,9 +851,9 @@
" AND A.changelist = ?3 " \
""
-#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES 79
-#define STMT_79_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES", NULL}
-#define STMT_79 \
+#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES 80
+#define STMT_80_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES", NULL}
+#define STMT_80 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \
" FROM actual_node AS A JOIN nodes_current AS N " \
@@ -822,9 +864,9 @@
" AND A.changelist = ?3 " \
""
-#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES 80
-#define STMT_80_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES", NULL}
-#define STMT_80 \
+#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES 81
+#define STMT_81_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES", NULL}
+#define STMT_81 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \
" FROM actual_node AS A JOIN nodes_current AS N " \
@@ -834,9 +876,9 @@
" AND A.changelist = ?3 " \
""
-#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY 81
-#define STMT_81_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY", NULL}
-#define STMT_81 \
+#define STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY 82
+#define STMT_82_INFO {"STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY", NULL}
+#define STMT_82 \
"INSERT INTO targets_list(wc_id, local_relpath, parent_relpath, kind) " \
"SELECT N.wc_id, N.local_relpath, N.parent_relpath, N.kind " \
" FROM actual_node AS A JOIN nodes_current AS N " \
@@ -846,18 +888,28 @@
" AND A.changelist = ?3 " \
""
-#define STMT_INSERT_ACTUAL_EMPTIES 82
-#define STMT_82_INFO {"STMT_INSERT_ACTUAL_EMPTIES", NULL}
-#define STMT_82 \
+#define STMT_INSERT_ACTUAL_EMPTIES 83
+#define STMT_83_INFO {"STMT_INSERT_ACTUAL_EMPTIES", NULL}
+#define STMT_83 \
"INSERT OR IGNORE INTO actual_node ( " \
" wc_id, local_relpath, parent_relpath) " \
"SELECT wc_id, local_relpath, parent_relpath " \
"FROM targets_list " \
""
-#define STMT_DELETE_ACTUAL_EMPTY 83
-#define STMT_83_INFO {"STMT_DELETE_ACTUAL_EMPTY", NULL}
-#define STMT_83 \
+#define STMT_INSERT_ACTUAL_EMPTIES_FILES 84
+#define STMT_84_INFO {"STMT_INSERT_ACTUAL_EMPTIES_FILES", NULL}
+#define STMT_84 \
+ "INSERT OR IGNORE INTO actual_node ( " \
+ " wc_id, local_relpath, parent_relpath) " \
+ "SELECT wc_id, local_relpath, parent_relpath " \
+ "FROM targets_list " \
+ "WHERE kind='file' " \
+ ""
+
+#define STMT_DELETE_ACTUAL_EMPTY 85
+#define STMT_85_INFO {"STMT_DELETE_ACTUAL_EMPTY", NULL}
+#define STMT_85 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
" AND properties IS NULL " \
@@ -869,12 +921,12 @@
" AND left_checksum IS NULL " \
""
-#define STMT_DELETE_ACTUAL_EMPTIES 84
-#define STMT_84_INFO {"STMT_DELETE_ACTUAL_EMPTIES", NULL}
-#define STMT_84 \
+#define STMT_DELETE_ACTUAL_EMPTIES 86
+#define STMT_86_INFO {"STMT_DELETE_ACTUAL_EMPTIES", NULL}
+#define STMT_86 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 " \
- " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
" AND properties IS NULL " \
" AND conflict_data IS NULL " \
" AND changelist IS NULL " \
@@ -884,25 +936,25 @@
" AND left_checksum IS NULL " \
""
-#define STMT_DELETE_BASE_NODE 85
-#define STMT_85_INFO {"STMT_DELETE_BASE_NODE", NULL}
-#define STMT_85 \
+#define STMT_DELETE_BASE_NODE 87
+#define STMT_87_INFO {"STMT_DELETE_BASE_NODE", NULL}
+#define STMT_87 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_DELETE_WORKING_NODE 86
-#define STMT_86_INFO {"STMT_DELETE_WORKING_NODE", NULL}
-#define STMT_86 \
+#define STMT_DELETE_WORKING_NODE 88
+#define STMT_88_INFO {"STMT_DELETE_WORKING_NODE", NULL}
+#define STMT_88 \
"DELETE FROM nodes " \
"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) " \
""
-#define STMT_DELETE_LOWEST_WORKING_NODE 87
-#define STMT_87_INFO {"STMT_DELETE_LOWEST_WORKING_NODE", NULL}
-#define STMT_87 \
+#define STMT_DELETE_LOWEST_WORKING_NODE 89
+#define STMT_89_INFO {"STMT_DELETE_LOWEST_WORKING_NODE", NULL}
+#define STMT_89 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
" AND op_depth = (SELECT MIN(op_depth) FROM nodes " \
@@ -910,16 +962,16 @@
" AND presence = 'base-deleted' " \
""
-#define STMT_DELETE_NODE_ALL_LAYERS 88
-#define STMT_88_INFO {"STMT_DELETE_NODE_ALL_LAYERS", NULL}
-#define STMT_88 \
+#define STMT_DELETE_NODE_ALL_LAYERS 90
+#define STMT_90_INFO {"STMT_DELETE_NODE_ALL_LAYERS", NULL}
+#define STMT_90 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE 89
-#define STMT_89_INFO {"STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE", NULL}
-#define STMT_89 \
+#define STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE 91
+#define STMT_91_INFO {"STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE", NULL}
+#define STMT_91 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -927,25 +979,25 @@
" AND op_depth >= ?3 " \
""
-#define STMT_DELETE_ACTUAL_NODE 90
-#define STMT_90_INFO {"STMT_DELETE_ACTUAL_NODE", NULL}
-#define STMT_90 \
+#define STMT_DELETE_ACTUAL_NODE 92
+#define STMT_92_INFO {"STMT_DELETE_ACTUAL_NODE", NULL}
+#define STMT_92 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_DELETE_ACTUAL_NODE_RECURSIVE 91
-#define STMT_91_INFO {"STMT_DELETE_ACTUAL_NODE_RECURSIVE", NULL}
-#define STMT_91 \
+#define STMT_DELETE_ACTUAL_NODE_RECURSIVE 93
+#define STMT_93_INFO {"STMT_DELETE_ACTUAL_NODE_RECURSIVE", NULL}
+#define STMT_93 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
" OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST 92
-#define STMT_92_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST", NULL}
-#define STMT_92 \
+#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST 94
+#define STMT_94_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST", NULL}
+#define STMT_94 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 " \
" AND local_relpath = ?2 " \
@@ -955,9 +1007,9 @@
" AND c.kind = 'file')) " \
""
-#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 93
-#define STMT_93_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL}
-#define STMT_93 \
+#define STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 95
+#define STMT_95_INFO {"STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL}
+#define STMT_95 \
"DELETE FROM actual_node " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -969,9 +1021,9 @@
" AND c.kind = 'file')) " \
""
-#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST 94
-#define STMT_94_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST", NULL}
-#define STMT_94 \
+#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST 96
+#define STMT_96_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST", NULL}
+#define STMT_96 \
"UPDATE actual_node " \
"SET properties = NULL, " \
" text_mod = NULL, " \
@@ -983,9 +1035,23 @@
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 95
-#define STMT_95_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL}
-#define STMT_95 \
+#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT 97
+#define STMT_97_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT", NULL}
+#define STMT_97 \
+ "UPDATE actual_node " \
+ "SET properties = NULL, " \
+ " text_mod = NULL, " \
+ " tree_conflict_data = NULL, " \
+ " older_checksum = NULL, " \
+ " left_checksum = NULL, " \
+ " right_checksum = NULL, " \
+ " changelist = NULL " \
+ "WHERE wc_id = ?1 AND local_relpath = ?2 " \
+ ""
+
+#define STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE 98
+#define STMT_98_INFO {"STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE", NULL}
+#define STMT_98 \
"UPDATE actual_node " \
"SET properties = NULL, " \
" text_mod = NULL, " \
@@ -999,108 +1065,109 @@
" OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_UPDATE_NODE_BASE_DEPTH 96
-#define STMT_96_INFO {"STMT_UPDATE_NODE_BASE_DEPTH", NULL}
-#define STMT_96 \
+#define STMT_UPDATE_NODE_BASE_DEPTH 99
+#define STMT_99_INFO {"STMT_UPDATE_NODE_BASE_DEPTH", NULL}
+#define STMT_99 \
"UPDATE nodes SET depth = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
" AND kind='dir' " \
+ " AND presence IN ('normal', 'incomplete') " \
""
-#define STMT_UPDATE_NODE_BASE_PRESENCE 97
-#define STMT_97_INFO {"STMT_UPDATE_NODE_BASE_PRESENCE", NULL}
-#define STMT_97 \
+#define STMT_UPDATE_NODE_BASE_PRESENCE 100
+#define STMT_100_INFO {"STMT_UPDATE_NODE_BASE_PRESENCE", NULL}
+#define STMT_100 \
"UPDATE nodes SET presence = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH 98
-#define STMT_98_INFO {"STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH", NULL}
-#define STMT_98 \
+#define STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH 101
+#define STMT_101_INFO {"STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH", NULL}
+#define STMT_101 \
"UPDATE nodes SET presence = ?3, revision = ?4, repos_path = ?5 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_LOOK_FOR_WORK 99
-#define STMT_99_INFO {"STMT_LOOK_FOR_WORK", NULL}
-#define STMT_99 \
+#define STMT_LOOK_FOR_WORK 102
+#define STMT_102_INFO {"STMT_LOOK_FOR_WORK", NULL}
+#define STMT_102 \
"SELECT id FROM work_queue LIMIT 1 " \
""
-#define STMT_INSERT_WORK_ITEM 100
-#define STMT_100_INFO {"STMT_INSERT_WORK_ITEM", NULL}
-#define STMT_100 \
+#define STMT_INSERT_WORK_ITEM 103
+#define STMT_103_INFO {"STMT_INSERT_WORK_ITEM", NULL}
+#define STMT_103 \
"INSERT INTO work_queue (work) VALUES (?1) " \
""
-#define STMT_SELECT_WORK_ITEM 101
-#define STMT_101_INFO {"STMT_SELECT_WORK_ITEM", NULL}
-#define STMT_101 \
+#define STMT_SELECT_WORK_ITEM 104
+#define STMT_104_INFO {"STMT_SELECT_WORK_ITEM", NULL}
+#define STMT_104 \
"SELECT id, work FROM work_queue ORDER BY id LIMIT 1 " \
""
-#define STMT_DELETE_WORK_ITEM 102
-#define STMT_102_INFO {"STMT_DELETE_WORK_ITEM", NULL}
-#define STMT_102 \
+#define STMT_DELETE_WORK_ITEM 105
+#define STMT_105_INFO {"STMT_DELETE_WORK_ITEM", NULL}
+#define STMT_105 \
"DELETE FROM work_queue WHERE id = ?1 " \
""
-#define STMT_INSERT_OR_IGNORE_PRISTINE 103
-#define STMT_103_INFO {"STMT_INSERT_OR_IGNORE_PRISTINE", NULL}
-#define STMT_103 \
+#define STMT_INSERT_OR_IGNORE_PRISTINE 106
+#define STMT_106_INFO {"STMT_INSERT_OR_IGNORE_PRISTINE", NULL}
+#define STMT_106 \
"INSERT OR IGNORE INTO pristine (checksum, md5_checksum, size, refcount) " \
"VALUES (?1, ?2, ?3, 0) " \
""
-#define STMT_INSERT_PRISTINE 104
-#define STMT_104_INFO {"STMT_INSERT_PRISTINE", NULL}
-#define STMT_104 \
+#define STMT_INSERT_PRISTINE 107
+#define STMT_107_INFO {"STMT_INSERT_PRISTINE", NULL}
+#define STMT_107 \
"INSERT INTO pristine (checksum, md5_checksum, size, refcount) " \
"VALUES (?1, ?2, ?3, 0) " \
""
-#define STMT_SELECT_PRISTINE 105
-#define STMT_105_INFO {"STMT_SELECT_PRISTINE", NULL}
-#define STMT_105 \
+#define STMT_SELECT_PRISTINE 108
+#define STMT_108_INFO {"STMT_SELECT_PRISTINE", NULL}
+#define STMT_108 \
"SELECT md5_checksum " \
"FROM pristine " \
"WHERE checksum = ?1 " \
""
-#define STMT_SELECT_PRISTINE_SIZE 106
-#define STMT_106_INFO {"STMT_SELECT_PRISTINE_SIZE", NULL}
-#define STMT_106 \
+#define STMT_SELECT_PRISTINE_SIZE 109
+#define STMT_109_INFO {"STMT_SELECT_PRISTINE_SIZE", NULL}
+#define STMT_109 \
"SELECT size " \
"FROM pristine " \
"WHERE checksum = ?1 LIMIT 1 " \
""
-#define STMT_SELECT_PRISTINE_BY_MD5 107
-#define STMT_107_INFO {"STMT_SELECT_PRISTINE_BY_MD5", NULL}
-#define STMT_107 \
+#define STMT_SELECT_PRISTINE_BY_MD5 110
+#define STMT_110_INFO {"STMT_SELECT_PRISTINE_BY_MD5", NULL}
+#define STMT_110 \
"SELECT checksum " \
"FROM pristine " \
"WHERE md5_checksum = ?1 " \
""
-#define STMT_SELECT_UNREFERENCED_PRISTINES 108
-#define STMT_108_INFO {"STMT_SELECT_UNREFERENCED_PRISTINES", NULL}
-#define STMT_108 \
+#define STMT_SELECT_UNREFERENCED_PRISTINES 111
+#define STMT_111_INFO {"STMT_SELECT_UNREFERENCED_PRISTINES", NULL}
+#define STMT_111 \
"SELECT checksum " \
"FROM pristine " \
"WHERE refcount = 0 " \
""
-#define STMT_DELETE_PRISTINE_IF_UNREFERENCED 109
-#define STMT_109_INFO {"STMT_DELETE_PRISTINE_IF_UNREFERENCED", NULL}
-#define STMT_109 \
+#define STMT_DELETE_PRISTINE_IF_UNREFERENCED 112
+#define STMT_112_INFO {"STMT_DELETE_PRISTINE_IF_UNREFERENCED", NULL}
+#define STMT_112 \
"DELETE FROM pristine " \
"WHERE checksum = ?1 AND refcount = 0 " \
""
-#define STMT_SELECT_COPY_PRISTINES 110
-#define STMT_110_INFO {"STMT_SELECT_COPY_PRISTINES", NULL}
-#define STMT_110 \
+#define STMT_SELECT_COPY_PRISTINES 113
+#define STMT_113_INFO {"STMT_SELECT_COPY_PRISTINES", NULL}
+#define STMT_113 \
"SELECT n.checksum, md5_checksum, size " \
"FROM nodes_current n " \
"LEFT JOIN pristine p ON n.checksum = p.checksum " \
@@ -1118,62 +1185,73 @@
" AND n.checksum IS NOT NULL " \
""
-#define STMT_VACUUM 111
-#define STMT_111_INFO {"STMT_VACUUM", NULL}
-#define STMT_111 \
+#define STMT_VACUUM 114
+#define STMT_114_INFO {"STMT_VACUUM", NULL}
+#define STMT_114 \
"VACUUM " \
""
-#define STMT_SELECT_CONFLICT_VICTIMS 112
-#define STMT_112_INFO {"STMT_SELECT_CONFLICT_VICTIMS", NULL}
-#define STMT_112 \
+#define STMT_SELECT_CONFLICT_VICTIMS 115
+#define STMT_115_INFO {"STMT_SELECT_CONFLICT_VICTIMS", NULL}
+#define STMT_115 \
"SELECT local_relpath, conflict_data " \
"FROM actual_node " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 AND " \
" NOT (conflict_data IS NULL) " \
""
-#define STMT_INSERT_WC_LOCK 113
-#define STMT_113_INFO {"STMT_INSERT_WC_LOCK", NULL}
-#define STMT_113 \
+#define STMT_INSERT_WC_LOCK 116
+#define STMT_116_INFO {"STMT_INSERT_WC_LOCK", NULL}
+#define STMT_116 \
"INSERT INTO wc_lock (wc_id, local_dir_relpath, locked_levels) " \
"VALUES (?1, ?2, ?3) " \
""
-#define STMT_SELECT_WC_LOCK 114
-#define STMT_114_INFO {"STMT_SELECT_WC_LOCK", NULL}
-#define STMT_114 \
+#define STMT_SELECT_WC_LOCK 117
+#define STMT_117_INFO {"STMT_SELECT_WC_LOCK", NULL}
+#define STMT_117 \
"SELECT locked_levels FROM wc_lock " \
"WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \
""
-#define STMT_SELECT_ANCESTOR_WCLOCKS 115
-#define STMT_115_INFO {"STMT_SELECT_ANCESTOR_WCLOCKS", NULL}
-#define STMT_115 \
+#define STMT_SELECT_ANCESTOR_WCLOCKS 118
+#define STMT_118_INFO {"STMT_SELECT_ANCESTOR_WCLOCKS", NULL}
+#define STMT_118 \
"SELECT local_dir_relpath, locked_levels FROM wc_lock " \
"WHERE wc_id = ?1 " \
" AND ((local_dir_relpath >= ?3 AND local_dir_relpath <= ?2) " \
" OR local_dir_relpath = '') " \
""
-#define STMT_DELETE_WC_LOCK 116
-#define STMT_116_INFO {"STMT_DELETE_WC_LOCK", NULL}
-#define STMT_116 \
+#define STMT_DELETE_WC_LOCK 119
+#define STMT_119_INFO {"STMT_DELETE_WC_LOCK", NULL}
+#define STMT_119 \
"DELETE FROM wc_lock " \
"WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \
""
-#define STMT_FIND_WC_LOCK 117
-#define STMT_117_INFO {"STMT_FIND_WC_LOCK", NULL}
-#define STMT_117 \
+#define STMT_FIND_WC_LOCK 120
+#define STMT_120_INFO {"STMT_FIND_WC_LOCK", NULL}
+#define STMT_120 \
"SELECT local_dir_relpath FROM wc_lock " \
"WHERE wc_id = ?1 " \
" AND (((local_dir_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_dir_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_DELETE_WC_LOCK_ORPHAN 118
-#define STMT_118_INFO {"STMT_DELETE_WC_LOCK_ORPHAN", NULL}
-#define STMT_118 \
+#define STMT_FIND_CONFLICT_DESCENDANT 121
+#define STMT_121_INFO {"STMT_FIND_CONFLICT_DESCENDANT", NULL}
+#define STMT_121 \
+ "SELECT 1 FROM actual_node " \
+ "WHERE wc_id = ?1 " \
+ " AND local_relpath > (?2 || '/') " \
+ " AND local_relpath < (?2 || '0') " \
+ " AND conflict_data IS NOT NULL " \
+ "LIMIT 1 " \
+ ""
+
+#define STMT_DELETE_WC_LOCK_ORPHAN 122
+#define STMT_122_INFO {"STMT_DELETE_WC_LOCK_ORPHAN", NULL}
+#define STMT_122 \
"DELETE FROM wc_lock " \
"WHERE wc_id = ?1 AND local_dir_relpath = ?2 " \
"AND NOT EXISTS (SELECT 1 FROM nodes " \
@@ -1181,9 +1259,9 @@
" AND nodes.local_relpath = wc_lock.local_dir_relpath) " \
""
-#define STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE 119
-#define STMT_119_INFO {"STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE", NULL}
-#define STMT_119 \
+#define STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE 123
+#define STMT_123_INFO {"STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE", NULL}
+#define STMT_123 \
"DELETE FROM wc_lock " \
"WHERE wc_id = ?1 " \
" AND (local_dir_relpath = ?2 " \
@@ -1193,9 +1271,9 @@
" AND nodes.local_relpath = wc_lock.local_dir_relpath) " \
""
-#define STMT_APPLY_CHANGES_TO_BASE_NODE 120
-#define STMT_120_INFO {"STMT_APPLY_CHANGES_TO_BASE_NODE", NULL}
-#define STMT_120 \
+#define STMT_APPLY_CHANGES_TO_BASE_NODE 124
+#define STMT_124_INFO {"STMT_APPLY_CHANGES_TO_BASE_NODE", NULL}
+#define STMT_124 \
"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, " \
@@ -1209,77 +1287,70 @@
" AND op_depth = 0)) " \
""
-#define STMT_INSTALL_WORKING_NODE_FOR_DELETE 121
-#define STMT_121_INFO {"STMT_INSTALL_WORKING_NODE_FOR_DELETE", NULL}
-#define STMT_121 \
- "INSERT OR REPLACE INTO nodes ( " \
+#define STMT_INSTALL_WORKING_NODE_FOR_DELETE 125
+#define STMT_125_INFO {"STMT_INSTALL_WORKING_NODE_FOR_DELETE", NULL}
+#define STMT_125 \
+ "INSERT INTO nodes ( " \
" wc_id, local_relpath, op_depth, " \
" parent_relpath, presence, kind) " \
"VALUES(?1, ?2, ?3, ?4, 'base-deleted', ?5) " \
""
-#define STMT_DELETE_NO_LOWER_LAYER 122
-#define STMT_122_INFO {"STMT_DELETE_NO_LOWER_LAYER", NULL}
-#define STMT_122 \
- "DELETE FROM nodes " \
- " WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth = ?3 " \
- " AND NOT EXISTS (SELECT 1 FROM nodes n " \
- " WHERE n.wc_id = ?1 " \
- " AND n.local_relpath = nodes.local_relpath " \
- " AND n.op_depth = ?4 " \
- " AND n.presence IN ('normal', 'incomplete')) " \
- ""
-
-#define STMT_REPLACE_WITH_BASE_DELETED 123
-#define STMT_123_INFO {"STMT_REPLACE_WITH_BASE_DELETED", NULL}
-#define STMT_123 \
+#define STMT_REPLACE_WITH_BASE_DELETED 126
+#define STMT_126_INFO {"STMT_REPLACE_WITH_BASE_DELETED", NULL}
+#define STMT_126 \
"INSERT OR REPLACE INTO nodes (wc_id, local_relpath, op_depth, parent_relpath, " \
" kind, moved_to, presence) " \
"SELECT wc_id, local_relpath, op_depth, parent_relpath, " \
" kind, moved_to, 'base-deleted' " \
" FROM nodes " \
" WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND local_relpath = ?2 " \
" AND op_depth = ?3 " \
""
-#define STMT_INSERT_DELETE_FROM_NODE_RECURSIVE 124
-#define STMT_124_INFO {"STMT_INSERT_DELETE_FROM_NODE_RECURSIVE", NULL}
-#define STMT_124 \
+#define STMT_INSERT_DELETE_FROM_NODE_RECURSIVE 127
+#define STMT_127_INFO {"STMT_INSERT_DELETE_FROM_NODE_RECURSIVE", NULL}
+#define STMT_127 \
"INSERT INTO nodes ( " \
" wc_id, local_relpath, op_depth, parent_relpath, presence, kind) " \
"SELECT wc_id, local_relpath, ?4 , parent_relpath, 'base-deleted', " \
" kind " \
"FROM nodes " \
+ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
+ "UNION ALL " \
+ "SELECT wc_id, local_relpath, ?4 , parent_relpath, 'base-deleted', " \
+ " kind " \
+ "FROM nodes " \
"WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 " \
- " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND op_depth = ?3 " \
" AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded') " \
" AND file_external IS NULL " \
+ "ORDER BY local_relpath " \
""
-#define STMT_INSERT_WORKING_NODE_FROM_BASE_COPY 125
-#define STMT_125_INFO {"STMT_INSERT_WORKING_NODE_FROM_BASE_COPY", NULL}
-#define STMT_125 \
- "INSERT INTO nodes ( " \
+#define STMT_INSERT_WORKING_NODE_FROM_BASE_COPY 128
+#define STMT_128_INFO {"STMT_INSERT_WORKING_NODE_FROM_BASE_COPY", NULL}
+#define STMT_128 \
+ "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 ) " \
+ " symlink_target, moved_to ) " \
"SELECT wc_id, local_relpath, ?3 , 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 " \
+ " last_mod_time, symlink_target, " \
+ " (SELECT moved_to FROM nodes " \
+ " WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3) moved_to " \
"FROM nodes " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_INSERT_DELETE_FROM_BASE 126
-#define STMT_126_INFO {"STMT_INSERT_DELETE_FROM_BASE", NULL}
-#define STMT_126 \
+#define STMT_INSERT_DELETE_FROM_BASE 129
+#define STMT_129_INFO {"STMT_INSERT_DELETE_FROM_BASE", NULL}
+#define STMT_129 \
"INSERT INTO nodes ( " \
" wc_id, local_relpath, op_depth, parent_relpath, presence, kind) " \
"SELECT wc_id, local_relpath, ?3 , parent_relpath, " \
@@ -1288,34 +1359,52 @@
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE 127
-#define STMT_127_INFO {"STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE", NULL}
-#define STMT_127 \
+#define STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE 130
+#define STMT_130_INFO {"STMT_UPDATE_OP_DEPTH_INCREASE_RECURSIVE", NULL}
+#define STMT_130 \
"UPDATE nodes SET op_depth = ?3 + 1 " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND op_depth = ?3 " \
""
-#define STMT_UPDATE_OP_DEPTH_RECURSIVE 128
-#define STMT_128_INFO {"STMT_UPDATE_OP_DEPTH_RECURSIVE", NULL}
-#define STMT_128 \
- "UPDATE nodes SET op_depth = ?4, moved_here = NULL " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth = ?3 " \
+#define STMT_COPY_OP_DEPTH_RECURSIVE 131
+#define STMT_131_INFO {"STMT_COPY_OP_DEPTH_RECURSIVE", NULL}
+#define STMT_131 \
+ "INSERT 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, moved_to ) " \
+ "SELECT " \
+ " wc_id, local_relpath, ?4, 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, NULL, NULL " \
+ "FROM nodes " \
+ "WHERE wc_id = ?1 AND op_depth = ?3 AND local_relpath = ?2 " \
+ "UNION ALL " \
+ "SELECT " \
+ " wc_id, local_relpath, ?4, 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, NULL, NULL " \
+ "FROM nodes " \
+ "WHERE wc_id = ?1 AND op_depth = ?3 " \
+ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ "ORDER BY local_relpath " \
""
-#define STMT_DOES_NODE_EXIST 129
-#define STMT_129_INFO {"STMT_DOES_NODE_EXIST", NULL}
-#define STMT_129 \
+#define STMT_DOES_NODE_EXIST 132
+#define STMT_132_INFO {"STMT_DOES_NODE_EXIST", NULL}
+#define STMT_132 \
"SELECT 1 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2 " \
"LIMIT 1 " \
""
-#define STMT_HAS_SERVER_EXCLUDED_DESCENDANTS 130
-#define STMT_130_INFO {"STMT_HAS_SERVER_EXCLUDED_DESCENDANTS", NULL}
-#define STMT_130 \
+#define STMT_HAS_SERVER_EXCLUDED_DESCENDANTS 133
+#define STMT_133_INFO {"STMT_HAS_SERVER_EXCLUDED_DESCENDANTS", NULL}
+#define STMT_133 \
"SELECT local_relpath FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -1323,9 +1412,9 @@
"LIMIT 1 " \
""
-#define STMT_SELECT_ALL_EXCLUDED_DESCENDANTS 131
-#define STMT_131_INFO {"STMT_SELECT_ALL_EXCLUDED_DESCENDANTS", NULL}
-#define STMT_131 \
+#define STMT_SELECT_ALL_EXCLUDED_DESCENDANTS 134
+#define STMT_134_INFO {"STMT_SELECT_ALL_EXCLUDED_DESCENDANTS", NULL}
+#define STMT_134 \
"SELECT local_relpath FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -1333,9 +1422,9 @@
" AND (presence = 'server-excluded' OR presence = 'excluded') " \
""
-#define STMT_INSERT_WORKING_NODE_COPY_FROM 132
-#define STMT_132_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM", NULL}
-#define STMT_132 \
+#define STMT_INSERT_WORKING_NODE_COPY_FROM 135
+#define STMT_135_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM", NULL}
+#define STMT_135 \
"INSERT OR REPLACE INTO nodes ( " \
" wc_id, local_relpath, op_depth, parent_relpath, repos_id, " \
" repos_path, revision, presence, depth, moved_here, kind, changed_revision, " \
@@ -1354,9 +1443,9 @@
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH 133
-#define STMT_133_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH", NULL}
-#define STMT_133 \
+#define STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH 136
+#define STMT_136_INFO {"STMT_INSERT_WORKING_NODE_COPY_FROM_DEPTH", NULL}
+#define STMT_136 \
"INSERT OR REPLACE INTO nodes ( " \
" wc_id, local_relpath, op_depth, parent_relpath, repos_id, " \
" repos_path, revision, presence, depth, moved_here, kind, changed_revision, " \
@@ -1375,49 +1464,49 @@
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?7 " \
""
-#define STMT_UPDATE_BASE_REVISION 134
-#define STMT_134_INFO {"STMT_UPDATE_BASE_REVISION", NULL}
-#define STMT_134 \
+#define STMT_UPDATE_BASE_REVISION 137
+#define STMT_137_INFO {"STMT_UPDATE_BASE_REVISION", NULL}
+#define STMT_137 \
"UPDATE nodes SET revision = ?3 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_UPDATE_BASE_REPOS 135
-#define STMT_135_INFO {"STMT_UPDATE_BASE_REPOS", NULL}
-#define STMT_135 \
+#define STMT_UPDATE_BASE_REPOS 138
+#define STMT_138_INFO {"STMT_UPDATE_BASE_REPOS", NULL}
+#define STMT_138 \
"UPDATE nodes SET repos_id = ?3, repos_path = ?4 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 " \
""
-#define STMT_ACTUAL_HAS_CHILDREN 136
-#define STMT_136_INFO {"STMT_ACTUAL_HAS_CHILDREN", NULL}
-#define STMT_136 \
+#define STMT_ACTUAL_HAS_CHILDREN 139
+#define STMT_139_INFO {"STMT_ACTUAL_HAS_CHILDREN", NULL}
+#define STMT_139 \
"SELECT 1 FROM actual_node " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 " \
"LIMIT 1 " \
""
-#define STMT_INSERT_EXTERNAL 137
-#define STMT_137_INFO {"STMT_INSERT_EXTERNAL", NULL}
-#define STMT_137 \
+#define STMT_INSERT_EXTERNAL 140
+#define STMT_140_INFO {"STMT_INSERT_EXTERNAL", NULL}
+#define STMT_140 \
"INSERT OR REPLACE INTO externals ( " \
" wc_id, local_relpath, parent_relpath, presence, kind, def_local_relpath, " \
" repos_id, def_repos_relpath, def_operational_revision, def_revision) " \
"VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10) " \
""
-#define STMT_SELECT_EXTERNAL_INFO 138
-#define STMT_138_INFO {"STMT_SELECT_EXTERNAL_INFO", NULL}
-#define STMT_138 \
+#define STMT_SELECT_EXTERNAL_INFO 141
+#define STMT_141_INFO {"STMT_SELECT_EXTERNAL_INFO", NULL}
+#define STMT_141 \
"SELECT presence, kind, def_local_relpath, repos_id, " \
" def_repos_relpath, def_operational_revision, def_revision " \
"FROM externals WHERE wc_id = ?1 AND local_relpath = ?2 " \
"LIMIT 1 " \
""
-#define STMT_DELETE_FILE_EXTERNALS 139
-#define STMT_139_INFO {"STMT_DELETE_FILE_EXTERNALS", NULL}
-#define STMT_139 \
+#define STMT_DELETE_FILE_EXTERNALS 142
+#define STMT_142_INFO {"STMT_DELETE_FILE_EXTERNALS", NULL}
+#define STMT_142 \
"DELETE FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -1425,26 +1514,26 @@
" AND file_external IS NOT NULL " \
""
-#define STMT_DELETE_FILE_EXTERNAL_REGISTATIONS 140
-#define STMT_140_INFO {"STMT_DELETE_FILE_EXTERNAL_REGISTATIONS", NULL}
-#define STMT_140 \
+#define STMT_DELETE_FILE_EXTERNAL_REGISTATIONS 143
+#define STMT_143_INFO {"STMT_DELETE_FILE_EXTERNAL_REGISTATIONS", NULL}
+#define STMT_143 \
"DELETE FROM externals " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND kind != 'dir' " \
""
-#define STMT_DELETE_EXTERNAL_REGISTATIONS 141
-#define STMT_141_INFO {"STMT_DELETE_EXTERNAL_REGISTATIONS", NULL}
-#define STMT_141 \
+#define STMT_DELETE_EXTERNAL_REGISTATIONS 144
+#define STMT_144_INFO {"STMT_DELETE_EXTERNAL_REGISTATIONS", NULL}
+#define STMT_144 \
"DELETE FROM externals " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW 142
-#define STMT_142_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW", NULL}
-#define STMT_142 \
+#define STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW 145
+#define STMT_145_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW", NULL}
+#define STMT_145 \
"SELECT local_relpath, kind, def_repos_relpath, " \
" (SELECT root FROM repository AS r WHERE r.id = e.repos_id) " \
"FROM externals e " \
@@ -1462,9 +1551,9 @@
" AND nodes.local_relpath = e.parent_relpath)) " \
""
-#define STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW 143
-#define STMT_143_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW", NULL}
-#define STMT_143 \
+#define STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW 146
+#define STMT_146_INFO {"STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW", NULL}
+#define STMT_146 \
"SELECT local_relpath, kind, def_repos_relpath, " \
" (SELECT root FROM repository AS r WHERE r.id = e.repos_id) " \
"FROM externals e " \
@@ -1483,25 +1572,25 @@
" AND nodes.local_relpath = e.parent_relpath)) " \
""
-#define STMT_SELECT_EXTERNALS_DEFINED 144
-#define STMT_144_INFO {"STMT_SELECT_EXTERNALS_DEFINED", NULL}
-#define STMT_144 \
+#define STMT_SELECT_EXTERNALS_DEFINED 147
+#define STMT_147_INFO {"STMT_SELECT_EXTERNALS_DEFINED", NULL}
+#define STMT_147 \
"SELECT local_relpath, def_local_relpath " \
"FROM externals " \
"WHERE (wc_id = ?1 AND def_local_relpath = ?2) " \
" OR (wc_id = ?1 AND (((def_local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((def_local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_DELETE_EXTERNAL 145
-#define STMT_145_INFO {"STMT_DELETE_EXTERNAL", NULL}
-#define STMT_145 \
+#define STMT_DELETE_EXTERNAL 148
+#define STMT_148_INFO {"STMT_DELETE_EXTERNAL", NULL}
+#define STMT_148 \
"DELETE FROM externals " \
"WHERE wc_id = ?1 AND local_relpath = ?2 " \
""
-#define STMT_SELECT_EXTERNAL_PROPERTIES 146
-#define STMT_146_INFO {"STMT_SELECT_EXTERNAL_PROPERTIES", NULL}
-#define STMT_146 \
+#define STMT_SELECT_EXTERNAL_PROPERTIES 149
+#define STMT_149_INFO {"STMT_SELECT_EXTERNAL_PROPERTIES", NULL}
+#define STMT_149 \
"SELECT IFNULL((SELECT properties FROM actual_node a " \
" WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath), " \
" properties), " \
@@ -1519,9 +1608,9 @@
" AND kind = 'dir' AND presence IN ('normal', 'incomplete') " \
""
-#define STMT_SELECT_CURRENT_PROPS_RECURSIVE 147
-#define STMT_147_INFO {"STMT_SELECT_CURRENT_PROPS_RECURSIVE", NULL}
-#define STMT_147 \
+#define STMT_SELECT_CURRENT_PROPS_RECURSIVE 150
+#define STMT_150_INFO {"STMT_SELECT_CURRENT_PROPS_RECURSIVE", NULL}
+#define STMT_150 \
"SELECT IFNULL((SELECT properties FROM actual_node a " \
" WHERE a.wc_id = ?1 AND A.local_relpath = n.local_relpath), " \
" properties), " \
@@ -1531,57 +1620,43 @@
" OR (wc_id = ?1 AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
""
-#define STMT_PRAGMA_LOCKING_MODE 148
-#define STMT_148_INFO {"STMT_PRAGMA_LOCKING_MODE", NULL}
-#define STMT_148 \
+#define STMT_PRAGMA_LOCKING_MODE 151
+#define STMT_151_INFO {"STMT_PRAGMA_LOCKING_MODE", NULL}
+#define STMT_151 \
"PRAGMA locking_mode = exclusive " \
""
-#define STMT_INSERT_ACTUAL_NODE 149
-#define STMT_149_INFO {"STMT_INSERT_ACTUAL_NODE", NULL}
-#define STMT_149 \
+#define STMT_INSERT_ACTUAL_NODE 152
+#define STMT_152_INFO {"STMT_INSERT_ACTUAL_NODE", NULL}
+#define STMT_152 \
"INSERT OR REPLACE INTO actual_node ( " \
" wc_id, local_relpath, parent_relpath, properties, changelist, conflict_data) " \
"VALUES (?1, ?2, ?3, ?4, ?5, ?6) " \
""
-#define STMT_UPDATE_ACTUAL_CONFLICT_DATA 150
-#define STMT_150_INFO {"STMT_UPDATE_ACTUAL_CONFLICT_DATA", NULL}
-#define STMT_150 \
- "UPDATE actual_node SET conflict_data = ?3 " \
- "WHERE wc_id = ?1 AND local_relpath = ?2 " \
- ""
-
-#define STMT_INSERT_ACTUAL_CONFLICT_DATA 151
-#define STMT_151_INFO {"STMT_INSERT_ACTUAL_CONFLICT_DATA", NULL}
-#define STMT_151 \
- "INSERT INTO actual_node (wc_id, local_relpath, conflict_data, parent_relpath) " \
- "VALUES (?1, ?2, ?3, ?4) " \
- ""
-
-#define STMT_SELECT_ALL_FILES 152
-#define STMT_152_INFO {"STMT_SELECT_ALL_FILES", NULL}
-#define STMT_152 \
+#define STMT_SELECT_ALL_FILES 153
+#define STMT_153_INFO {"STMT_SELECT_ALL_FILES", NULL}
+#define STMT_153 \
"SELECT local_relpath FROM nodes_current " \
"WHERE wc_id = ?1 AND parent_relpath = ?2 AND kind = 'file' " \
""
-#define STMT_UPDATE_NODE_PROPS 153
-#define STMT_153_INFO {"STMT_UPDATE_NODE_PROPS", NULL}
-#define STMT_153 \
+#define STMT_UPDATE_NODE_PROPS 154
+#define STMT_154_INFO {"STMT_UPDATE_NODE_PROPS", NULL}
+#define STMT_154 \
"UPDATE nodes SET properties = ?4 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_PRAGMA_TABLE_INFO_NODES 154
-#define STMT_154_INFO {"STMT_PRAGMA_TABLE_INFO_NODES", NULL}
-#define STMT_154 \
+#define STMT_PRAGMA_TABLE_INFO_NODES 155
+#define STMT_155_INFO {"STMT_PRAGMA_TABLE_INFO_NODES", NULL}
+#define STMT_155 \
"PRAGMA table_info(\"NODES\") " \
""
-#define STMT_CREATE_TARGET_PROP_CACHE 155
-#define STMT_155_INFO {"STMT_CREATE_TARGET_PROP_CACHE", NULL}
-#define STMT_155 \
+#define STMT_CREATE_TARGET_PROP_CACHE 156
+#define STMT_156_INFO {"STMT_CREATE_TARGET_PROP_CACHE", NULL}
+#define STMT_156 \
"DROP TABLE IF EXISTS target_prop_cache; " \
"CREATE TEMPORARY TABLE target_prop_cache ( " \
" local_relpath TEXT NOT NULL PRIMARY KEY, " \
@@ -1590,9 +1665,9 @@
"); " \
""
-#define STMT_CACHE_TARGET_PROPS 156
-#define STMT_156_INFO {"STMT_CACHE_TARGET_PROPS", NULL}
-#define STMT_156 \
+#define STMT_CACHE_TARGET_PROPS 157
+#define STMT_157_INFO {"STMT_CACHE_TARGET_PROPS", NULL}
+#define STMT_157 \
"INSERT INTO target_prop_cache(local_relpath, kind, properties) " \
" SELECT n.local_relpath, n.kind, " \
" IFNULL((SELECT properties FROM actual_node AS a " \
@@ -1611,9 +1686,9 @@
" ORDER BY t.local_relpath " \
""
-#define STMT_CACHE_TARGET_PRISTINE_PROPS 157
-#define STMT_157_INFO {"STMT_CACHE_TARGET_PRISTINE_PROPS", NULL}
-#define STMT_157 \
+#define STMT_CACHE_TARGET_PRISTINE_PROPS 158
+#define STMT_158_INFO {"STMT_CACHE_TARGET_PRISTINE_PROPS", NULL}
+#define STMT_158 \
"INSERT INTO target_prop_cache(local_relpath, kind, properties) " \
" SELECT n.local_relpath, n.kind, " \
" CASE n.presence " \
@@ -1638,22 +1713,22 @@
" ORDER BY t.local_relpath " \
""
-#define STMT_SELECT_ALL_TARGET_PROP_CACHE 158
-#define STMT_158_INFO {"STMT_SELECT_ALL_TARGET_PROP_CACHE", NULL}
-#define STMT_158 \
+#define STMT_SELECT_ALL_TARGET_PROP_CACHE 159
+#define STMT_159_INFO {"STMT_SELECT_ALL_TARGET_PROP_CACHE", NULL}
+#define STMT_159 \
"SELECT local_relpath, properties FROM target_prop_cache " \
"ORDER BY local_relpath " \
""
-#define STMT_DROP_TARGET_PROP_CACHE 159
-#define STMT_159_INFO {"STMT_DROP_TARGET_PROP_CACHE", NULL}
-#define STMT_159 \
+#define STMT_DROP_TARGET_PROP_CACHE 160
+#define STMT_160_INFO {"STMT_DROP_TARGET_PROP_CACHE", NULL}
+#define STMT_160 \
"DROP TABLE target_prop_cache; " \
""
-#define STMT_CREATE_REVERT_LIST 160
-#define STMT_160_INFO {"STMT_CREATE_REVERT_LIST", NULL}
-#define STMT_160 \
+#define STMT_CREATE_REVERT_LIST 161
+#define STMT_161_INFO {"STMT_CREATE_REVERT_LIST", NULL}
+#define STMT_161 \
"DROP TABLE IF EXISTS revert_list; " \
"CREATE TEMPORARY TABLE revert_list ( " \
" local_relpath TEXT NOT NULL, " \
@@ -1687,8 +1762,9 @@
" WHERE n.wc_id = OLD.wc_id " \
" AND n.local_relpath = OLD.local_relpath) " \
" THEN 1 " \
- " ELSE NULL " \
- " END; " \
+ " END notify " \
+ " WHERE OLD.conflict_data IS NOT NULL " \
+ " OR notify IS NOT NULL; " \
"END; " \
"DROP TRIGGER IF EXISTS trigger_revert_list_actual_update; " \
"CREATE TEMPORARY TRIGGER trigger_revert_list_actual_update " \
@@ -1704,31 +1780,32 @@
" WHERE n.wc_id = OLD.wc_id " \
" AND n.local_relpath = OLD.local_relpath) " \
" THEN 1 " \
- " ELSE NULL " \
- " END; " \
+ " END notify " \
+ " WHERE OLD.conflict_data IS NOT NULL " \
+ " OR notify IS NOT NULL; " \
"END " \
""
-#define STMT_DROP_REVERT_LIST_TRIGGERS 161
-#define STMT_161_INFO {"STMT_DROP_REVERT_LIST_TRIGGERS", NULL}
-#define STMT_161 \
+#define STMT_DROP_REVERT_LIST_TRIGGERS 162
+#define STMT_162_INFO {"STMT_DROP_REVERT_LIST_TRIGGERS", NULL}
+#define STMT_162 \
"DROP TRIGGER trigger_revert_list_nodes; " \
"DROP TRIGGER trigger_revert_list_actual_delete; " \
"DROP TRIGGER trigger_revert_list_actual_update " \
""
-#define STMT_SELECT_REVERT_LIST 162
-#define STMT_162_INFO {"STMT_SELECT_REVERT_LIST", NULL}
-#define STMT_162 \
+#define STMT_SELECT_REVERT_LIST 163
+#define STMT_163_INFO {"STMT_SELECT_REVERT_LIST", NULL}
+#define STMT_163 \
"SELECT actual, notify, kind, op_depth, repos_id, conflict_data " \
"FROM revert_list " \
"WHERE local_relpath = ?1 " \
"ORDER BY actual DESC " \
""
-#define STMT_SELECT_REVERT_LIST_COPIED_CHILDREN 163
-#define STMT_163_INFO {"STMT_SELECT_REVERT_LIST_COPIED_CHILDREN", NULL}
-#define STMT_163 \
+#define STMT_SELECT_REVERT_LIST_COPIED_CHILDREN 164
+#define STMT_164_INFO {"STMT_SELECT_REVERT_LIST_COPIED_CHILDREN", NULL}
+#define STMT_164 \
"SELECT local_relpath, kind " \
"FROM revert_list " \
"WHERE (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END)) " \
@@ -1737,113 +1814,125 @@
"ORDER BY local_relpath " \
""
-#define STMT_DELETE_REVERT_LIST 164
-#define STMT_164_INFO {"STMT_DELETE_REVERT_LIST", NULL}
-#define STMT_164 \
- "DELETE FROM revert_list WHERE local_relpath = ?1 " \
- ""
-
-#define STMT_SELECT_REVERT_LIST_RECURSIVE 165
-#define STMT_165_INFO {"STMT_SELECT_REVERT_LIST_RECURSIVE", NULL}
+#define STMT_DELETE_REVERT_LIST 165
+#define STMT_165_INFO {"STMT_DELETE_REVERT_LIST", NULL}
#define STMT_165 \
- "SELECT DISTINCT local_relpath " \
- "FROM revert_list " \
- "WHERE (local_relpath = ?1 " \
- " OR (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END))) " \
- " AND (notify OR actual = 0) " \
- "ORDER BY local_relpath " \
+ "DELETE FROM revert_list WHERE local_relpath = ?1 " \
""
-#define STMT_DELETE_REVERT_LIST_RECURSIVE 166
-#define STMT_166_INFO {"STMT_DELETE_REVERT_LIST_RECURSIVE", NULL}
+#define STMT_SELECT_REVERT_LIST_RECURSIVE 166
+#define STMT_166_INFO {"STMT_SELECT_REVERT_LIST_RECURSIVE", NULL}
#define STMT_166 \
+ "SELECT p.local_relpath, n.kind, a.notify, a.kind " \
+ "FROM (SELECT DISTINCT local_relpath " \
+ " FROM revert_list " \
+ " WHERE (local_relpath = ?1 " \
+ " OR (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END)))) p " \
+ "LEFT JOIN revert_list n ON n.local_relpath=p.local_relpath AND n.actual=0 " \
+ "LEFT JOIN revert_list a ON a.local_relpath=p.local_relpath AND a.actual=1 " \
+ "ORDER BY p.local_relpath " \
+ ""
+
+#define STMT_DELETE_REVERT_LIST_RECURSIVE 167
+#define STMT_167_INFO {"STMT_DELETE_REVERT_LIST_RECURSIVE", NULL}
+#define STMT_167 \
"DELETE FROM revert_list " \
"WHERE (local_relpath = ?1 " \
" OR (((local_relpath) > (CASE (?1) WHEN '' THEN '' ELSE (?1) || '/' END)) AND ((local_relpath) < CASE (?1) WHEN '' THEN X'FFFF' ELSE (?1) || '0' END))) " \
""
-#define STMT_DROP_REVERT_LIST 167
-#define STMT_167_INFO {"STMT_DROP_REVERT_LIST", NULL}
-#define STMT_167 \
+#define STMT_DROP_REVERT_LIST 168
+#define STMT_168_INFO {"STMT_DROP_REVERT_LIST", NULL}
+#define STMT_168 \
"DROP TABLE IF EXISTS revert_list " \
""
-#define STMT_CREATE_DELETE_LIST 168
-#define STMT_168_INFO {"STMT_CREATE_DELETE_LIST", NULL}
-#define STMT_168 \
+#define STMT_CREATE_DELETE_LIST 169
+#define STMT_169_INFO {"STMT_CREATE_DELETE_LIST", NULL}
+#define STMT_169 \
"DROP TABLE IF EXISTS delete_list; " \
"CREATE TEMPORARY TABLE delete_list ( " \
" local_relpath TEXT PRIMARY KEY NOT NULL UNIQUE " \
" ) " \
""
-#define STMT_INSERT_DELETE_LIST 169
-#define STMT_169_INFO {"STMT_INSERT_DELETE_LIST", NULL}
-#define STMT_169 \
+#define STMT_INSERT_DELETE_LIST 170
+#define STMT_170_INFO {"STMT_INSERT_DELETE_LIST", NULL}
+#define STMT_170 \
"INSERT INTO delete_list(local_relpath) " \
+ "SELECT ?2 " \
+ "UNION ALL " \
"SELECT local_relpath FROM nodes AS n " \
"WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 " \
- " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND op_depth >= ?3 " \
" 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 file_external IS NULL " \
+ "ORDER by local_relpath " \
""
-#define STMT_SELECT_DELETE_LIST 170
-#define STMT_170_INFO {"STMT_SELECT_DELETE_LIST", NULL}
-#define STMT_170 \
+#define STMT_SELECT_DELETE_LIST 171
+#define STMT_171_INFO {"STMT_SELECT_DELETE_LIST", NULL}
+#define STMT_171 \
"SELECT local_relpath FROM delete_list " \
"ORDER BY local_relpath " \
""
-#define STMT_FINALIZE_DELETE 171
-#define STMT_171_INFO {"STMT_FINALIZE_DELETE", NULL}
-#define STMT_171 \
+#define STMT_FINALIZE_DELETE 172
+#define STMT_172_INFO {"STMT_FINALIZE_DELETE", NULL}
+#define STMT_172 \
"DROP TABLE IF EXISTS delete_list " \
""
-#define STMT_CREATE_UPDATE_MOVE_LIST 172
-#define STMT_172_INFO {"STMT_CREATE_UPDATE_MOVE_LIST", NULL}
-#define STMT_172 \
+#define STMT_CREATE_UPDATE_MOVE_LIST 173
+#define STMT_173_INFO {"STMT_CREATE_UPDATE_MOVE_LIST", NULL}
+#define STMT_173 \
"DROP TABLE IF EXISTS update_move_list; " \
"CREATE TEMPORARY TABLE update_move_list ( " \
" local_relpath TEXT PRIMARY KEY NOT NULL UNIQUE, " \
" action INTEGER NOT NULL, " \
- " kind INTEGER NOT NULL, " \
+ " kind TEXT NOT NULL, " \
" content_state INTEGER NOT NULL, " \
" prop_state INTEGER NOT NULL " \
" ) " \
""
-#define STMT_INSERT_UPDATE_MOVE_LIST 173
-#define STMT_173_INFO {"STMT_INSERT_UPDATE_MOVE_LIST", NULL}
-#define STMT_173 \
+#define STMT_INSERT_UPDATE_MOVE_LIST 174
+#define STMT_174_INFO {"STMT_INSERT_UPDATE_MOVE_LIST", NULL}
+#define STMT_174 \
"INSERT INTO update_move_list(local_relpath, action, kind, content_state, " \
" prop_state) " \
"VALUES (?1, ?2, ?3, ?4, ?5) " \
""
-#define STMT_SELECT_UPDATE_MOVE_LIST 174
-#define STMT_174_INFO {"STMT_SELECT_UPDATE_MOVE_LIST", NULL}
-#define STMT_174 \
+#define STMT_SELECT_UPDATE_MOVE_LIST 175
+#define STMT_175_INFO {"STMT_SELECT_UPDATE_MOVE_LIST", NULL}
+#define STMT_175 \
"SELECT local_relpath, action, kind, content_state, prop_state " \
"FROM update_move_list " \
"ORDER BY local_relpath " \
""
-#define STMT_FINALIZE_UPDATE_MOVE 175
-#define STMT_175_INFO {"STMT_FINALIZE_UPDATE_MOVE", NULL}
-#define STMT_175 \
+#define STMT_FINALIZE_UPDATE_MOVE 176
+#define STMT_176_INFO {"STMT_FINALIZE_UPDATE_MOVE", NULL}
+#define STMT_176 \
"DROP TABLE IF EXISTS update_move_list " \
""
-#define STMT_SELECT_MIN_MAX_REVISIONS 176
-#define STMT_176_INFO {"STMT_SELECT_MIN_MAX_REVISIONS", NULL}
-#define STMT_176 \
+#define STMT_MOVE_NOTIFY_TO_REVERT 177
+#define STMT_177_INFO {"STMT_MOVE_NOTIFY_TO_REVERT", NULL}
+#define STMT_177 \
+ "INSERT INTO revert_list (local_relpath, notify, kind, actual) " \
+ " SELECT local_relpath, 2, kind, 1 FROM update_move_list; " \
+ "DROP TABLE update_move_list " \
+ ""
+
+#define STMT_SELECT_MIN_MAX_REVISIONS 178
+#define STMT_178_INFO {"STMT_SELECT_MIN_MAX_REVISIONS", NULL}
+#define STMT_178 \
"SELECT MIN(revision), MAX(revision), " \
" MIN(changed_revision), MAX(changed_revision) FROM nodes " \
" WHERE wc_id = ?1 " \
@@ -1854,9 +1943,9 @@
" AND op_depth = 0 " \
""
-#define STMT_HAS_SPARSE_NODES 177
-#define STMT_177_INFO {"STMT_HAS_SPARSE_NODES", NULL}
-#define STMT_177 \
+#define STMT_HAS_SPARSE_NODES 179
+#define STMT_179_INFO {"STMT_HAS_SPARSE_NODES", NULL}
+#define STMT_179 \
"SELECT 1 FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -1868,9 +1957,9 @@
"LIMIT 1 " \
""
-#define STMT_SUBTREE_HAS_TREE_MODIFICATIONS 178
-#define STMT_178_INFO {"STMT_SUBTREE_HAS_TREE_MODIFICATIONS", NULL}
-#define STMT_178 \
+#define STMT_SUBTREE_HAS_TREE_MODIFICATIONS 180
+#define STMT_180_INFO {"STMT_SUBTREE_HAS_TREE_MODIFICATIONS", NULL}
+#define STMT_180 \
"SELECT 1 FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -1879,9 +1968,9 @@
"LIMIT 1 " \
""
-#define STMT_SUBTREE_HAS_PROP_MODIFICATIONS 179
-#define STMT_179_INFO {"STMT_SUBTREE_HAS_PROP_MODIFICATIONS", NULL}
-#define STMT_179 \
+#define STMT_SUBTREE_HAS_PROP_MODIFICATIONS 181
+#define STMT_181_INFO {"STMT_SUBTREE_HAS_PROP_MODIFICATIONS", NULL}
+#define STMT_181 \
"SELECT 1 FROM actual_node " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -1890,9 +1979,9 @@
"LIMIT 1 " \
""
-#define STMT_HAS_SWITCHED 180
-#define STMT_180_INFO {"STMT_HAS_SWITCHED", NULL}
-#define STMT_180 \
+#define STMT_HAS_SWITCHED 182
+#define STMT_182_INFO {"STMT_HAS_SWITCHED", NULL}
+#define STMT_182 \
"SELECT 1 " \
"FROM nodes " \
"WHERE wc_id = ?1 " \
@@ -1904,60 +1993,47 @@
"LIMIT 1 " \
""
-#define STMT_SELECT_BASE_FILES_RECURSIVE 181
-#define STMT_181_INFO {"STMT_SELECT_BASE_FILES_RECURSIVE", NULL}
-#define STMT_181 \
- "SELECT local_relpath, translated_size, last_mod_time FROM nodes AS n " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 " \
- " OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND op_depth = 0 " \
- " AND kind='file' " \
- " AND presence='normal' " \
- " AND file_external IS NULL " \
- ""
-
-#define STMT_SELECT_MOVED_FROM_RELPATH 182
-#define STMT_182_INFO {"STMT_SELECT_MOVED_FROM_RELPATH", NULL}
-#define STMT_182 \
+#define STMT_SELECT_MOVED_FROM_RELPATH 183
+#define STMT_183_INFO {"STMT_SELECT_MOVED_FROM_RELPATH", NULL}
+#define STMT_183 \
"SELECT local_relpath, op_depth FROM nodes " \
"WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0 " \
""
-#define STMT_UPDATE_MOVED_TO_RELPATH 183
-#define STMT_183_INFO {"STMT_UPDATE_MOVED_TO_RELPATH", NULL}
-#define STMT_183 \
+#define STMT_UPDATE_MOVED_TO_RELPATH 184
+#define STMT_184_INFO {"STMT_UPDATE_MOVED_TO_RELPATH", NULL}
+#define STMT_184 \
"UPDATE nodes SET moved_to = ?4 " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_CLEAR_MOVED_TO_RELPATH 184
-#define STMT_184_INFO {"STMT_CLEAR_MOVED_TO_RELPATH", NULL}
-#define STMT_184 \
+#define STMT_CLEAR_MOVED_TO_RELPATH 185
+#define STMT_185_INFO {"STMT_CLEAR_MOVED_TO_RELPATH", NULL}
+#define STMT_185 \
"UPDATE nodes SET moved_to = NULL " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3 " \
""
-#define STMT_CLEAR_MOVED_HERE_RECURSIVE 185
-#define STMT_185_INFO {"STMT_CLEAR_MOVED_HERE_RECURSIVE", NULL}
-#define STMT_185 \
+#define STMT_CLEAR_MOVED_HERE_RECURSIVE 186
+#define STMT_186_INFO {"STMT_CLEAR_MOVED_HERE_RECURSIVE", NULL}
+#define STMT_186 \
"UPDATE nodes SET moved_here = NULL " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
" AND op_depth = ?3 " \
""
-#define STMT_SELECT_MOVED_HERE_CHILDREN 186
-#define STMT_186_INFO {"STMT_SELECT_MOVED_HERE_CHILDREN", NULL}
-#define STMT_186 \
+#define STMT_SELECT_MOVED_HERE_CHILDREN 187
+#define STMT_187_INFO {"STMT_SELECT_MOVED_HERE_CHILDREN", NULL}
+#define STMT_187 \
"SELECT moved_to, local_relpath FROM nodes " \
"WHERE wc_id = ?1 AND op_depth > 0 " \
" AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_SELECT_MOVED_FOR_DELETE 187
-#define STMT_187_INFO {"STMT_SELECT_MOVED_FOR_DELETE", NULL}
-#define STMT_187 \
+#define STMT_SELECT_MOVED_FOR_DELETE 188
+#define STMT_188_INFO {"STMT_SELECT_MOVED_FOR_DELETE", NULL}
+#define STMT_188 \
"SELECT local_relpath, moved_to, op_depth, " \
" (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r " \
" WHERE r.wc_id = ?1 " \
@@ -1971,9 +2047,9 @@
" AND op_depth >= ?3 " \
""
-#define STMT_SELECT_MOVED_FROM_FOR_DELETE 188
-#define STMT_188_INFO {"STMT_SELECT_MOVED_FROM_FOR_DELETE", NULL}
-#define STMT_188 \
+#define STMT_SELECT_MOVED_FROM_FOR_DELETE 189
+#define STMT_189_INFO {"STMT_SELECT_MOVED_FROM_FOR_DELETE", NULL}
+#define STMT_189 \
"SELECT local_relpath, op_depth, " \
" (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r " \
" WHERE r.wc_id = ?1 " \
@@ -1984,48 +2060,48 @@
"WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0 " \
""
-#define STMT_UPDATE_MOVED_TO_DESCENDANTS 189
-#define STMT_189_INFO {"STMT_UPDATE_MOVED_TO_DESCENDANTS", NULL}
-#define STMT_189 \
+#define STMT_UPDATE_MOVED_TO_DESCENDANTS 190
+#define STMT_190_INFO {"STMT_UPDATE_MOVED_TO_DESCENDANTS", NULL}
+#define STMT_190 \
"UPDATE nodes SET moved_to = (CASE WHEN (?2) = '' THEN (CASE WHEN (?3) = '' THEN (moved_to) WHEN (moved_to) = '' THEN (?3) ELSE (?3) || '/' || (moved_to) END) WHEN (?3) = '' THEN (CASE WHEN (?2) = '' THEN (moved_to) WHEN SUBSTR((moved_to), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(moved_to) THEN '' WHEN SUBSTR((moved_to), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((moved_to), LENGTH(?2)+2) END END) WHEN SUBSTR((moved_to), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(moved_to) THEN (?3) WHEN SUBSTR((moved_to), LENGTH(?2)+1, 1) = '/' THEN (?3) || SUBSTR((moved_to), LENGTH(?2)+1) END END) " \
" WHERE wc_id = ?1 " \
" AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_CLEAR_MOVED_TO_DESCENDANTS 190
-#define STMT_190_INFO {"STMT_CLEAR_MOVED_TO_DESCENDANTS", NULL}
-#define STMT_190 \
+#define STMT_CLEAR_MOVED_TO_DESCENDANTS 191
+#define STMT_191_INFO {"STMT_CLEAR_MOVED_TO_DESCENDANTS", NULL}
+#define STMT_191 \
"UPDATE nodes SET moved_to = NULL " \
" WHERE wc_id = ?1 " \
" AND (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_SELECT_MOVED_PAIR2 191
-#define STMT_191_INFO {"STMT_SELECT_MOVED_PAIR2", NULL}
-#define STMT_191 \
- "SELECT local_relpath, moved_to, op_depth FROM nodes " \
- "WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
- " AND moved_to IS NOT NULL " \
- " AND NOT (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth >= (SELECT MAX(op_depth) FROM nodes o " \
- " WHERE o.wc_id = ?1 " \
- " AND o.local_relpath = ?2) " \
- ""
-
#define STMT_SELECT_MOVED_PAIR3 192
#define STMT_192_INFO {"STMT_SELECT_MOVED_PAIR3", NULL}
#define STMT_192 \
- "SELECT local_relpath, moved_to, op_depth, kind FROM nodes " \
- "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 " \
- " AND moved_to IS NOT NULL " \
+ "SELECT n.local_relpath, d.moved_to, d.op_depth, n.kind " \
+ "FROM nodes n " \
+ "JOIN nodes d ON d.wc_id = ?1 AND d.local_relpath = n.local_relpath " \
+ " AND d.op_depth = (SELECT MIN(dd.op_depth) " \
+ " FROM nodes dd " \
+ " WHERE dd.wc_id = ?1 " \
+ " AND dd.local_relpath = d.local_relpath " \
+ " AND dd.op_depth > ?3) " \
+ "WHERE n.wc_id = ?1 AND n.local_relpath = ?2 AND n.op_depth = ?3 " \
+ " AND d.moved_to IS NOT NULL " \
"UNION ALL " \
- "SELECT local_relpath, moved_to, op_depth, kind FROM nodes " \
- "WHERE wc_id = ?1 " \
- " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth > ?3 " \
- " AND moved_to IS NOT NULL " \
- "ORDER BY local_relpath, op_depth " \
+ "SELECT n.local_relpath, d.moved_to, d.op_depth, n.kind " \
+ "FROM nodes n " \
+ "JOIN nodes d ON d.wc_id = ?1 AND d.local_relpath = n.local_relpath " \
+ " AND d.op_depth = (SELECT MIN(dd.op_depth) " \
+ " FROM nodes dd " \
+ " WHERE dd.wc_id = ?1 " \
+ " AND dd.local_relpath = d.local_relpath " \
+ " AND dd.op_depth > ?3) " \
+ "WHERE n.wc_id = ?1 AND (((n.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((n.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
+ " AND n.op_depth = ?3 " \
+ " AND d.moved_to IS NOT NULL " \
+ "ORDER BY n.local_relpath " \
""
#define STMT_SELECT_MOVED_OUTSIDE 193
@@ -2039,44 +2115,27 @@
" AND NOT (((moved_to) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((moved_to) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
""
-#define STMT_SELECT_OP_DEPTH_MOVED_PAIR 194
-#define STMT_194_INFO {"STMT_SELECT_OP_DEPTH_MOVED_PAIR", NULL}
+#define STMT_SELECT_MOVED_DESCENDANTS_SRC 194
+#define STMT_194_INFO {"STMT_SELECT_MOVED_DESCENDANTS_SRC", NULL}
#define STMT_194 \
- "SELECT n.local_relpath, n.moved_to, " \
- " (SELECT o.repos_path FROM nodes AS o " \
- " WHERE o.wc_id = n.wc_id " \
- " AND o.local_relpath = n.local_relpath " \
- " AND o.op_depth < ?3 ORDER BY o.op_depth DESC LIMIT 1) " \
- "FROM nodes AS n " \
- "WHERE n.wc_id = ?1 " \
- " AND (((n.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((n.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND n.op_depth = ?3 " \
- " AND n.moved_to IS NOT NULL " \
- ""
-
-#define STMT_SELECT_MOVED_DESCENDANTS 195
-#define STMT_195_INFO {"STMT_SELECT_MOVED_DESCENDANTS", NULL}
+ "SELECT s.op_depth, n.local_relpath, n.kind, n.repos_path, s.moved_to " \
+ "FROM nodes n " \
+ "JOIN nodes s ON s.wc_id = n.wc_id AND s.local_relpath = n.local_relpath " \
+ " AND s.op_depth = (SELECT MIN(d.op_depth) " \
+ " FROM nodes d " \
+ " WHERE d.wc_id = ?1 " \
+ " AND d.local_relpath = s.local_relpath " \
+ " AND d.op_depth > ?3) " \
+ "WHERE n.wc_id = ?1 AND n.op_depth = ?3 " \
+ " AND (n.local_relpath = ?2 OR (((n.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((n.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND s.moved_to IS NOT NULL " \
+ ""
+
+#define STMT_COMMIT_UPDATE_ORIGIN 195
+#define STMT_195_INFO {"STMT_COMMIT_UPDATE_ORIGIN", NULL}
#define STMT_195 \
- "SELECT n.local_relpath, h.moved_to " \
- "FROM nodes n, nodes h " \
- "WHERE n.wc_id = ?1 " \
- " AND h.wc_id = ?1 " \
- " AND (((n.local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((n.local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND h.local_relpath = n.local_relpath " \
- " AND n.op_depth = ?3 " \
- " AND h.op_depth = (SELECT MIN(o.op_depth) " \
- " FROM nodes o " \
- " WHERE o.wc_id = ?1 " \
- " AND o.local_relpath = n.local_relpath " \
- " AND o.op_depth > ?3) " \
- " AND h.moved_to IS NOT NULL " \
- ""
-
-#define STMT_COMMIT_UPDATE_ORIGIN 196
-#define STMT_196_INFO {"STMT_COMMIT_UPDATE_ORIGIN", NULL}
-#define STMT_196 \
"UPDATE nodes SET repos_id = ?4, " \
- " repos_path = ?5 || SUBSTR(local_relpath, LENGTH(?2)+1), " \
+ " repos_path = (CASE WHEN (?2) = '' THEN (CASE WHEN (?5) = '' THEN (local_relpath) WHEN (local_relpath) = '' THEN (?5) ELSE (?5) || '/' || (local_relpath) END) WHEN (?5) = '' THEN (CASE WHEN (?2) = '' THEN (local_relpath) WHEN SUBSTR((local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(local_relpath) THEN '' WHEN SUBSTR((local_relpath), LENGTH(?2)+1, 1) = '/' THEN SUBSTR((local_relpath), LENGTH(?2)+2) END END) WHEN SUBSTR((local_relpath), 1, LENGTH(?2)) = (?2) THEN CASE WHEN LENGTH(?2) = LENGTH(local_relpath) THEN (?5) WHEN SUBSTR((local_relpath), LENGTH(?2)+1, 1) = '/' THEN (?5) || SUBSTR((local_relpath), LENGTH(?2)+1) END END), " \
" revision = ?6 " \
"WHERE wc_id = ?1 " \
" AND (local_relpath = ?2 " \
@@ -2084,16 +2143,16 @@
" AND op_depth = ?3 " \
""
-#define STMT_HAS_LAYER_BETWEEN 197
-#define STMT_197_INFO {"STMT_HAS_LAYER_BETWEEN", NULL}
-#define STMT_197 \
+#define STMT_HAS_LAYER_BETWEEN 196
+#define STMT_196_INFO {"STMT_HAS_LAYER_BETWEEN", NULL}
+#define STMT_196 \
"SELECT 1 FROM NODES " \
"WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 AND op_depth < ?4 " \
""
-#define STMT_SELECT_REPOS_PATH_REVISION 198
-#define STMT_198_INFO {"STMT_SELECT_REPOS_PATH_REVISION", NULL}
-#define STMT_198 \
+#define STMT_SELECT_REPOS_PATH_REVISION 197
+#define STMT_197_INFO {"STMT_SELECT_REPOS_PATH_REVISION", NULL}
+#define STMT_197 \
"SELECT local_relpath, repos_path, revision FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -2101,50 +2160,52 @@
"ORDER BY local_relpath " \
""
-#define STMT_SELECT_HAS_NON_FILE_CHILDREN 199
-#define STMT_199_INFO {"STMT_SELECT_HAS_NON_FILE_CHILDREN", NULL}
-#define STMT_199 \
+#define STMT_SELECT_HAS_NON_FILE_CHILDREN 198
+#define STMT_198_INFO {"STMT_SELECT_HAS_NON_FILE_CHILDREN", NULL}
+#define STMT_198 \
"SELECT 1 FROM nodes " \
- "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0 AND kind != 'file' " \
+ "WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3 AND kind != 'file' " \
+ "LIMIT 1 " \
""
-#define STMT_SELECT_HAS_GRANDCHILDREN 200
-#define STMT_200_INFO {"STMT_SELECT_HAS_GRANDCHILDREN", NULL}
-#define STMT_200 \
+#define STMT_SELECT_HAS_GRANDCHILDREN 199
+#define STMT_199_INFO {"STMT_SELECT_HAS_GRANDCHILDREN", NULL}
+#define STMT_199 \
"SELECT 1 FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((parent_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((parent_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
- " AND op_depth = 0 " \
+ " AND op_depth = ?3 " \
" AND file_external IS NULL " \
+ "LIMIT 1 " \
""
-#define STMT_SELECT_ALL_NODES 201
-#define STMT_201_INFO {"STMT_SELECT_ALL_NODES", NULL}
-#define STMT_201 \
+#define STMT_SELECT_ALL_NODES 200
+#define STMT_200_INFO {"STMT_SELECT_ALL_NODES", NULL}
+#define STMT_200 \
"SELECT op_depth, local_relpath, parent_relpath, file_external FROM nodes " \
"WHERE wc_id = ?1 " \
""
-#define STMT_SELECT_IPROPS 202
-#define STMT_202_INFO {"STMT_SELECT_IPROPS", NULL}
-#define STMT_202 \
+#define STMT_SELECT_IPROPS 201
+#define STMT_201_INFO {"STMT_SELECT_IPROPS", NULL}
+#define STMT_201 \
"SELECT inherited_props FROM nodes " \
"WHERE wc_id = ?1 " \
" AND local_relpath = ?2 " \
" AND op_depth = 0 " \
""
-#define STMT_UPDATE_IPROP 203
-#define STMT_203_INFO {"STMT_UPDATE_IPROP", NULL}
-#define STMT_203 \
+#define STMT_UPDATE_IPROP 202
+#define STMT_202_INFO {"STMT_UPDATE_IPROP", NULL}
+#define STMT_202 \
"UPDATE nodes " \
"SET inherited_props = ?3 " \
"WHERE (wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0) " \
""
-#define STMT_SELECT_IPROPS_NODE 204
-#define STMT_204_INFO {"STMT_SELECT_IPROPS_NODE", NULL}
-#define STMT_204 \
+#define STMT_SELECT_IPROPS_NODE 203
+#define STMT_203_INFO {"STMT_SELECT_IPROPS_NODE", NULL}
+#define STMT_203 \
"SELECT local_relpath, repos_path FROM nodes " \
"WHERE wc_id = ?1 " \
" AND local_relpath = ?2 " \
@@ -2152,9 +2213,9 @@
" AND (inherited_props not null) " \
""
-#define STMT_SELECT_IPROPS_RECURSIVE 205
-#define STMT_205_INFO {"STMT_SELECT_IPROPS_RECURSIVE", NULL}
-#define STMT_205 \
+#define STMT_SELECT_IPROPS_RECURSIVE 204
+#define STMT_204_INFO {"STMT_SELECT_IPROPS_RECURSIVE", NULL}
+#define STMT_204 \
"SELECT local_relpath, repos_path FROM nodes " \
"WHERE wc_id = ?1 " \
" AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
@@ -2162,9 +2223,9 @@
" AND (inherited_props not null) " \
""
-#define STMT_SELECT_IPROPS_CHILDREN 206
-#define STMT_206_INFO {"STMT_SELECT_IPROPS_CHILDREN", NULL}
-#define STMT_206 \
+#define STMT_SELECT_IPROPS_CHILDREN 205
+#define STMT_205_INFO {"STMT_SELECT_IPROPS_CHILDREN", NULL}
+#define STMT_205 \
"SELECT local_relpath, repos_path FROM nodes " \
"WHERE wc_id = ?1 " \
" AND parent_relpath = ?2 " \
@@ -2172,16 +2233,16 @@
" AND (inherited_props not null) " \
""
-#define STMT_HAVE_STAT1_TABLE 207
-#define STMT_207_INFO {"STMT_HAVE_STAT1_TABLE", NULL}
-#define STMT_207 \
+#define STMT_HAVE_STAT1_TABLE 206
+#define STMT_206_INFO {"STMT_HAVE_STAT1_TABLE", NULL}
+#define STMT_206 \
"SELECT 1 FROM sqlite_master WHERE name='sqlite_stat1' AND type='table' " \
"LIMIT 1 " \
""
-#define STMT_CREATE_SCHEMA 208
-#define STMT_208_INFO {"STMT_CREATE_SCHEMA", NULL}
-#define STMT_208 \
+#define STMT_CREATE_SCHEMA 207
+#define STMT_207_INFO {"STMT_CREATE_SCHEMA", NULL}
+#define STMT_207 \
"CREATE TABLE REPOSITORY ( " \
" id INTEGER PRIMARY KEY AUTOINCREMENT, " \
" root TEXT UNIQUE NOT NULL, " \
@@ -2246,9 +2307,9 @@
"; " \
""
-#define STMT_CREATE_NODES 209
-#define STMT_209_INFO {"STMT_CREATE_NODES", NULL}
-#define STMT_209 \
+#define STMT_CREATE_NODES 208
+#define STMT_208_INFO {"STMT_CREATE_NODES", NULL}
+#define STMT_208 \
"CREATE TABLE NODES ( " \
" wc_id INTEGER NOT NULL REFERENCES WCROOT (id), " \
" local_relpath TEXT NOT NULL, " \
@@ -2288,9 +2349,9 @@
" WHERE op_depth = 0; " \
""
-#define STMT_CREATE_NODES_TRIGGERS 210
-#define STMT_210_INFO {"STMT_CREATE_NODES_TRIGGERS", NULL}
-#define STMT_210 \
+#define STMT_CREATE_NODES_TRIGGERS 209
+#define STMT_209_INFO {"STMT_CREATE_NODES_TRIGGERS", NULL}
+#define STMT_209 \
"CREATE TRIGGER nodes_insert_trigger " \
"AFTER INSERT ON nodes " \
"WHEN NEW.checksum IS NOT NULL " \
@@ -2316,9 +2377,9 @@
"END; " \
""
-#define STMT_CREATE_EXTERNALS 211
-#define STMT_211_INFO {"STMT_CREATE_EXTERNALS", NULL}
-#define STMT_211 \
+#define STMT_CREATE_EXTERNALS 210
+#define STMT_210_INFO {"STMT_CREATE_EXTERNALS", NULL}
+#define STMT_210 \
"CREATE TABLE EXTERNALS ( " \
" wc_id INTEGER NOT NULL REFERENCES WCROOT (id), " \
" local_relpath TEXT NOT NULL, " \
@@ -2337,9 +2398,9 @@
" local_relpath); " \
""
-#define STMT_INSTALL_SCHEMA_STATISTICS 212
-#define STMT_212_INFO {"STMT_INSTALL_SCHEMA_STATISTICS", NULL}
-#define STMT_212 \
+#define STMT_INSTALL_SCHEMA_STATISTICS 211
+#define STMT_211_INFO {"STMT_INSTALL_SCHEMA_STATISTICS", NULL}
+#define STMT_211 \
"ANALYZE sqlite_master; " \
"DELETE FROM sqlite_stat1 " \
"WHERE tbl in ('NODES', 'ACTUAL_NODE', 'LOCK', 'WC_LOCK', 'EXTERNALS'); " \
@@ -2364,9 +2425,9 @@
"ANALYZE sqlite_master; " \
""
-#define STMT_UPGRADE_TO_20 213
-#define STMT_213_INFO {"STMT_UPGRADE_TO_20", NULL}
-#define STMT_213 \
+#define STMT_UPGRADE_TO_20 212
+#define STMT_212_INFO {"STMT_UPGRADE_TO_20", NULL}
+#define STMT_212 \
"UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = BASE_NODE.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum); " \
@@ -2407,59 +2468,59 @@
"PRAGMA user_version = 20; " \
""
-#define STMT_UPGRADE_TO_21 214
-#define STMT_214_INFO {"STMT_UPGRADE_TO_21", NULL}
-#define STMT_214 \
+#define STMT_UPGRADE_TO_21 213
+#define STMT_213_INFO {"STMT_UPGRADE_TO_21", NULL}
+#define STMT_213 \
"PRAGMA user_version = 21; " \
""
-#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 215
-#define STMT_215_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
-#define STMT_215 \
+#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 214
+#define STMT_214_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
+#define STMT_214 \
"SELECT wc_id, local_relpath, tree_conflict_data " \
"FROM actual_node " \
"WHERE tree_conflict_data IS NOT NULL " \
""
-#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 216
-#define STMT_216_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
-#define STMT_216 \
+#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 215
+#define STMT_215_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
+#define STMT_215 \
"UPDATE actual_node SET tree_conflict_data = NULL " \
""
-#define STMT_UPGRADE_TO_22 217
-#define STMT_217_INFO {"STMT_UPGRADE_TO_22", NULL}
-#define STMT_217 \
+#define STMT_UPGRADE_TO_22 216
+#define STMT_216_INFO {"STMT_UPGRADE_TO_22", NULL}
+#define STMT_216 \
"UPDATE actual_node SET tree_conflict_data = conflict_data; " \
"UPDATE actual_node SET conflict_data = NULL; " \
"PRAGMA user_version = 22; " \
""
-#define STMT_UPGRADE_TO_23 218
-#define STMT_218_INFO {"STMT_UPGRADE_TO_23", NULL}
-#define STMT_218 \
+#define STMT_UPGRADE_TO_23 217
+#define STMT_217_INFO {"STMT_UPGRADE_TO_23", NULL}
+#define STMT_217 \
"PRAGMA user_version = 23; " \
""
-#define STMT_UPGRADE_23_HAS_WORKING_NODES 219
-#define STMT_219_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
-#define STMT_219 \
+#define STMT_UPGRADE_23_HAS_WORKING_NODES 218
+#define STMT_218_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
+#define STMT_218 \
"SELECT 1 FROM nodes WHERE op_depth > 0 " \
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_24 220
-#define STMT_220_INFO {"STMT_UPGRADE_TO_24", NULL}
-#define STMT_220 \
+#define STMT_UPGRADE_TO_24 219
+#define STMT_219_INFO {"STMT_UPGRADE_TO_24", NULL}
+#define STMT_219 \
"UPDATE pristine SET refcount = " \
" (SELECT COUNT(*) FROM nodes " \
" WHERE checksum = pristine.checksum ); " \
"PRAGMA user_version = 24; " \
""
-#define STMT_UPGRADE_TO_25 221
-#define STMT_221_INFO {"STMT_UPGRADE_TO_25", NULL}
-#define STMT_221 \
+#define STMT_UPGRADE_TO_25 220
+#define STMT_220_INFO {"STMT_UPGRADE_TO_25", NULL}
+#define STMT_220 \
"DROP VIEW IF EXISTS NODES_CURRENT; " \
"CREATE VIEW NODES_CURRENT AS " \
" SELECT * FROM nodes " \
@@ -2471,9 +2532,9 @@
"PRAGMA user_version = 25; " \
""
-#define STMT_UPGRADE_TO_26 222
-#define STMT_222_INFO {"STMT_UPGRADE_TO_26", NULL}
-#define STMT_222 \
+#define STMT_UPGRADE_TO_26 221
+#define STMT_221_INFO {"STMT_UPGRADE_TO_26", NULL}
+#define STMT_221 \
"DROP VIEW IF EXISTS NODES_BASE; " \
"CREATE VIEW NODES_BASE AS " \
" SELECT * FROM nodes " \
@@ -2481,15 +2542,15 @@
"PRAGMA user_version = 26; " \
""
-#define STMT_UPGRADE_TO_27 223
-#define STMT_223_INFO {"STMT_UPGRADE_TO_27", NULL}
-#define STMT_223 \
+#define STMT_UPGRADE_TO_27 222
+#define STMT_222_INFO {"STMT_UPGRADE_TO_27", NULL}
+#define STMT_222 \
"PRAGMA user_version = 27; " \
""
-#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 224
-#define STMT_224_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
-#define STMT_224 \
+#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 223
+#define STMT_223_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
+#define STMT_223 \
"SELECT 1 FROM actual_node " \
"WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL) " \
" AND (conflict_new IS NULL) AND (conflict_working IS NULL) " \
@@ -2497,18 +2558,18 @@
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_28 225
-#define STMT_225_INFO {"STMT_UPGRADE_TO_28", NULL}
-#define STMT_225 \
+#define STMT_UPGRADE_TO_28 224
+#define STMT_224_INFO {"STMT_UPGRADE_TO_28", NULL}
+#define STMT_224 \
"UPDATE NODES SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = nodes.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum); " \
"PRAGMA user_version = 28; " \
""
-#define STMT_UPGRADE_TO_29 226
-#define STMT_226_INFO {"STMT_UPGRADE_TO_29", NULL}
-#define STMT_226 \
+#define STMT_UPGRADE_TO_29 225
+#define STMT_225_INFO {"STMT_UPGRADE_TO_29", NULL}
+#define STMT_225 \
"DROP TRIGGER IF EXISTS nodes_update_checksum_trigger; " \
"DROP TRIGGER IF EXISTS nodes_insert_trigger; " \
"DROP TRIGGER IF EXISTS nodes_delete_trigger; " \
@@ -2538,9 +2599,9 @@
"PRAGMA user_version = 29; " \
""
-#define STMT_UPGRADE_TO_30 227
-#define STMT_227_INFO {"STMT_UPGRADE_TO_30", NULL}
-#define STMT_227 \
+#define STMT_UPGRADE_TO_30 226
+#define STMT_226_INFO {"STMT_UPGRADE_TO_30", NULL}
+#define STMT_226 \
"CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED " \
"ON NODES (wc_id, moved_to, op_depth); " \
"CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum); " \
@@ -2548,9 +2609,9 @@
"UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL; " \
""
-#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 228
-#define STMT_228_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
-#define STMT_228 \
+#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 227
+#define STMT_227_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
+#define STMT_227 \
"SELECT wc_id, local_relpath, " \
" conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data " \
"FROM actual_node " \
@@ -2562,24 +2623,24 @@
"ORDER by wc_id, local_relpath " \
""
-#define STMT_UPGRADE_30_SET_CONFLICT 229
-#define STMT_229_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
-#define STMT_229 \
+#define STMT_UPGRADE_30_SET_CONFLICT 228
+#define STMT_228_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
+#define STMT_228 \
"UPDATE actual_node SET conflict_data = ?3, conflict_old = NULL, " \
" conflict_working = NULL, conflict_new = NULL, prop_reject = NULL, " \
" tree_conflict_data = NULL " \
"WHERE wc_id = ?1 and local_relpath = ?2 " \
""
-#define STMT_UPGRADE_TO_31_ALTER_TABLE 230
-#define STMT_230_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
-#define STMT_230 \
+#define STMT_UPGRADE_TO_31_ALTER_TABLE 229
+#define STMT_229_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
+#define STMT_229 \
"ALTER TABLE NODES ADD COLUMN inherited_props BLOB; " \
""
-#define STMT_UPGRADE_TO_31_FINALIZE 231
-#define STMT_231_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
-#define STMT_231 \
+#define STMT_UPGRADE_TO_31_FINALIZE 230
+#define STMT_230_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
+#define STMT_230 \
"DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \
"DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \
"DROP INDEX I_NODES_PARENT; " \
@@ -2591,9 +2652,9 @@
"PRAGMA user_version = 31; " \
""
-#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 232
-#define STMT_232_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
-#define STMT_232 \
+#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 231
+#define STMT_231_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
+#define STMT_231 \
"SELECT l.wc_id, l.local_relpath FROM nodes as l " \
"LEFT OUTER JOIN nodes as r " \
"ON l.wc_id = r.wc_id " \
@@ -2605,9 +2666,9 @@
" OR (l.repos_path IS NOT (CASE WHEN (r.local_relpath) = '' THEN (CASE WHEN (r.repos_path) = '' THEN (l.local_relpath) WHEN (l.local_relpath) = '' THEN (r.repos_path) ELSE (r.repos_path) || '/' || (l.local_relpath) END) WHEN (r.repos_path) = '' THEN (CASE WHEN (r.local_relpath) = '' THEN (l.local_relpath) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN '' WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+2) END END) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN (r.repos_path) WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN (r.repos_path) || SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1) END END))) " \
""
-#define STMT_UPGRADE_TO_32 233
-#define STMT_233_INFO {"STMT_UPGRADE_TO_32", NULL}
-#define STMT_233 \
+#define STMT_UPGRADE_TO_32 232
+#define STMT_232_INFO {"STMT_UPGRADE_TO_32", NULL}
+#define STMT_232 \
"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); " \
@@ -2660,9 +2721,9 @@
"DROP TABLE ACTUAL_NODE_BACKUP; " \
""
-#define STMT_VERIFICATION_TRIGGERS 234
-#define STMT_234_INFO {"STMT_VERIFICATION_TRIGGERS", NULL}
-#define STMT_234 \
+#define STMT_VERIFICATION_TRIGGERS 233
+#define STMT_233_INFO {"STMT_VERIFICATION_TRIGGERS", NULL}
+#define STMT_233 \
"CREATE TEMPORARY TRIGGER no_repository_updates BEFORE UPDATE ON repository " \
"BEGIN " \
" SELECT RAISE(FAIL, 'Updates to REPOSITORY are not allowed.'); " \
@@ -2701,6 +2762,179 @@
"END; " \
""
+#define STMT_STATIC_VERIFY 234
+#define STMT_234_INFO {"STMT_STATIC_VERIFY", NULL}
+#define STMT_234 \
+ "SELECT local_relpath, op_depth, 1, 'Invalid parent relpath set in NODES' " \
+ "FROM nodes n WHERE local_relpath != '' " \
+ " AND (parent_relpath IS NULL " \
+ " OR NOT (((local_relpath) > (CASE (parent_relpath) WHEN '' THEN '' ELSE (parent_relpath) || '/' END)) AND ((local_relpath) < CASE (parent_relpath) WHEN '' THEN X'FFFF' ELSE (parent_relpath) || '0' END)) " \
+ " OR relpath_depth(local_relpath) != relpath_depth(parent_relpath)+1) " \
+ "UNION ALL " \
+ "SELECT local_relpath, -1, 2, 'Invalid parent relpath set in ACTUAL' " \
+ "FROM actual_node a WHERE local_relpath != '' " \
+ " AND (parent_relpath IS NULL " \
+ " OR NOT (((local_relpath) > (CASE (parent_relpath) WHEN '' THEN '' ELSE (parent_relpath) || '/' END)) AND ((local_relpath) < CASE (parent_relpath) WHEN '' THEN X'FFFF' ELSE (parent_relpath) || '0' END)) " \
+ " OR relpath_depth(local_relpath) != relpath_depth(parent_relpath)+1) " \
+ "UNION ALL " \
+ "SELECT local_relpath, -1, 10, 'No ancestor in ACTUAL' " \
+ "FROM actual_node a WHERE local_relpath != '' " \
+ " AND NOT EXISTS(SELECT 1 from nodes i " \
+ " WHERE i.wc_id=a.wc_id " \
+ " AND i.local_relpath=a.parent_relpath) " \
+ " AND NOT EXISTS(SELECT 1 from nodes i " \
+ " WHERE i.wc_id=a.wc_id " \
+ " AND i.local_relpath=a.local_relpath) " \
+ "UNION ALL " \
+ "SELECT a.local_relpath, -1, 11, 'Bad or Unneeded actual data' " \
+ "FROM actual_node a " \
+ "LEFT JOIN nodes n on n.wc_id = a.wc_id AND n.local_relpath = a.local_relpath " \
+ " AND n.op_depth = (SELECT MAX(op_depth) from nodes i " \
+ " WHERE i.wc_id=a.wc_id AND i.local_relpath=a.local_relpath) " \
+ "WHERE (a.properties IS NOT NULL " \
+ " AND (n.presence IS NULL " \
+ " OR n.presence NOT IN ('normal', 'incomplete'))) " \
+ " OR (a.changelist IS NOT NULL AND (n.kind IS NOT NULL AND n.kind != 'file')) " \
+ " OR (a.conflict_data IS NULL AND a.properties IS NULL AND a.changelist IS NULL) " \
+ " AND NOT EXISTS(SELECT 1 from nodes i " \
+ " WHERE i.wc_id=a.wc_id " \
+ " AND i.local_relpath=a.parent_relpath) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 20, 'No ancestor in NODES' " \
+ "FROM nodes n WHERE local_relpath != '' " \
+ " AND file_external IS NULL " \
+ " AND NOT EXISTS(SELECT 1 from nodes i " \
+ " WHERE i.wc_id=n.wc_id " \
+ " AND i.local_relpath=n.parent_relpath " \
+ " AND i.op_depth <= n.op_depth) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 21, 'Unneeded node data' " \
+ "FROM nodes " \
+ "WHERE presence NOT IN ('normal', 'incomplete') " \
+ "AND (properties IS NOT NULL " \
+ " OR checksum IS NOT NULL " \
+ " OR depth IS NOT NULL " \
+ " OR symlink_target IS NOT NULL " \
+ " OR changed_revision IS NOT NULL " \
+ " OR (changed_date IS NOT NULL AND changed_date != 0) " \
+ " OR changed_author IS NOT NULL " \
+ " OR translated_size IS NOT NULL " \
+ " OR last_mod_time IS NOT NULL " \
+ " OR dav_cache IS NOT NULL " \
+ " OR file_external IS NOT NULL " \
+ " OR inherited_props IS NOT NULL) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 22, 'Unneeded base-deleted node data' " \
+ "FROM nodes " \
+ "WHERE presence IN ('base-deleted') " \
+ "AND (repos_id IS NOT NULL " \
+ " OR repos_path IS NOT NULL " \
+ " OR revision IS NOT NULL) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 23, 'Kind specific data invalid on normal' " \
+ "FROM nodes " \
+ "WHERE presence IN ('normal', 'incomplete') " \
+ "AND (kind IS NULL " \
+ " OR (repos_path IS NULL " \
+ " AND (properties IS NOT NULL " \
+ " OR changed_revision IS NOT NULL " \
+ " OR changed_author IS NOT NULL " \
+ " OR (changed_date IS NOT NULL AND changed_date != 0))) " \
+ " OR (CASE WHEN kind = 'file' AND repos_path IS NOT NULL " \
+ " THEN checksum IS NULL " \
+ " ELSE checksum IS NOT NULL END) " \
+ " OR (CASE WHEN kind = 'dir' THEN depth IS NULL " \
+ " ELSE depth IS NOT NULL END) " \
+ " OR (CASE WHEN kind = 'symlink' THEN symlink_target IS NULL " \
+ " ELSE symlink_target IS NOT NULL END)) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 24, 'Invalid op-depth for local add' " \
+ "FROM nodes " \
+ "WHERE presence IN ('normal', 'incomplete') " \
+ " AND repos_path IS NULL " \
+ " AND op_depth != relpath_depth(local_relpath) " \
+ "UNION ALL " \
+ "SELECT local_relpath, op_depth, 25, 'Node missing op-depth ancestor' " \
+ "FROM nodes n " \
+ "WHERE op_depth < relpath_depth(local_relpath) " \
+ " AND file_external IS NULL " \
+ " AND NOT EXISTS(SELECT 1 FROM nodes p " \
+ " WHERE p.wc_id=n.wc_id AND p.local_relpath=n.parent_relpath " \
+ " AND p.op_depth=n.op_depth " \
+ " AND (p.presence IN ('normal', 'incomplete') " \
+ " OR (p.presence IN ('base-deleted', 'not-present') " \
+ " AND n.presence = 'base-deleted'))) " \
+ "UNION ALL " \
+ "SELECT n.local_relpath, n.op_depth, 26, 'Copied descendant mismatch' " \
+ "FROM nodes n " \
+ "JOIN nodes p " \
+ " ON p.wc_id=n.wc_id AND p.local_relpath=n.parent_relpath " \
+ " AND n.op_depth=p.op_depth " \
+ "WHERE n.op_depth > 0 AND n.presence IN ('normal', 'incomplete') " \
+ " AND (n.repos_id != p.repos_id " \
+ " OR n.repos_path != " \
+ " (CASE WHEN (n.parent_relpath) = '' THEN (CASE WHEN (p.repos_path) = '' THEN (n.local_relpath) WHEN (n.local_relpath) = '' THEN (p.repos_path) ELSE (p.repos_path) || '/' || (n.local_relpath) END) WHEN (p.repos_path) = '' THEN (CASE WHEN (n.parent_relpath) = '' THEN (n.local_relpath) WHEN SUBSTR((n.local_relpath), 1, LENGTH(n.parent_relpath)) = (n.parent_relpath) THEN CASE WHEN LENGTH(n.parent_relpath) = LENGTH(n.local_relpath) THEN '' WHEN SUBSTR((n.local_relpath), LENGTH(n.parent_relpath)+1, 1) = '/' THEN SUBSTR((n.local_relpath), LENGTH(n.parent_relpath)+2) END END) WHEN SUBSTR((n.local_relpath), 1, LENGTH(n.parent_relpath)) = (n.parent_relpath) THEN CASE WHEN LENGTH(n.parent_relpath) = LENGTH(n.local_relpath) THEN (p.repos_path) WHEN SUBSTR((n.local_relpath), LENGTH(n.parent_relpath)+1, 1) = '/' THEN (p.repos_path) || SUBSTR((n.local_relpath), LENGTH(n.parent_relpath)+1) END END) " \
+ " OR n.revision != p.revision " \
+ " OR p.kind != 'dir' " \
+ " OR n.moved_here IS NOT p.moved_here) " \
+ "UNION ALL " \
+ "SELECT n.local_relpath, n.op_depth, 27, 'Invalid op-root presence' " \
+ "FROM nodes n " \
+ "WHERE n.op_depth = relpath_depth(local_relpath) " \
+ " AND presence NOT IN ('normal', 'incomplete', 'base-deleted') " \
+ "UNION ALL " \
+ "SELECT n.local_relpath, s.op_depth, 28, 'Incomplete shadowing' " \
+ "FROM nodes n " \
+ "JOIN nodes s ON s.wc_id=n.wc_id AND s.local_relpath=n.local_relpath " \
+ " AND s.op_depth = relpath_depth(s.local_relpath) " \
+ " AND s.op_depth = (SELECT MIN(op_depth) FROM nodes d " \
+ " WHERE d.wc_id=s.wc_id AND d.local_relpath=s.local_relpath " \
+ " AND d.op_depth > n.op_depth) " \
+ "WHERE n.presence IN ('normal', 'incomplete') " \
+ " AND EXISTS(SELECT 1 " \
+ " FROM nodes dn " \
+ " WHERE dn.wc_id=n.wc_id AND dn.op_depth=n.op_depth " \
+ " AND dn.presence IN ('normal', 'incomplete') " \
+ " AND (((dn.local_relpath) > (CASE (n.local_relpath) WHEN '' THEN '' ELSE (n.local_relpath) || '/' END)) AND ((dn.local_relpath) < CASE (n.local_relpath) WHEN '' THEN X'FFFF' ELSE (n.local_relpath) || '0' END)) " \
+ " AND dn.file_external IS NULL " \
+ " AND NOT EXISTS(SELECT 1 " \
+ " FROM nodes ds " \
+ " WHERE ds.wc_id=n.wc_id AND ds.op_depth=s.op_depth " \
+ " AND ds.local_relpath=dn.local_relpath)) " \
+ "UNION ALL " \
+ "SELECT s.local_relpath, s.op_depth, 29, 'Invalid base-delete' " \
+ "FROM nodes s " \
+ "LEFT JOIN nodes n ON n.wc_id=s.wc_id AND n.local_relpath=s.local_relpath " \
+ " AND n.op_depth = (SELECT MAX(op_depth) FROM nodes d " \
+ " WHERE d.wc_id=s.wc_id AND d.local_relpath=s.local_relpath " \
+ " AND d.op_depth < s.op_depth) " \
+ "WHERE s.presence = 'base-deleted' " \
+ " AND (n.presence IS NULL " \
+ " OR n.presence NOT IN ('normal', 'incomplete') " \
+ " ) " \
+ "UNION ALL " \
+ "SELECT n.local_relpath, n.op_depth, 30, 'Invalid data for BASE' " \
+ "FROM nodes n " \
+ "WHERE n.op_depth = 0 " \
+ " AND (n.moved_to IS NOT NULL " \
+ " OR n.moved_here IS NOT NULL) " \
+ "UNION ALL " \
+ "SELECT d.local_relpath, d.op_depth, 60, 'Moved here without origin' " \
+ "FROM nodes d " \
+ "WHERE d.op_depth = relpath_depth(d.local_relpath) " \
+ " AND d.moved_here IS NOT NULL " \
+ " AND NOT EXISTS(SELECT 1 FROM nodes s " \
+ " WHERE s.wc_id = d.wc_id AND s.moved_to = d.local_relpath) " \
+ "UNION ALL " \
+ "SELECT s.local_relpath, s.op_depth, 61, 'Moved to without target' " \
+ "FROM nodes s " \
+ "WHERE s.moved_to IS NOT NULL " \
+ " AND NOT EXISTS(SELECT 1 FROM nodes d " \
+ " WHERE d.wc_id = s.wc_id AND d.local_relpath = s.moved_to " \
+ " AND d.op_depth = relpath_depth(d.local_relpath) " \
+ " AND d.moved_here =1 AND d.repos_path IS NOT NULL) " \
+ ""
+
#define WC_QUERIES_SQL_DECLARE_STATEMENTS(varname) \
static const char * const varname[] = { \
STMT_0, \