You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/12/02 21:55:18 UTC
svn commit: r1041580 [12/35] - in
/subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/
build/generator/ build/generator/templates/ build/win32/
contrib/hook-scripts/ contrib/server-side/ notes/http-and-webdav/
notes/wc-ng/ subversi...
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-metadata.sql?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-metadata.sql Thu Dec 2 20:55:08 2010
@@ -76,250 +76,9 @@ CREATE UNIQUE INDEX I_LOCAL_ABSPATH ON W
/* ------------------------------------------------------------------------- */
-/*
-The BASE_NODE table:
-
- BASE is what we get from the server. It is the *absolute* pristine copy.
- You need to use checkout, update, switch, or commit to alter your view of
- the repository.
-
- In the BASE tree, each node corresponds to a particular node-rev in the
- repository. It can be a mixed-revision tree. Each node holds either a
- copy of the node-rev as it exists in the repository (if presence ==
- 'normal'), or a place-holder (if presence == 'absent' or 'excluded' or
- 'not-present').
- [Quoted from wc_db.h]
-
-Overview of BASE_NODE columns:
-
- Indexing columns: (wc_id, local_relpath, parent_relpath)
-
- (presence)
-
- - The Node-Rev, Content and Last-Change column groups take one of the
- states shown in the table below, according to the 'presence':
-
- Has Has Has
- 'presence' Meaning Node-Rev? Content? Last-Change?
- ---------- ----------- ----------- -------- ------------
- normal => Present Yes Yes Yes
- incomplete => Incomplete Yes Partial No ### ?
- absent => Unauthz Yes No No
- excluded => Unwanted Yes No No
- not-present => Nonexistent No No No
-
- - If presence==incomplete, this node refers to an existing node-rev but
- its Content is not fully and correctly stored. In particular, if it
- is a directory, some rows that should represent its children may not
- exist or may be in the wrong state. This is intended to be a
- temporary state, e.g. during an update.
-
- - If presence==absent or ==excluded, this row refers to a node that
- exists in the repo, but the node is not stored in the WC.
-
- - If presence==not-present, this row indicates that its parent in the WC
- is a directory that, in its pristine state, would have a child of this
- name. However, this child was updated or switched to a node-revision
- that does not exist. Information about which node-revision it was
- updated or switched to is lost; only the fact that it is currently not
- present is remembered.
-
- - The order of precedence of the negative presence values is:
- 'excluded' if administratively excluded from the WC, else
- 'absent' if server doesn't authorize reading the path, else
- 'not-present' if it does not exist in repo.
-
- Node-Rev columns: (repos_id, repos_relpath, revnum)
-
- - The Node-Rev group points to the corresponding repository node-rev.
-
- - If not used (as specified by the 'presence' table above), the values
- are undefined.
- ### Perhaps we should set them to null to make it clearer.
-
- Content columns: (kind, properties, depth, target, checksum)
- ---- ---------- ----- ------ --------
- 'dir' Yes Yes null null
- 'symlink' Yes null Yes null
- 'file' Yes null null Yes
- 'unknown' null null null null
-
- - The Content columns take one of the states shown in the table above.
- If Content is present, a copy of the Node-Rev's content is stored
- locally according to one of the first three rows in the table above,
- otherwise kind==unknown and the other columns are null.
-
- - If kind==dir, the children are represented by the existence of other
- BASE_NODE rows. For each immediate child of 'repos_relpath'@'revnum'
- in the repo, subject to 'depth', a BASE_NODE row exists with its
- 'local_relpath' being this node's 'local_relpath' plus the child's
- basename. (Rows may also exist for additional children which are
- outside the scope of 'depth' or do not exist as children of this
- node-rev in the repository, including 'externals' and paths updated to
- a revision in which they do exist.) There is no distinction between
- depth==immediates and depth==infinity here.
-
- - If kind==symlink, the target path is contained in 'target'.
-
- - If kind==file, the content is contained in the Pristine Store,
- referenced by its SHA-1 checksum 'checksum'.
-
- Last-Change columns: (changed_rev, changed_date, changed_author)
-
- - Specifies the revision in which the content was last changed before
- Node-Rev, following copies and not counting the copy operation itself
- as a change.
-
- - Does not specify the revision in which this node first appeared at
- the repository path 'repos_relpath', which could be more recent than
- the last change of this node's content.
-
- - Includes a copy of the corresponding date and author rev-props.
-
- - If not used (as specified by the 'presence' table above), all null.
- ### Not checked; in practice these columns may have undefined values.
-
- Working file status: (translated_size, last_mod_time)
-
- - Present iff kind==file and node has no WORKING_NODE row, otherwise
- null. (If kind==file and node has a WORKING_NODE row, the info is
- recorded in that row). ### True?
-
- - Records the status of the working file on disk, for the purpose of
- detecting quickly whether that file has been modified.
-
- - Logically belongs to the ACTUAL_NODE table but is recorded in the
- BASE_NODE and WORKING_NODE tables instead to avoid the overhead of
- storing an ACTUAL_NODE row for each unmodified file.
-
- - Records the actual size and mod-time of the disk file at the time when
- its content was last determined to be logically unmodified relative to
- its base, taking account of keywords and EOL style.
-
- (dav_cache)
-
- - Content is opaque to libsvn_wc. ### ?
-
- - Lifetime is managed by the WC: values cleared to null at certain times.
- ### To be documented.
-
- (incomplete_children)
-
- - Obsolete, unused.
-
- (file_external)
-
- - ### To be obsoleted?
-*/
-
-CREATE TABLE BASE_NODE (
- /* specifies the location of this node in the local filesystem. wc_id
- implies an absolute path, and local_relpath is relative to that
- location (meaning it will be "" for the wcroot). */
- wc_id INTEGER NOT NULL REFERENCES WCROOT (id),
- local_relpath TEXT NOT NULL,
-
- /* The repository this node is part of, and the relative path (from its
- root) within revision "revnum" of that repository. These may be NULL,
- implying they should be derived from the parent and local_relpath.
- Non-NULL typically indicates a switched node.
-
- Note: they must both be NULL, or both non-NULL. */
- repos_id INTEGER REFERENCES REPOSITORY (id),
- repos_relpath TEXT,
-
- /* parent's local_relpath for aggregating children of a given parent.
- this will be "" if the parent is the wcroot. NULL if this is the
- wcroot node. */
- parent_relpath TEXT,
-
- /* Is this node "present" or has it been excluded for some reason?
- The "base-deleted" presence value is not allowed. */
- presence TEXT NOT NULL,
-
- /* The node kind: "file", "dir", or "symlink", or "unknown" if the node is
- not present. */
- kind TEXT NOT NULL,
-
- /* The revision number in which "repos_relpath" applies in "repos_id".
- this could be NULL for non-present nodes -- no info. */
- revnum INTEGER,
-
- /* If this node is a file, then the SHA-1 checksum of the pristine text. */
- checksum TEXT,
-
- /* The size in bytes of the working file when it had no local text
- modifications. This means the size of the text when translated from
- repository-normal format to working copy format with EOL style
- translated and keywords expanded according to the properties in the
- "properties" column of this row.
-
- NULL if this node is not a file or if the size has not (yet) been
- computed. */
- translated_size INTEGER,
-
- /* Information about the last change to this node. changed_rev must be
- not-null if this node has presence=="normal". changed_date and
- changed_author may be null if the corresponding revprops are missing.
-
- All three values are null for a not-present node. */
- changed_rev INTEGER,
- changed_date INTEGER, /* an APR date/time (usec since 1970) */
- changed_author TEXT,
-
- /* NULL depth means "default" (typically svn_depth_infinity) */
- depth TEXT,
-
- /* for kind==symlink, this specifies the target. */
- symlink_target TEXT,
-
- /* The mod-time of the working file when it was last determined to be
- logically unmodified relative to its base, taking account of keywords
- and EOL style.
-
- NULL if this node is not a file or if this info has not yet been
- determined.
- */
- /* ### Do we need this? We've currently got various mod time APIs
- ### internal to libsvn_wc, but those might be used in answering some
- ### question which is better answered some other way. */
- last_mod_time INTEGER, /* an APR date/time (usec since 1970) */
-
- /* serialized skel of this node's properties. NULL if we
- have no information about the properties (a non-present node). */
- properties BLOB,
-
- /* serialized skel of this node's dav-cache. could be NULL if the
- node does not have any dav-cache. */
- dav_cache BLOB,
-
- /* ### this column is removed in format 13. it will always be NULL. */
- incomplete_children INTEGER,
-
- /* The serialized file external information. */
- /* ### hack. hack. hack.
- ### This information is already stored in properties, but because the
- ### current working copy implementation is such a pain, we can't
- ### readily retrieve it, hence this temporary cache column.
- ### When it is removed, be sure to remove the extra column from
- ### the db-tests.
-
- ### Note: This is only here as a hack, and should *NOT* be added
- ### to any wc_db APIs. */
- file_external TEXT,
-
- PRIMARY KEY (wc_id, local_relpath)
- );
-
-CREATE INDEX I_PARENT ON BASE_NODE (wc_id, parent_relpath);
-
-
-/* ------------------------------------------------------------------------- */
-
/* The PRISTINE table keeps track of pristine texts. Each pristine text is
stored in a file which may be compressed. Each pristine text is
- referenced by any number of rows in the BASE_NODE and WORKING_NODE
- and ACTUAL_NODE tables.
+ referenced by any number of rows in the NODES and ACTUAL_NODE tables.
*/
CREATE TABLE PRISTINE (
/* The SHA-1 checksum of the pristine text. This is a unique key. The
@@ -327,199 +86,37 @@ CREATE TABLE PRISTINE (
pristine texts referenced from this database. */
checksum TEXT NOT NULL PRIMARY KEY,
- /* ### enumerated values specifying type of compression. NULL implies
- ### that no compression has been applied. */
+ /* Enumerated values specifying type of compression. The only value
+ supported so far is NULL, meaning that no compression has been applied
+ and the pristine text is stored verbatim in the file. */
compression INTEGER,
- /* The size in bytes of the file in which the pristine text is stored. */
- /* ### used to verify the pristine file is "proper". NULL if unknown,
- ### and (thus) the pristine copy is incomplete/unusable. */
- size INTEGER,
+ /* The size in bytes of the file in which the pristine text is stored.
+ Used to verify the pristine file is "proper". */
+ size INTEGER NOT NULL,
/* ### this will probably go away, in favor of counting references
- ### that exist in BASE_NODE and WORKING_NODE. */
+ ### that exist in NODES. Not yet used; always set to 1. */
refcount INTEGER NOT NULL,
/* Alternative MD5 checksum used for communicating with older
- repositories. Not guaranteed to be unique among table rows.
- NULL if not (yet) calculated. */
- md5_checksum TEXT
+ repositories. Not strictly guaranteed to be unique among table rows. */
+ md5_checksum TEXT NOT NULL
);
/* ------------------------------------------------------------------------- */
-/* The WORKING_NODE table describes tree changes in the WC relative to the
- BASE_NODE table.
-
- The WORKING_NODE row for a given path exists iff a node at this path
- is itself one of:
-
- - deleted
- - moved away [1]
-
- and/or one of:
-
- - added
- - copied here [1]
- - moved here [1]
-
- or if this path is a child (or grandchild, etc.) under any such node.
- (### Exact meaning of "child" when mixed-revision, switched, etc.?)
-
- [1] The WC-NG "move" operation requires that both the source and
- destination paths are represented in the BASE_NODE and WORKING_NODE
- tables. The "copy" operation takes as its source a repository node,
- regardless whether that node is also represented in the WC.
- */
-CREATE TABLE WORKING_NODE (
- /* specifies the location of this node in the local filesystem */
- wc_id INTEGER NOT NULL REFERENCES WCROOT (id),
- local_relpath TEXT NOT NULL,
-
- /* parent's local_relpath for aggregating children of a given parent.
- this will be "" if the parent is the wcroot. Since a wcroot will
- never have a WORKING node the parent_relpath will never be null. */
- /* ### would be nice to make this column NOT NULL. */
- parent_relpath TEXT,
-
- /* Is this node "present" or has it been excluded for some reason?
- Only allowed values: normal, not-present, incomplete, base-deleted,
- excluded. (the others do not make sense for the WORKING tree)
-
- normal: this node has been added/copied/moved-here. There may be an
- underlying BASE node at this location, implying this is a replace.
- Scan upwards from here looking for copyfrom or moved_here values
- to detect the type of operation constructing this node.
-
- not-present: the node (or parent) was originally copied or moved-here.
- A subtree of that source has since been deleted. There may be
- underlying BASE node to replace. For a move-here or copy-here, the
- records are simply removed rather than switched to not-present.
- Note this reflects a deletion only. It is not possible move-away
- nodes from the WORKING tree. The purported destination would receive
- a copy from the original source of a copy-here/move-here, or if the
- nodes were plain adds, those nodes would be shifted to that target
- for addition.
-
- incomplete: nodes are being added into the WORKING tree, and the full
- information about this node is not (yet) present.
-
- base-deleted: the underlying BASE node has been marked for deletion due
- to a delete or a move-away (see the moved_to column to determine
- which), and has not been replaced.
-
- excluded: this node is administratively excluded (sparse WC). This must
- be a child (or grandchild etc.) of a copied directory.
- */
- presence TEXT NOT NULL,
-
- /* the kind of the new node. may be "unknown" if the node is not present. */
- kind TEXT NOT NULL,
-
- /* The SHA-1 checksum of the pristine text, if this node is a file and was
- moved here or copied here, else NULL. */
- checksum TEXT,
-
- /* The size in bytes of the working file when it had no local text
- modifications. This means the size of the text when translated from
- repository-normal format to working copy format with EOL style
- translated and keywords expanded according to the properties in the
- "properties" column of this row.
-
- NULL if this node is not a file, or is not moved here or copied here,
- or if the size has not (yet) been computed. */
- translated_size INTEGER,
-
- /* If this node was moved here or copied here, then the following fields may
- have information about their source node. See BASE_NODE.changed_* for
- more information.
-
- For an added or not-present node, these are null. */
- changed_rev INTEGER,
- changed_date INTEGER, /* an APR date/time (usec since 1970) */
- changed_author TEXT,
-
- /* NULL depth means "default" (typically svn_depth_infinity) */
- /* ### depth on WORKING? seems this is a BASE-only concept. how do
- ### you do "files" on an added-directory? can't really ignore
- ### the subdirs! */
- /* ### maybe a WC-to-WC copy can retain a depth? */
- depth TEXT,
-
- /* for kind==symlink, this specifies the target. */
- symlink_target TEXT,
-
- /* Where this node was copied/moved from. All copyfrom_* fields are set
- only on the root of the operation, and are NULL for all children. */
- copyfrom_repos_id INTEGER REFERENCES REPOSITORY (id),
- copyfrom_repos_path TEXT,
- copyfrom_revnum INTEGER,
-
- /* ### JF: For an old-style move, "copyfrom" info stores its source, but a
- new WC-NG "move" is intended to be a "true rename" so its copyfrom
- revision is implicit, being in effect (new head - 1) at commit time.
- For a (new) move, we need to store or deduce the copyfrom local-relpath;
- perhaps add a column called "moved_from". */
-
- /* Boolean value, specifying if this node was moved here (rather than just
- copied). The source of the move is specified in copyfrom_*. */
- moved_here INTEGER,
-
- /* If the underlying node was moved away (rather than just deleted), this
- specifies the local_relpath of where the BASE node was moved to.
- This is set only on the root of a move, and is NULL for all children.
-
- Note that moved_to never refers to *this* node. It always refers
- to the "underlying" node, whether that is BASE or a child node
- implied from a parent's move/copy. */
- moved_to TEXT,
-
- /* ### Do we need this? We've currently got various mod time APIs
- ### internal to libsvn_wc, but those might be used in answering some
- ### question which is better answered some other way. */
- last_mod_time INTEGER, /* an APR date/time (usec since 1970) */
-
- /* serialized skel of this node's properties. NULL if we
- have no information about the properties (a non-present node). */
- properties BLOB,
-
- /* should the node on disk be kept after a schedule delete?
-
- ### Bert points out that this can disappear once we get to single-db.
- ### The entire reason for this flag to exist is
- ### so that the admin area can exist for the commit of a delete,
- ### and so the post-commit cleanup knows not to actually delete the dir
- ### from disk (which is why the flag is only ever set on the this_dir
- ### entry in WC-OLD.) With single-db, we don't need to keep the old
- ### admin area around, so this flag can disappear.
- ### neels: In contrast, the --keep-local commandline option will not
- ### disappear. The user will still be able to do
- ### 'svn delete --keep-local' and keep the to-be-unversioned paths
- ### in the file system. It just won't be necessary to remember the
- ### keep-local-ness here, because we either delete the file system paths
- ### right away during 'svn delete' or we don't at all. There won't be a
- ### "second pass" for file system deletion at commit time anymore. */
- keep_local INTEGER,
-
- PRIMARY KEY (wc_id, local_relpath)
- );
-
-CREATE INDEX I_WORKING_PARENT ON WORKING_NODE (wc_id, parent_relpath);
-
-
-/* ------------------------------------------------------------------------- */
-
-/* The ACTUAL_NODE table describes text changes and property changes on each
- node in the WC, relative to the WORKING_NODE table row for the same path
- (if present) or else to the BASE_NODE row for the same path. (Either a
- WORKING_NODE row or a BASE_NODE row must exist if this node exists, but
- an ACTUAL_NODE row can exist on its own if it is just recording info on
- a non-present node - a tree conflict or a changelist, for example.)
+/* The ACTUAL_NODE table describes text changes and property changes
+ on each node in the WC, relative to the NODES table row for the
+ same path. (A NODES row must exist if this node exists, but an
+ ACTUAL_NODE row can exist on its own if it is just recording info
+ on a non-present node - a tree conflict or a changelist, for
+ example.)
The ACTUAL_NODE table row for a given path exists if the node at that
path is known to have text or property changes relative to its
- WORKING_NODE row. ("Is known" because a text change on disk may not yet
+ NODES row. ("Is known" because a text change on disk may not yet
have been discovered and recorded here.)
The ACTUAL_NODE table row for a given path may also exist in other cases,
@@ -766,13 +363,6 @@ CREATE TABLE NODES (
*/
presence TEXT NOT NULL,
- /* NULL depth means "default" (typically svn_depth_infinity) */
- /* ### depth on WORKING? seems this is a BASE-only concept. how do
- ### you do "files" on an added-directory? can't really ignore
- ### the subdirs! */
- /* ### maybe a WC-to-WC copy can retain a depth? */
- depth TEXT,
-
/* ### JF: For an old-style move, "copyfrom" info stores its source, but a
new WC-NG "move" is intended to be a "true rename" so its copyfrom
revision is implicit, being in effect (new head - 1) at commit time.
@@ -792,27 +382,42 @@ CREATE TABLE NODES (
implied from a parent's move/copy. */
moved_to TEXT,
- /* Repository state fields */
+
+ /* Content fields */
/* the kind of the new node. may be "unknown" if the node is not present. */
kind TEXT NOT NULL,
- /* If this node was moved here or copied here, then the following fields may
- have information about their source node. See BASE_NODE.changed_* for
- more information.
+ /* serialized skel of this node's properties. NULL if we
+ have no information about the properties (a non-present node). */
+ properties BLOB,
- For an added or not-present node, these are null. */
- changed_revision INTEGER,
- changed_date INTEGER, /* an APR date/time (usec since 1970) */
- changed_author TEXT,
+ /* NULL depth means "default" (typically svn_depth_infinity) */
+ /* ### depth on WORKING? seems this is a BASE-only concept. how do
+ ### you do "files" on an added-directory? can't really ignore
+ ### the subdirs! */
+ /* ### maybe a WC-to-WC copy can retain a depth? */
+ depth TEXT,
/* The SHA-1 checksum of the pristine text, if this node is a file and was
moved here or copied here, else NULL. */
checksum TEXT,
- /* serialized skel of this node's properties. NULL if we
- have no information about the properties (a non-present node). */
- properties BLOB,
+ /* for kind==symlink, this specifies the target. */
+ symlink_target TEXT,
+
+
+ /* Last-Change fields */
+
+ /* If this node was moved here or copied here, then the following fields may
+ have information about their source node. changed_rev must be not-null
+ if this node has presence=="normal". changed_date and changed_author may
+ be null if the corresponding revprops are missing.
+
+ For an added or not-present node, these are null. */
+ changed_revision INTEGER,
+ changed_date INTEGER, /* an APR date/time (usec since 1970) */
+ changed_author TEXT,
/* Various cache fields */
@@ -841,9 +446,6 @@ CREATE TABLE NODES (
node does not have any dav-cache. */
dav_cache BLOB,
- /* for kind==symlink, this specifies the target. */
- symlink_target TEXT,
-
/* The serialized file external information. */
/* ### hack. hack. hack.
### This information is already stored in properties, but because the
@@ -987,9 +589,7 @@ PRAGMA user_version = 18;
/* Format 20 introduces NODES and removes BASE_NODE and WORKING_NODE */
-/* ### Enable this bit and take out the BASE_NODE stuff in format 99 below.
-
--- DISABLED_STMT_UPGRADE_TO_20
+-- STMT_UPGRADE_TO_20
INSERT INTO NODES (
wc_id, local_relpath, op_depth, parent_relpath,
@@ -1024,96 +624,42 @@ DROP TABLE BASE_NODE;
DROP TABLE WORKING_NODE;
PRAGMA user_version = 20;
-*/
+
/* ------------------------------------------------------------------------- */
-/* Format YYY introduces new handling for conflict information. */
--- format: YYY
+/* Format 21 involves no schema changes, it moves the tree conflict victim
+ information to victime nodes, rather than parents. */
+
+-- STMT_UPGRADE_TO_21
+PRAGMA user_version = 21;
/* ------------------------------------------------------------------------- */
-/* Format 99 drops all columns not needed due to previous format upgrades.
- Before we release 1.7, these statements will be pulled into a format bump
- and all the tables will be cleaned up. We don't know what that format
- number will be, however, so we're just marking it as 99 for now. */
--- format: 99
+/* Format 22 simply moves the tree conflict information from the conflict_data
+ column to the tree_conflict_data column. */
-/* We cannot directly remove columns, so we use a temporary table instead. */
-/* First create the temporary table without the undesired column(s). */
-CREATE TEMPORARY TABLE BASE_NODE_BACKUP(
- wc_id INTEGER NOT NULL,
- local_relpath TEXT NOT NULL,
- repos_id INTEGER,
- repos_relpath TEXT,
- parent_relpath TEXT,
- presence TEXT NOT NULL,
- kind TEXT NOT NULL,
- revnum INTEGER,
- checksum TEXT,
- translated_size INTEGER,
- changed_rev INTEGER,
- changed_date INTEGER,
- changed_author TEXT,
- depth TEXT,
- symlink_target TEXT,
- last_mod_time INTEGER,
- properties BLOB,
- dav_cache BLOB,
- file_external TEXT
-);
+-- STMT_UPGRADE_TO_22
+UPDATE actual_node SET tree_conflict_data = conflict_data;
+UPDATE actual_node SET conflict_data = NULL;
-/* Copy everything into the temporary table. */
-INSERT INTO BASE_NODE_BACKUP SELECT
- wc_id, local_relpath, repos_id, repos_relpath, parent_relpath, presence,
- kind, revnum, checksum, translated_size, changed_rev, changed_date,
- changed_author, depth, symlink_target, last_mod_time, properties, dav_cache,
- file_external
-FROM BASE_NODE;
+PRAGMA user_version = 22;
-/* Drop the original table. */
-DROP TABLE BASE_NODE;
-/* Recreate the original table, this time less the temporary columns.
- Column descriptions are same as BASE_NODE in format 12 */
-CREATE TABLE BASE_NODE(
- wc_id INTEGER NOT NULL REFERENCES WCROOT (id),
- local_relpath TEXT NOT NULL,
- repos_id INTEGER REFERENCES REPOSITORY (id),
- repos_relpath TEXT,
- parent_relpath TEXT,
- presence TEXT NOT NULL,
- kind TEXT NOT NULL,
- revnum INTEGER,
- checksum TEXT,
- translated_size INTEGER,
- changed_rev INTEGER,
- changed_date INTEGER,
- changed_author TEXT,
- depth TEXT,
- symlink_target TEXT,
- last_mod_time INTEGER,
- properties BLOB,
- dav_cache BLOB,
- file_external TEXT,
+/* ------------------------------------------------------------------------- */
- PRIMARY KEY (wc_id, local_relpath)
- );
+/* Format YYY introduces new handling for conflict information. */
+-- format: YYY
-/* Recreate the index. */
-CREATE INDEX I_PARENT ON BASE_NODE (wc_id, parent_relpath);
-/* Copy everything back into the original table. */
-INSERT INTO BASE_NODE SELECT
- wc_id, local_relpath, repos_id, repos_relpath, parent_relpath, presence,
- kind, revnum, checksum, translated_size, changed_rev, changed_date,
- changed_author, depth, symlink_target, last_mod_time, properties, dav_cache,
- file_external
-FROM BASE_NODE_BACKUP;
+/* ------------------------------------------------------------------------- */
-/* Drop the temporary table. */
-DROP TABLE BASE_NODE_BACKUP;
+/* Format 99 drops all columns not needed due to previous format upgrades.
+ Before we release 1.7, these statements will be pulled into a format bump
+ and all the tables will be cleaned up. We don't know what that format
+ number will be, however, so we're just marking it as 99 for now. */
+-- format: 99
/* Now "drop" the tree_conflict_data column from actual_node. */
CREATE TABLE ACTUAL_NODE_BACKUP (
@@ -1160,3 +706,9 @@ INSERT INTO ACTUAL_NODE SELECT
FROM ACTUAL_NODE_BACKUP;
DROP TABLE ACTUAL_NODE_BACKUP;
+
+/* Note: One difference remains between the schemas of an upgraded and a
+ * fresh WC. While format 22 was current, "NOT NULL" was added to the
+ * columns PRISTINE.size and PRISTINE.md5_checksum. The format was not
+ * bumped because it is a forward- and backward-compatible change. */
+
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc-queries.sql Thu Dec 2 20:55:08 2010
@@ -26,14 +26,26 @@
/* these are used in wc_db.c */
--- STMT_SELECT_BASE_NODE
-SELECT repos_id, repos_relpath, presence, kind, revnum, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
+-- STMT_SELECT_NODE_INFO
+SELECT op_depth, repos_id, repos_path, presence, kind, revision, checksum,
+ translated_size, changed_revision, changed_date, changed_author, depth,
symlink_target, last_mod_time, properties
-FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2
+ORDER BY op_depth DESC;
+
+-- STMT_SELECT_NODE_INFO_WITH_LOCK
+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
+FROM nodes
+LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
+ AND nodes.repos_path = lock.repos_relpath
+WHERE wc_id = ?1 AND local_relpath = ?2
+ORDER BY op_depth DESC;
--- STMT_SELECT_BASE_NODE_1
+-- STMT_SELECT_BASE_NODE
SELECT repos_id, repos_path, presence, kind, revision, checksum,
translated_size, changed_revision, changed_date, changed_author, depth,
symlink_target, last_mod_time, properties
@@ -41,16 +53,6 @@ FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_SELECT_BASE_NODE_WITH_LOCK
-SELECT base_node.repos_id, base_node.repos_relpath, presence, kind,
- revnum, checksum, translated_size, changed_rev, changed_date,
- changed_author, depth, symlink_target, last_mod_time, properties,
- lock_token, lock_owner, lock_comment, lock_date
-FROM base_node
-LEFT OUTER JOIN lock ON base_node.repos_id = lock.repos_id
- AND base_node.repos_relpath = lock.repos_relpath
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_BASE_NODE_WITH_LOCK_1
SELECT 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,
@@ -61,15 +63,7 @@ LEFT OUTER JOIN lock ON nodes.repos_id =
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_SELECT_WORKING_NODE
-SELECT presence, kind, checksum, translated_size,
- changed_rev, changed_date, changed_author, depth, symlink_target,
- copyfrom_repos_id, copyfrom_repos_path, copyfrom_revnum,
- moved_here, moved_to, last_mod_time, properties
-FROM working_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_WORKING_NODE_1
-SELECT presence, kind, checksum, translated_size,
+SELECT op_depth, presence, kind, checksum, translated_size,
changed_revision, changed_date, changed_author, depth, symlink_target,
repos_id, repos_path, revision,
moved_here, moved_to, last_mod_time, properties
@@ -78,12 +72,45 @@ WHERE wc_id = ?1 AND local_relpath = ?2
ORDER BY op_depth DESC
LIMIT 1;
+-- STMT_SELECT_LOWEST_WORKING_NODE
+SELECT op_depth, presence
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0
+ORDER BY op_depth
+LIMIT 1;
+
-- STMT_SELECT_ACTUAL_NODE
SELECT prop_reject, changelist, conflict_old, conflict_new,
conflict_working, tree_conflict_data, properties
FROM actual_node
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_SELECT_ACTUAL_TREE_CONFLICT
+SELECT tree_conflict_data
+FROM actual_node
+WHERE wc_id = ?1 AND local_relpath = ?2 AND tree_conflict_data IS NOT NULL;
+
+-- STMT_SELECT_NODE_CHILDREN_INFO
+/* Getting rows in an advantageous order using
+ ORDER BY local_relpath, op_depth DESC
+ turns out to be slower than getting rows in a random order and making the
+ C code handle it. */
+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
+FROM nodes
+LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
+ AND nodes.repos_path = lock.repos_relpath
+WHERE wc_id = ?1 AND parent_relpath = ?2;
+
+-- STMT_SELECT_ACTUAL_CHILDREN_INFO
+SELECT prop_reject, changelist, conflict_old, conflict_new,
+conflict_working, tree_conflict_data, properties, local_relpath,
+conflict_data
+FROM actual_node
+WHERE wc_id = ?1 AND parent_relpath = ?2;
+
-- STMT_SELECT_REPOSITORY_BY_ID
SELECT root, uuid FROM repository WHERE id = ?1;
@@ -96,14 +123,6 @@ SELECT id FROM repository WHERE root = ?
-- STMT_INSERT_REPOSITORY
INSERT INTO repository (root, uuid) VALUES (?1, ?2);
--- STMT_INSERT_BASE_NODE
-INSERT OR replace INTO base_node (
- wc_id, local_relpath, repos_id, repos_relpath, parent_relpath, presence,
- kind, revnum, properties, changed_rev, changed_date, changed_author,
- depth, checksum, translated_size, symlink_target, dav_cache)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
- ?15, ?16, ?17);
-
-- STMT_INSERT_NODE
INSERT OR REPLACE INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
@@ -113,80 +132,31 @@ INSERT OR REPLACE INTO nodes (
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16, ?17, ?18, ?19);
--- STMT_INSERT_BASE_NODE_INCOMPLETE
-INSERT OR IGNORE INTO base_node (
- wc_id, local_relpath, parent_relpath, presence, kind, revnum)
-VALUES (?1, ?2, ?3, 'incomplete', 'unknown', ?4);
-
--- STMT_INSERT_BASE_NODE_INCOMPLETE_DIR
-INSERT OR IGNORE INTO base_node (
- wc_id, local_relpath, repos_id, repos_relpath, parent_relpath, presence,
- kind, revnum, depth)
-VALUES (?1, ?2, ?3, ?4, ?5, 'incomplete', 'dir', ?6, ?7);
-
--- STMT_INSERT_WORKING_NODE_INCOMPLETE
-INSERT OR IGNORE INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind)
-VALUES (?1, ?2, ?3, 'incomplete', 'unknown');
-
--- STMT_SELECT_BASE_NODE_CHILDREN
-SELECT local_relpath FROM base_node
-WHERE wc_id = ?1 AND parent_relpath = ?2;
-
--- STMT_SELECT_BASE_NODE_CHILDREN_1
+-- STMT_SELECT_OP_DEPTH_CHILDREN
SELECT local_relpath FROM nodes
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = 0;
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3;
--- STMT_SELECT_WORKING_NODE_CHILDREN
-SELECT local_relpath FROM working_node
+-- STMT_SELECT_NODE_CHILDREN
+SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND parent_relpath = ?2;
--- STMT_SELECT_WORKING_NODE_CHILDREN_1
-SELECT DISTINCT local_relpath FROM nodes
-WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth > 0;
-
--- STMT_SELECT_WORKING_IS_FILE
-SELECT kind == 'file' FROM working_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_BASE_IS_FILE
-SELECT kind == 'file' FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_SELECT_BASE_PROPS
-SELECT properties FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_BASE_PROPS_1
SELECT properties FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_SELECT_WORKING_PROPS
-SELECT properties, presence FROM working_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_WORKING_PROPS_1
+-- STMT_SELECT_NODE_PROPS
SELECT properties, presence FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0
-ORDER BY op_depth DESC
-LIMIT 1;
+WHERE wc_id = ?1 AND local_relpath = ?2
+ORDER BY op_depth DESC;
-- STMT_SELECT_ACTUAL_PROPS
SELECT properties FROM actual_node
WHERE wc_id = ?1 AND local_relpath = ?2;
--- STMT_UPDATE_BASE_PROPS
-UPDATE base_node SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_BASE_PROPS
UPDATE nodes SET properties = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_WORKING_PROPS
-UPDATE working_node SET properties = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_WORKING_PROPS
UPDATE nodes SET properties = ?3
WHERE wc_id = ?1 AND local_relpath = ?2
@@ -212,26 +182,15 @@ VALUES (?1, ?2, ?3, ?4, ?5, ?6);
INSERT INTO wcroot (local_abspath)
VALUES (?1);
--- STMT_UPDATE_BASE_DAV_CACHE
-UPDATE base_node SET dav_cache = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_BASE_NODE_DAV_CACHE
UPDATE nodes SET dav_cache = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_SELECT_BASE_DAV_CACHE
-SELECT dav_cache FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
+SELECT dav_cache FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_SELECT_DELETION_INFO
-SELECT base_node.presence, working_node.presence, moved_to
-FROM working_node
-LEFT OUTER JOIN base_node ON base_node.wc_id = working_node.wc_id
- AND base_node.local_relpath = working_node.local_relpath
-WHERE working_node.wc_id = ?1 AND working_node.local_relpath = ?2;
-
--- STMT_SELECT_DELETION_INFO_1
SELECT nodes_base.presence, nodes_work.presence, nodes_work.moved_to
FROM nodes nodes_work
LEFT OUTER JOIN nodes nodes_base ON nodes_base.wc_id = nodes_work.wc_id
@@ -246,30 +205,12 @@ WHERE nodes_work.wc_id = ?1 AND nodes_wo
DELETE FROM lock
WHERE repos_id = ?1 AND repos_relpath = ?2;
--- STMT_CLEAR_BASE_RECURSIVE_DAV_CACHE
-UPDATE base_node SET dav_cache = NULL
-WHERE dav_cache IS NOT NULL AND wc_id = ?1 AND
- (local_relpath = ?2 OR
- local_relpath LIKE ?3 ESCAPE '#');
-
-- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE
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 LIKE ?3 ESCAPE '#');
--- STMT_UPDATE_BASE_RECURSIVE_REPO
-UPDATE base_node SET repos_id = ?5
-WHERE repos_id = ?4 AND wc_id = ?1 AND
- (local_relpath = ?2 OR
- local_relpath LIKE ?3 ESCAPE '#');
-
--- STMT_UPDATE_WORKING_RECURSIVE_COPYFROM_REPO
-UPDATE working_node SET copyfrom_repos_id = ?5
-WHERE copyfrom_repos_id = ?4 AND wc_id = ?1 AND
- (local_relpath = ?2 OR
- local_relpath LIKE ?3 ESCAPE '#');
-
-- STMT_RECURSIVE_UPDATE_NODE_REPO
UPDATE nodes SET repos_id = ?5, dav_cache = NULL
WHERE wc_id = ?1 AND repos_id = ?4 AND
@@ -282,18 +223,10 @@ WHERE repos_id = ?1 AND
(repos_relpath = ?2 OR
repos_relpath LIKE ?3 ESCAPE '#');
--- STMT_UPDATE_BASE_FILEINFO
-UPDATE base_node SET translated_size = ?3, last_mod_time = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_BASE_NODE_FILEINFO
UPDATE nodes SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_WORKING_FILEINFO
-UPDATE working_node SET translated_size = ?3, last_mod_time = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_WORKING_NODE_FILEINFO
UPDATE nodes SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2
@@ -305,11 +238,9 @@ UPDATE actual_node SET tree_conflict_dat
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_INSERT_ACTUAL_TREE_CONFLICTS
-/* tree conflicts are always recorded on the wcroot node, so the
- parent_relpath will be null. */
INSERT INTO actual_node (
- wc_id, local_relpath, tree_conflict_data)
-VALUES (?1, ?2, ?3);
+ wc_id, local_relpath, tree_conflict_data, parent_relpath)
+VALUES (?1, ?2, ?3, ?4);
-- STMT_UPDATE_ACTUAL_TEXT_CONFLICTS
UPDATE actual_node SET conflict_old = ?3, conflict_new = ?4,
@@ -345,19 +276,38 @@ REPLACE INTO actual_node (
wc_id, local_relpath, parent_relpath, changelist)
VALUES (?1, ?2, ?3, ?4);
--- STMT_DELETE_BASE_NODE
-DELETE FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_DELETE_ACTUAL_EMPTY
+DELETE FROM actual_node
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND properties IS NULL
+ AND conflict_old IS NULL
+ AND conflict_new IS NULL
+ AND prop_reject IS NULL
+ AND changelist IS NULL
+ AND text_mod IS NULL
+ AND tree_conflict_data IS NULL
+ AND older_checksum IS NULL
+ AND right_checksum IS NULL
+ AND left_checksum IS NULL;
--- STMT_DELETE_BASE_NODE_1
+-- STMT_DELETE_BASE_NODE
DELETE FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_DELETE_WORKING_NODE
-DELETE FROM working_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
+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);
+
+-- STMT_DELETE_LOWEST_WORKING_NODE
+DELETE FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND op_depth = (SELECT MIN(op_depth) FROM nodes
+ WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0)
+ AND presence = 'base-deleted';
--- STMT_DELETE_WORKING_NODES
+-- STMT_DELETE_ALL_WORKING_NODES
DELETE FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0;
@@ -369,80 +319,83 @@ WHERE wc_id = ?1 AND local_relpath = ?2;
DELETE FROM actual_node
WHERE wc_id = ?1 AND local_relpath = ?2;
--- STMT_UPDATE_BASE_DEPTH
-UPDATE base_node SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_DELETE_ACTUAL_NODE_WITHOUT_CHANGELIST
+DELETE FROM actual_node
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND changelist IS NULL;
+
+-- STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT
+DELETE FROM actual_node
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND tree_conflict_data IS NULL;
+
+-- STMT_DELETE_NOT_PRESENT_NODES_RECURSIVE
+DELETE FROM nodes
+WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3
+ AND presence = 'not-present';
+
+-- STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST
+UPDATE actual_node
+SET properties = NULL,
+ text_mod = NULL,
+ tree_conflict_data = NULL,
+ conflict_old = NULL,
+ conflict_new = NULL,
+ conflict_working = NULL,
+ prop_reject = NULL,
+ older_checksum = NULL,
+ left_checksum = NULL,
+ right_checksum = NULL
+WHERE wc_id = ?1 and local_relpath = ?2;
+
+-- STMT_CLEAR_ACTUAL_NODE_LEAVING_CONFLICT
+UPDATE actual_node
+SET properties = NULL,
+ text_mod = NULL,
+ changelist = NULL,
+ conflict_old = NULL,
+ conflict_new = NULL,
+ conflict_working = NULL,
+ prop_reject = NULL,
+ older_checksum = NULL,
+ left_checksum = NULL,
+ right_checksum = NULL
+WHERE wc_id = ?1 and local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_DEPTH
UPDATE nodes SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_WORKING_DEPTH
-UPDATE working_node SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_WORKING_DEPTH
UPDATE nodes SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND
op_depth = (SELECT MAX(op_depth) FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0);
--- STMT_UPDATE_BASE_EXCLUDED
-UPDATE base_node SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_BASE_EXCLUDED
UPDATE nodes SET presence = 'excluded', depth = NULL
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_WORKING_EXCLUDED
-UPDATE working_node SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_WORKING_EXCLUDED
UPDATE nodes SET presence = 'excluded', depth = NULL
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);
--- STMT_UPDATE_BASE_PRESENCE
-UPDATE base_node SET presence= ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_BASE_PRESENCE
UPDATE nodes SET presence = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_BASE_PRESENCE_KIND
-UPDATE base_node SET presence = ?3, kind = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_NODE_BASE_PRESENCE_KIND
UPDATE nodes SET presence = ?3, kind = ?4
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_UPDATE_WORKING_PRESENCE
-UPDATE working_node SET presence = ?3
-WHERE wc_id = ?1 AND local_relpath =?2;
-
-- STMT_UPDATE_NODE_WORKING_PRESENCE
UPDATE nodes SET presence = ?3
WHERE wc_id = ?1 AND local_relpath = ?2
AND op_depth = (SELECT MAX(op_depth) FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0);
--- STMT_UPDATE_BASE_PRESENCE_AND_REVNUM
-UPDATE base_node SET presence = ?3, revnum = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_UPDATE_BASE_NODE_PRESENCE_AND_REVNUM
-UPDATE nodes SET presence = ?3, revision = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-
--- STMT_UPDATE_BASE_PRESENCE_REVNUM_AND_REPOS_RELPATH
-UPDATE base_node SET presence = ?3, revnum = ?4, repos_relpath = ?5
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH
UPDATE nodes SET presence = ?3, revision = ?4, repos_path = ?5
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
@@ -473,24 +426,7 @@ SELECT checksum
FROM pristine
WHERE md5_checksum = ?1
--- STMT_SELECT_PRISTINE_ROWS
-SELECT checksum
-FROM pristine
-
-- STMT_SELECT_ANY_PRISTINE_REFERENCE
-SELECT 1 FROM base_node
- WHERE checksum = ?1 OR checksum = ?2
-UNION ALL
-SELECT 1 FROM working_node
- WHERE checksum = ?1 OR checksum = ?2
-UNION ALL
-SELECT 1 FROM actual_node
- WHERE older_checksum = ?1 OR older_checksum = ?2
- OR left_checksum = ?1 OR left_checksum = ?2
- OR right_checksum = ?1 OR right_checksum = ?2
-LIMIT 1
-
--- STMT_SELECT_ANY_PRISTINE_REFERENCE_1
SELECT 1 FROM nodes
WHERE checksum = ?1 OR checksum = ?2
UNION ALL
@@ -500,6 +436,22 @@ SELECT 1 FROM actual_node
OR right_checksum = ?1 OR right_checksum = ?2
LIMIT 1
+-- STMT_SELECT_UNREFERENCED_PRISTINES
+SELECT checksum
+FROM pristine
+EXCEPT
+SELECT checksum FROM nodes
+ WHERE checksum IS NOT NULL
+EXCEPT
+SELECT older_checksum FROM actual_node
+ WHERE older_checksum IS NOT NULL
+EXCEPT
+SELECT left_checksum FROM actual_node
+ WHERE left_checksum IS NOT NULL
+EXCEPT
+SELECT right_checksum FROM actual_node
+ WHERE right_checksum IS NOT NULL
+
-- STMT_DELETE_PRISTINE
DELETE FROM pristine
WHERE checksum = ?1
@@ -509,15 +461,17 @@ SELECT local_relpath
FROM actual_node
WHERE wc_id = ?1 AND parent_relpath = ?2 AND
NOT ((prop_reject IS NULL) AND (conflict_old IS NULL)
- AND (conflict_new IS NULL) AND (conflict_working IS NULL))
+ AND (conflict_new IS NULL) AND (conflict_working IS NULL)
+ AND (tree_conflict_data IS NULL))
--- STMT_SELECT_ACTUAL_TREE_CONFLICT
-SELECT tree_conflict_data
+-- STMT_SELECT_ACTUAL_CHILDREN_TREE_CONFLICT
+SELECT local_relpath, tree_conflict_data
FROM actual_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
+WHERE wc_id = ?1 AND parent_relpath = ?2 AND tree_conflict_data IS NOT NULL;
-- STMT_SELECT_CONFLICT_DETAILS
-SELECT prop_reject, conflict_old, conflict_new, conflict_working
+SELECT prop_reject, conflict_old, conflict_new, conflict_working,
+ tree_conflict_data
FROM actual_node
WHERE wc_id = ?1 AND local_relpath = ?2;
@@ -549,17 +503,10 @@ WHERE wc_id = ?1 AND local_dir_relpath =
SELECT local_dir_relpath FROM wc_lock
WHERE wc_id = ?1 AND local_dir_relpath LIKE ?2 ESCAPE '#';
--- STMT_APPLY_CHANGES_TO_BASE
+-- STMT_APPLY_CHANGES_TO_BASE_NODE
/* translated_size and last_mod_time are not mentioned here because they will
be tweaked after the working-file is installed.
### what to do about file_external? */
-INSERT OR REPLACE INTO base_node (
- wc_id, local_relpath, parent_relpath, presence, kind, revnum, changed_rev,
- changed_author, properties, repos_id, repos_relpath, checksum, changed_date,
- depth, symlink_target, dav_cache)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
-
--- STMT_APPLY_CHANGES_TO_BASE_NODE
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,
@@ -567,19 +514,8 @@ INSERT OR REPLACE INTO nodes (
VALUES (?1, ?2, 0,
?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
--- STMT_INSERT_WORKING_NODE_FROM_BASE_NODE
-INSERT INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties )
-SELECT wc_id, local_relpath, parent_relpath, ?3 AS presence, kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties
-FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
-- STMT_INSERT_WORKING_NODE_FROM_BASE
-INSERT INTO nodes (
+INSERT OR REPLACE INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
changed_revision, changed_date, changed_author, depth, symlink_target,
translated_size, last_mod_time, properties)
@@ -589,66 +525,43 @@ SELECT wc_id, local_relpath, ?3 AS op_de
FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE
-INSERT INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, copyfrom_repos_id,
- copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, local_relpath, parent_relpath, 'normal', kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, repos_id,
- repos_relpath, revnum
-FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE
+-- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
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 )
SELECT wc_id, local_relpath, ?3 AS op_depth, parent_relpath, repos_id,
- repos_path, revision, 'normal', depth, kind, changed_revision,
+ repos_path, revision, presence, depth, kind, changed_revision,
changed_date, changed_author, checksum, properties, translated_size,
last_mod_time, symlink_target
FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-
--- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE_NODE
-INSERT INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind, changed_rev,
- changed_date, changed_author, copyfrom_repos_id,
- copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, local_relpath, parent_relpath, 'not-present', kind, changed_rev,
- changed_date, changed_author, repos_id,
- repos_relpath, revnum
-FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE
+-- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY_PRESENCE
INSERT INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
- revision, presence, kind, changed_revision, changed_date, changed_author )
-SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, repos_id,
- repos_path, revision, 'not-present', kind, changed_revision,
- changed_date, changed_author
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, translated_size, last_mod_time,
+ symlink_target )
+SELECT wc_id, local_relpath, ?3 AS op_depth, parent_relpath, repos_id,
+ repos_path, revision, ?4 AS presence, depth, kind, changed_revision,
+ changed_date, changed_author, checksum, properties, translated_size,
+ last_mod_time, symlink_target
FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
--- ### the statement below should be setting copyfrom_revision!
+-- ### these statements below should be setting copyfrom_revision!
-- STMT_UPDATE_COPYFROM
-UPDATE working_node SET copyfrom_repos_id = ?3, copyfrom_repos_path = ?4
+UPDATE nodes SET repos_id = ?3, repos_path = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_CHILDREN_OP_DEPTH_RECURSIVE
-SELECT local_relpath, op_depth FROM nodes as node
-WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#'
AND op_depth = (SELECT MAX(op_depth) FROM nodes
- WHERE wc_id = node.wc_id
- AND local_relpath = node.local_relpath);
+ WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0);
+
+-- STMT_UPDATE_OP_DEPTH_RECURSIVE
+UPDATE nodes SET op_depth = ?3
+WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3 + 1;
-- STMT_UPDATE_OP_DEPTH
UPDATE nodes SET op_depth = ?4
@@ -656,13 +569,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2
-- STMT_UPDATE_COPYFROM_TO_INHERIT
-UPDATE working_node SET
- copyfrom_repos_id = NULL,
- copyfrom_repos_path = NULL,
- copyfrom_revnum = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_UPDATE_COPYFROM_TO_INHERIT_1
UPDATE nodes SET
repos_id = NULL,
repos_path = NULL,
@@ -672,11 +578,6 @@ WHERE wc_id = ?1 AND local_relpath = ?2
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0);
-- STMT_DETERMINE_TREE_FOR_RECORDING
-SELECT 0 FROM base_node WHERE wc_id = ?1 AND local_relpath = ?2
-UNION
-SELECT 1 FROM working_node WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_DETERMINE_TREE_FOR_RECORDING_1
SELECT 0 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
UNION
SELECT 1 FROM nodes WHERE wc_id = ?1 AND local_relpath = ?2
@@ -684,22 +585,82 @@ SELECT 1 FROM nodes WHERE wc_id = ?1 AND
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > 0);
+-- STMT_COPY_NODES_ROW
+INSERT OR REPLACE INTO nodes (
+ wc_id, local_relpath, op_depth, parent_relpath,
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */ )
+SELECT wc_id,
+ ?4 /*dst_relpath*/,
+ ?6 /*dst_op_depth*/,
+ ?5 /*dst_parent_*/,
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3;
+
+-- STMT_COPY_NODES_AT_SAME_OP_DEPTH
+INSERT OR REPLACE INTO nodes (
+ wc_id, local_relpath, op_depth, parent_relpath,
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */ )
+SELECT wc_id,
+ ?4 /*dst_relpath*/ || SUBSTR(local_relpath, ?6 /*LEN(src_relpath)+1*/),
+ ?5 /*dst_depth*/,
+ ?4 /*dst_relpath*/ || SUBSTR(parent_relpath, ?6 /*LEN(src_relpath)+1*/),
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth = ?3;
+
+-- STMT_COPY_NODES_AT_GREATER_OP_DEPTH
+INSERT OR REPLACE INTO nodes (
+ wc_id, local_relpath, op_depth, parent_relpath,
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */ )
+SELECT wc_id,
+ ?4 /*dst_relpath*/ || SUBSTR(local_relpath, ?6 /*LEN(src_relpath)+1*/),
+ op_depth + ?5 /*dst_depth*/ - ?3 /*src_depth*/,
+ ?4 /*dst_relpath*/ || SUBSTR(parent_relpath, ?6 /*LEN(src_relpath)+1*/),
+ repos_id, repos_path, revision, presence, /* moved_here, moved_to, */
+ kind, properties, depth, checksum, symlink_target,
+ changed_revision, changed_date, changed_author,
+ translated_size, last_mod_time /* dav_cache, file_external */
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#' AND op_depth > ?3;
+
+-- STMT_COPY_ACTUAL_NODE_ROWS
+INSERT OR REPLACE INTO actual_node (
+ wc_id, local_relpath, parent_relpath, properties,
+ conflict_old, conflict_new, conflict_working,
+ prop_reject, changelist, text_mod, tree_conflict_data )
+SELECT wc_id,
+ ?4 /*dst_relpath*/ || SUBSTR(local_relpath, ?6 /*LEN(src_relpath)+1*/),
+ ?5 /*dst_parent_*/ || SUBSTR(parent_relpath, ?7 /*LEN(src_parent_)+1*/),
+ properties,
+ conflict_old, conflict_new, conflict_working,
+ prop_reject, changelist, text_mod, tree_conflict_data
+FROM actual_node
+WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#');
+
+-- STMT_SELECT_ABSENT_NODES
+SELECT local_relpath FROM nodes
+WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+ AND op_depth = 0 AND presence = 'absent' LIMIT 1;
+
/* ### Why can't this query not just use the BASE repository
location values, instead of taking 3 additional parameters?! */
-- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE
-INSERT OR REPLACE INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, copyfrom_repos_id,
- copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, ?3 AS local_relpath, ?4 AS parent_relpath, ?5 AS presence, kind,
- checksum, translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, ?6 AS copyfrom_repos_id,
- ?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum
-FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE_1
INSERT OR REPLACE INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, repos_id,
repos_path, revision, presence, depth, kind, changed_revision,
@@ -713,19 +674,6 @@ FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING
-INSERT OR REPLACE INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, copyfrom_repos_id,
- copyfrom_repos_path, copyfrom_revnum )
-SELECT wc_id, ?3 AS local_relpath, ?4 AS parent_relpath, ?5 AS presence, kind,
- checksum, translated_size, changed_rev, changed_date, changed_author, depth,
- symlink_target, last_mod_time, properties, ?6 AS copyfrom_repos_id,
- ?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum
-FROM working_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING_1
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,
@@ -752,35 +700,30 @@ FROM actual_node
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_BASE_REVISION
-UPDATE base_node SET revnum = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_UPDATE_BASE_REVISION_1
UPDATE nodes SET revision = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_UPDATE_BASE_REPOS
-UPDATE base_node SET repos_id = ?3, repos_relpath = ?4
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_UPDATE_BASE_REPOS_1
UPDATE nodes SET repos_id = ?3, repos_path = ?4
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
+-- STMT_SELECT_NODES_GE_OP_DEPTH_RECURSIVE
+SELECT 1
+FROM nodes
+WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+ AND op_depth >= ?4;
+
+-- STMT_SELECT_ACTUAL_NODE_RECURSIVE
+SELECT 1
+FROM actual_node
+WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+ AND tree_conflict_data IS NULL;
+
/* ------------------------------------------------------------------------- */
/* these are used in entries.c */
-- STMT_INSERT_BASE_NODE_FOR_ENTRY
-INSERT OR REPLACE INTO base_node (
- wc_id, local_relpath, repos_id, repos_relpath, parent_relpath,
- presence,
- revnum, kind, checksum, translated_size, changed_rev, changed_date,
- changed_author, depth, last_mod_time, properties)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
- ?15, ?16);
-
--- STMT_INSERT_BASE_NODE_FOR_ENTRY_1
/* The BASE tree has a fixed op_depth '0' */
INSERT OR REPLACE INTO nodes (
wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
@@ -790,32 +733,6 @@ INSERT OR REPLACE INTO nodes (
VALUES (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13,
?14, ?15, ?16 );
--- STMT_INSERT_WORKING_NODE
-INSERT OR REPLACE INTO working_node (
- wc_id, local_relpath, parent_relpath, presence, kind,
- copyfrom_repos_id,
- copyfrom_repos_path, copyfrom_revnum, moved_here, moved_to, checksum,
- translated_size, changed_rev, changed_date, changed_author, depth,
- last_mod_time, properties, keep_local, symlink_target)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
- ?15, ?16, ?17, ?18, ?19, ?20);
-
--- STMT_INSERT_WORKING_NODE_DATA_1
-INSERT OR REPLACE INTO node_data (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- original_repos_id, original_repos_path, original_revision, checksum,
- changed_revision, changed_date, changed_author, depth, properties,
- symlink_target )
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9,
- ?10, ?11, ?12, ?13, ?14, ?15, ?16 );
-
--- STMT_INSERT_WORKING_NODE_DATA_2
-INSERT OR REPLACE INTO working_node (
- wc_id, local_relpath, parent_relpath, moved_here, moved_to, translated_size,
- last_mod_time, keep_local )
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8 );
-
-
-- STMT_INSERT_ACTUAL_NODE
INSERT OR REPLACE INTO actual_node (
wc_id, local_relpath, parent_relpath, properties, conflict_old,
@@ -825,27 +742,15 @@ INSERT OR REPLACE INTO actual_node (
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11);
-- STMT_SELECT_NOT_PRESENT
-SELECT 1 FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2 AND presence = 'not-present';
-
--- STMT_SELECT_NOT_PRESENT_1
SELECT 1 FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND presence = 'not-present'
AND op_depth = 0;
-- STMT_SELECT_FILE_EXTERNAL
-SELECT file_external FROM base_node
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_SELECT_FILE_EXTERNAL_1
SELECT file_external FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_UPDATE_FILE_EXTERNAL
-UPDATE base_node SET file_external = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_UPDATE_FILE_EXTERNAL_1
UPDATE nodes SET file_external = ?3
WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
@@ -853,42 +758,29 @@ WHERE wc_id = ?1 AND local_relpath = ?2
/* these are used in upgrade.c */
+-- STMT_UPDATE_ACTUAL_CONFLICT_DATA
+UPDATE actual_node SET conflict_data = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_INSERT_ACTUAL_CONFLICT_DATA
+INSERT INTO actual_node (
+ wc_id, local_relpath, conflict_data, parent_relpath)
+VALUES (?1, ?2, ?3, ?4);
+
-- STMT_SELECT_OLD_TREE_CONFLICT
SELECT wc_id, local_relpath, tree_conflict_data
FROM actual_node
WHERE tree_conflict_data IS NOT NULL;
--- STMT_INSERT_NEW_CONFLICT
-INSERT INTO conflict_victim (
- wc_id, local_relpath, parent_relpath, node_kind, conflict_kind,
- property_name, conflict_action, conflict_reason, operation,
- left_repos_id, left_repos_relpath, left_peg_rev, left_kind,
- right_repos_id, right_repos_relpath, right_peg_rev, right_kind)
-VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15,
- ?16, ?17);
-
-- STMT_ERASE_OLD_CONFLICTS
UPDATE actual_node SET tree_conflict_data = NULL;
-- STMT_SELECT_ALL_FILES
/* Should this select on wc_id as well? */
-SELECT local_relpath FROM base_node
-WHERE kind = 'file' AND parent_relpath = ?1
-UNION
-SELECT local_relpath FROM working_node
-WHERE kind = 'file' AND parent_relpath = ?1;
-
--- STMT_SELECT_ALL_FILES_1
-/* Should this select on wc_id as well? */
SELECT DISTINCT local_relpath FROM nodes
WHERE kind = 'file' AND parent_relpath = ?1;
-- STMT_PLAN_PROP_UPGRADE
-SELECT 0, presence, wc_id FROM base_node WHERE local_relpath = ?1
-UNION ALL
-SELECT 1, presence, wc_id FROM working_node WHERE local_relpath = ?1;
-
--- STMT_PLAN_PROP_UPGRADE_1
SELECT 0, nodes_base.presence, nodes_base.wc_id FROM nodes nodes_base
WHERE nodes_base.local_relpath = ?1 AND nodes_base.op_depth = 0
UNION ALL
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc.h?rev=1041580&r1=1041579&r2=1041580&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc.h Thu Dec 2 20:55:08 2010
@@ -129,7 +129,7 @@ extern "C" {
* Please document any further format changes here.
*/
-#define SVN_WC__VERSION 19
+#define SVN_WC__VERSION 22
/* Formats <= this have no concept of "revert text-base/props". */
#define SVN_WC__NO_REVERT_FILES 4
@@ -164,11 +164,6 @@ extern "C" {
/* A version < this does not store properties in wc.db. */
#define SVN_WC__PROPS_IN_DB 18
-#if (SVN_WC__VERSION > 19)
-#define SVN_WC__NODES
-#define SVN_WC__NODES_ONLY
-#endif
-
/* Return true iff error E indicates an "is not a working copy" type
of error, either because something wasn't a working copy at all, or
because it's a working copy from a previous version (in need of