You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/10/07 12:01:20 UTC
svn commit: r1005388 - in /subversion/trunk/subversion/libsvn_wc:
wc-metadata.sql wc.h
Author: philip
Date: Thu Oct 7 10:01:20 2010
New Revision: 1005388
URL: http://svn.apache.org/viewvc?rev=1005388&view=rev
Log:
Bump the working copy format and enable NODES. Working copies will
be automatically upgraded.
* subversion/libsvn_wc/wc.h
(SVN_WC__VERSION): Bump to 20.
* subversion/libsvn_wc/wc.h
(STMT_CREATE_SCHEMA): Remove BASE_NODE and WORKING_NODE.
(STMT_UPGRADE_TO_20): Renamed from DISABLED_STMT_UPGRADE_TO_20 and
enabled, drop the "inherited" BASE_NODE format 99 stuff.
Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
subversion/trunk/subversion/libsvn_wc/wc.h
Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1005388&r1=1005387&r2=1005388&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Thu Oct 7 10:01:20 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
@@ -337,7 +96,7 @@ CREATE TABLE PRISTINE (
size INTEGER,
/* ### this will probably go away, in favor of counting references
- ### that exist in BASE_NODE and WORKING_NODE. */
+ ### that exist in NODES. */
refcount INTEGER NOT NULL,
/* Alternative MD5 checksum used for communicating with older
@@ -349,177 +108,16 @@ CREATE TABLE PRISTINE (
/* ------------------------------------------------------------------------- */
-/* 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,
@@ -813,8 +411,9 @@ CREATE TABLE NODES (
/* Last-Change fields */
/* 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.
+ 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,
@@ -991,9 +590,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,
@@ -1028,7 +625,6 @@ DROP TABLE BASE_NODE;
DROP TABLE WORKING_NODE;
PRAGMA user_version = 20;
-*/
/* ------------------------------------------------------------------------- */
@@ -1044,81 +640,6 @@ PRAGMA user_version = 20;
number will be, however, so we're just marking it as 99 for now. */
-- format: 99
-/* 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
-);
-
-/* 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;
-
-/* 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)
- );
-
-/* 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;
-
/* Now "drop" the tree_conflict_data column from actual_node. */
CREATE TABLE ACTUAL_NODE_BACKUP (
wc_id INTEGER NOT NULL,
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1005388&r1=1005387&r2=1005388&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Thu Oct 7 10:01:20 2010
@@ -129,7 +129,7 @@ extern "C" {
* Please document any further format changes here.
*/
-#define SVN_WC__VERSION 19
+#define SVN_WC__VERSION 20
/* Formats <= this have no concept of "revert text-base/props". */
#define SVN_WC__NO_REVERT_FILES 4