This file describes the design, layouts, and file formats of a libsvn_fs_fs repository. Design ------ In FSFS, each committed revision is represented as an immutable file containing the new node-revisions, contents, and changed-path information for the revision, plus a second, changeable file containing the revision properties. In contrast to the BDB back end, the contents of recent revision of files are stored as deltas against earlier revisions, instead of the other way around. This is less efficient for common-case checkouts, but brings greater simplicity and robustness, as well as the flexibility to make commits work without write access to existing revisions. Skip-deltas and delta combination mitigate the checkout cost. In-progress transactions are represented with a prototype rev file containing only the new text representations of files (appended to as changed file contents come in), along with a separate file for each node-revision, directory representation, or property representation which has been changed or added in the transaction. During the final stage of the commit, these separate files are marshalled onto the end of the prototype rev file to form the immutable revision file. Layout of the FS directory -------------------------- The layout of the FS directory (the "db" subdirectory of the repository) is: revs/ Subdirectory containing revs / Shard directory, if sharding is in use (see below) File containing rev revprops/ Subdirectory containing rev-props / Shard directory, if sharding is in use (see below) File containing rev-props for indexes.sqlite SQLite database containing index for svn:mergeinfo props transactions/ Subdirectory containing transactions .txn/ Directory containing transaction transaction-current File containing the next transaction key locks/ Subdirectory containing locks / Subdirectory named for first 3 letters of an MD5 digest File containing locks/children for path with current File specifying current revision and next node/copy id fs-type File identifying this filesystem as an FSFS filesystem write-lock Empty file, locked to serialise writers uuid File containing the UUID of the repository format File containing the format number of this filesystem Files in the revprops directory are in the hash dump format used by svn_hash_write. The format of the "current" file is a single line of the form " \n" giving the youngest revision, the next unique node-ID, and the next unique copy-ID for the repository. The "write-lock" file is an empty file which is locked before the final stage of a commit and unlocked after the new "current" file has been moved into place to indicate that a new revision is present. It is also locked during a revprop propchange while the revprop file is read in, mutated, and written out again. Note that readers are never blocked by any operation - writers must ensure that the filesystem is always in a consistent state. The "transaction-current" file is a file with a single line of text that contains only a base-36 number. The current value will be used in the next transaction name, along with the revision number the transaction is based on. This sequence number ensures that transaction names are not reused, even if the transaction is aborted and a new transaction based on the same revision is begun. The "transaction-current" file is read and written under the fs-wide write-lock. Filesystem formats ------------------ The "format" file defines what features are permitted within the filesystem, and indicates changes that are not backward-compatible. It serves the same purpose as the repository file of the same name. The filesystem format file was introduced in Subversion 1.2, and so will not be present if the repository was created with an older version of Subversion. An absent format file should be interpreted as indicating a format 1 filesystem. The format file is a single line of the form "\n", followed by any number of lines specifying 'format options' - additional information about the filesystem's format. Each format option line is of the form "