[PATCH] Clarify the description of FSFS node-revision ids

Julian Foad <[email protected]> Fri, 04 Dec 2009 14:57:58 +0000
Newsgroups gmane.comp.version-control.subversion.devel,gmane.comp.version-control.subversion.rapidsvn.devel
Message-ID <1259938678.26091.656.camel@edith>
Can anyone with a clue about FSFS check this patch:

[[[
* subversion/libsvn_fs_fs/structure
  Expand and clarify the description of FSFS node-revision ids.
  Fix a typo.
]]]

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2427059

Please start new threads on the <[email protected]> mailing list.
To subscribe to the new list, send an empty e-mail to <[email protected]>.
fsfs-structure-doc.patch (text/x-patch, 2.4 KB)
* subversion/libsvn_fs_fs/structure
  Expand and clarify the description of FSFS node-revision ids.
  Fix a typo.
--This line, and those below, will be ignored--

Note: in the diff below, indentation changes are not shown in full.

Index: subversion/libsvn_fs_fs/structure
===================================================================
--- subversion/libsvn_fs_fs/structure	(revision 887172)
+++ subversion/libsvn_fs_fs/structure	(working copy)
@@ -224,16 +224,32 @@ character.
 Node-revision IDs
 -----------------
 
+A node-rev ID consists of the following three fields:
+
+    node_revision_id ::= node_id '.' copy_id '.' txn_id
+
+At this level, the form of the ID is the same as for BDB - see the
+section called "ID's" in <../libsvn_fs_base/notes/structure>.
+
 In order to support efficient lookup of node-revisions by their IDs
 and to simplify the allocation of fresh node-IDs during a transaction,
-we treat the fields of a node-ID in new and interesting ways.
+we treat the fields of a node-rev ID in new and interesting ways.
 
-Within a revision file, node-revs have a txn-id field of the form
-"r<rev>/<offset>", to support easy lookup.  New node-revision IDs
-assigned within a transaction have the txn-id field of "t<txnid>".
+Within a new transaction:
+
+  New node-revision IDs assigned within a transaction have a txn-id
+  field of the form "t<txnid>".
 
   When a new node-id or copy-id is assigned in a transaction, the ID
   used is a "_" followed by a base36 number unique to the transaction.
+
+Within a revision:
+
+  Within a revision file, node-revs have a txn-id field of the form
+  "r<rev>/<offset>", to support easy lookup. The <offset> is the (ASCII
+  decimal) number of bytes from the start of the revision file to the
+  start of the node-rev.
+
   During the final phase of a commit, node-revision IDs are rewritten
   to have repository-wide unique node-ID and copy-ID fields, and to have
   "r<rev>/<offset>" txn-id fields.
@@ -252,7 +268,7 @@ added to the transaction-specific base36
   this just prevents I/O-less node-origin-rev lookup for those nodes.)
 
 The temporary assignment of node-ID and copy-ID fields has
-implications for svn_fs_compare_ids and svn_fs_check_related.  The IDs
+implications for svn_fs_compare_ids and svn_fs_check_related.  The ID
 _1.0.t1 is not related to the ID _1.0.t2 even though they have the
 same node-ID, because temporary node-IDs are restricted in scope to
 the transactions they belong to.