Hey WC-NG folks, please tell me what's right/wrong/unsure in the additions and changes below. Feel free to commit any parts that are right: I'm not yet familiar enough to really be comfortable committing it myself but I will if you want.
- Julian
* subversion/libsvn_wc/wc-metadata.sql (PRISTINE, WORKING_NODE, ACTUAL_NODE): Add doc strings, notes and queries. --This line, and those below, will be ignored-- Index: subversion/libsvn_wc/wc-metadata.sql =================================================================== --- subversion/libsvn_wc/wc-metadata.sql (revision 910914) +++ subversion/libsvn_wc/wc-metadata.sql (working copy) @@ -175,6 +175,7 @@ CREATE TABLE PRISTINE ( ### that no compression has been applied. */ compression INTEGER, + /* Size in bytes of the (uncompressed) pristine text. */ /* ### used to verify the pristine file is "proper". NULL if unknown, ### and (thus) the pristine copy is incomplete/unusable. */ size INTEGER, @@ -189,6 +190,33 @@ CREATE TABLE PRISTINE ( /* ------------------------------------------------------------------------- */ +/* The WORKING_NODE table describes tree changes in the WC relative to the + BASE_NODE table. + + The WORKING_NODE entry for a given path exists iff a node at this path + is directly (not just a child) one of: + + - deleted + - the source path of a move + + and/or one of: + + - added + - copied here (from WC or from repos) + - moved here [MOVE1] + + If a path is a child (or grandchild, etc.) under any such operation on a + directory, and is otherwise not subject to its own tree change, it is not + represented in the WORKING_NODE table. + + Every path for which an entry exists in the WORKING_NODE table also has + an entry in the BASE_NODE table. + + [MOVE1] The "move" operation in WC-NG requires that both the source and + destination paths are represented in the BASE_NODE and WORKING_NODE + tables. + + */ CREATE TABLE WORKING_NODE ( /* specifies the location of this node in the local filesystem */ wc_id INTEGER NOT NULL REFERENCES WCROOT (id), @@ -209,6 +237,7 @@ CREATE TABLE WORKING_NODE ( 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 an add-without-history, the records are simply removed rather than switched to not-present. @@ -221,8 +250,9 @@ CREATE TABLE WORKING_NODE ( 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). */ + base-deleted: the node which in the BASE tree exists at local_relpath + has in the WORKING tree been deleted or moved away (see the moved_to + column to determine which), and has not been not replaced. */ presence TEXT NOT NULL, /* the kind of the new node. may be "unknown" if the node is not present. */ @@ -254,23 +284,28 @@ CREATE TABLE WORKING_NODE ( /* for kind==symlink, this specifies the target. */ symlink_target TEXT, - /* Where this node was copied/moved from. Set only on the root of the - operation, and implied for all children. */ + /* Where this node was copied/moved from. All copyfrom_* fields are set + only on the root of the operation, and is NULL for all children. */ copyfrom_repos_id INTEGER REFERENCES REPOSITORY (id), /* ### BH: Should we call this copyfrom_repos_relpath and skip the initial '/' ### to match the other repository paths used in sqlite and to make it easier ### to join these paths? */ + /* ### JF: For a move, we need to store or deduce the copyfrom local- + relpath. (A move is a "true rename" and the copyfrom revision is implicit, + being in effect (new head - 1) at commit time.) */ copyfrom_repos_path TEXT, copyfrom_revnum INTEGER, - /* Boolean value, specifying if this node was moved here (rather than just - copied). The source of the move is specified in copyfrom_*. */ + /* Boolean value, TRUE if this node was moved here, FALSE if copied here, + NULL if neither. Iff not NULL, the source of the move is specified in + copyfrom_*. */ moved_here INTEGER, /* If the underlying node was moved (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 implied for all children. - The whole moved subtree is marked with presence=base-deleted + This is set only on the root of a move, and is NULL for all children. + Each path in the whole moved subtree is marked with + presence 'base-deleted', or 'normal' if replaced. Note that moved_to never refers to *this* node. It always refers to the "underlying" node, whether that is BASE or a child node @@ -282,7 +317,7 @@ CREATE TABLE WORKING_NODE ( ### 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. could be NULL if we + /* serialized skel of this node's properties. NULL if we have no information about the properties (a non-present node). */ properties BLOB, @@ -305,6 +340,16 @@ CREATE INDEX I_WORKING_PARENT ON WORKING /* ------------------------------------------------------------------------- */ +/* + The ACTUAL_NODE table describes text changes and property changes in the + WC, relative to the WORKING_NODE table. + + The ACTUAL_NODE table entry for a given path exists iff the node at that + path is known to have text or property changes relative to its + WORKING_NODE entry. ("Is known" because a text change on disk may not yet + have been discovered and recorded here.) + + */ CREATE TABLE ACTUAL_NODE ( /* specifies the location of this node in the local filesystem */ wc_id INTEGER NOT NULL REFERENCES WCROOT (id),