Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | d5a4e41c81280c86e9922785713294ef78083065 |
|---|---|
| Date: | 2010-03-16 15:38:54 |
| User: | drh |
| Comment: | Improved file format documentation. Added information on the attachment artifact. Redefine the A-card (which has not previously been used). Update the Manifest object to store attachment artifacts. |
Tags And Properties
- branch=trunk inherited from [a28c83647d] branch timeline
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Changes to src/manifest.c
@@ -37,67 +37,56 @@
#define CFTYPE_MANIFEST 1
#define CFTYPE_CLUSTER 2
#define CFTYPE_CONTROL 3
#define CFTYPE_WIKI 4
#define CFTYPE_TICKET 5
-
-/*
-** Mode parameter values
-*/
-#define CFMODE_READ 1
-#define CFMODE_APPEND 2
-#define CFMODE_WRITE 3
+#define CFTYPE_ATTACHMENT 6
/*
** A parsed manifest or cluster.
*/
struct Manifest {
Blob content; /* The original content blob */
- int type; /* Type of file */
- int mode; /* Access mode */
- char *zComment; /* Decoded comment */
- double rDate; /* Time in the "D" line */
- char *zUser; /* Name of the user */
- char *zRepoCksum; /* MD5 checksum of the baseline content */
- char *zWiki; /* Text of the wiki page */
- char *zWikiTitle; /* Name of the wiki page */
- char *zTicketUuid; /* UUID for a ticket */
- int nFile; /* Number of F lines */
+ int type; /* Type of artifact. One of CFTYPE_xxxxx */
+ char *zComment; /* Decoded comment. The C card. */
+ double rDate; /* Date and time from D card. 0.0 if no D card. */
+ char *zUser; /* Name of the user from the U card. */
+ char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */
+ char *zWiki; /* Text of the wiki page. W card. */
+ char *zWikiTitle; /* Name of the wiki page. L card. */
+ char *zTicketUuid; /* UUID for a ticket. K card. */
+ char *zAttachName; /* Filename of an attachment. A card. */
+ char *zAttachSrc; /* UUID of document being attached. A card. */
+ char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */
+ int nFile; /* Number of F cards */
int nFileAlloc; /* Slots allocated in aFile[] */
struct {
char *zName; /* Name of a file */
char *zUuid; /* UUID of the file */
char *zPerm; /* File permissions */
char *zPrior; /* Prior name if the name was changed */
int iRename; /* index of renamed name in prior/next manifest */
- } *aFile;
- int nParent; /* Number of parents */
+ } *aFile; /* One entry for each F card */
+ int nParent; /* Number of parents. */
int nParentAlloc; /* Slots allocated in azParent[] */
- char **azParent; /* UUIDs of parents */
+ char **azParent; /* UUIDs of parents. One for each P card argument */
int nCChild; /* Number of cluster children */
int nCChildAlloc; /* Number of closts allocated in azCChild[] */
- char **azCChild; /* UUIDs of referenced objects in a cluster */
- int nTag; /* Number of T lines */
+ char **azCChild; /* UUIDs of referenced objects in a cluster. M cards */
+ int nTag; /* Number of T Cards */
int nTagAlloc; /* Slots allocated in aTag[] */
struct {
char *zName; /* Name of the tag */
char *zUuid; /* UUID that the tag is applied to */
char *zValue; /* Value if the tag is really a property */
- } *aTag;
- int nField; /* Number of J lines */
+ } *aTag; /* One for each T card */
+ int nField; /* Number of J cards */
int nFieldAlloc; /* Slots allocated in aField[] */
struct {
char *zName; /* Key or field name */
char *zValue; /* Value of the field */
- } *aField;
- int nAttach; /* Number of A lines */
- int nAttachAlloc; /* Slots allocated in aAttach[] */
- struct {
- char *zUuid; /* UUID of the attachment */
- char *zName; /* Name of the attachment */
- char *zDesc; /* Description of the attachment */
- } *aAttach;
+ } *aField; /* One for each J card */
};
#endif
/*
@@ -108,11 +97,10 @@
free(p->aFile);
free(p->azParent);
free(p->azCChild);
free(p->aTag);
free(p->aField);
- free(p->aAttach);
memset(p, 0, sizeof(*p));
}
/*
** Parse a blob into a Manifest object. The Manifest object
@@ -178,44 +166,42 @@
cPrevType = z[0];
seenHeader = 1;
if( blob_token(&line, &token)!=1 ) goto manifest_syntax_error;
switch( z[0] ){
/*
- ** A <uuid> <filename> <description>
+ ** A (+|-)<filename> target source
**
** Identifies an attachment to either a wiki page or a ticket.
** <uuid> is the artifact that is the attachment.
*/
case 'A': {
- char *zName, *zUuid, *zDesc;
+ char *zName, *zTarget, *zSrc;
md5sum_step_text(blob_buffer(&line), blob_size(&line));
if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
if( blob_token(&line, &a3)==0 ) goto manifest_syntax_error;
- zUuid = blob_terminate(&a1);
- zName = blob_terminate(&a2);
- zDesc = blob_terminate(&a3);
- if( blob_size(&a1)!=UUID_SIZE ) goto manifest_syntax_error;
- if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
+ if( p->zAttachName!=0 ) goto manifest_syntax_error;
+ zName = blob_terminate(&a1);
+ zTarget = blob_terminate(&a2);
+ zSrc = blob_terminate(&a3);
defossilize(zName);
- if( !file_is_simple_pathname(zName) ){
+ if( zName[0]!='+' && zName[0]!='-' ){
goto manifest_syntax_error;
}
- defossilize(zDesc);
- if( p->nAttach>=p->nAttachAlloc ){
- p->nAttachAlloc = p->nAttachAlloc*2 + 10;
- p->aAttach = realloc(p->aAttach,
- p->nAttachAlloc*sizeof(p->aAttach[0]) );
- if( p->aAttach==0 ) fossil_panic("out of memory");
- }
- i = p->nAttach++;
- p->aAttach[i].zUuid = zUuid;
- p->aAttach[i].zName = zName;
- p->aAttach[i].zDesc = zDesc;
- if( i>0 && strcmp(p->aAttach[i-1].zUuid, zUuid)>=0 ){
+ if( !file_is_simple_pathname(&zName[1]) ){
goto manifest_syntax_error;
}
+ defossilize(zTarget);
+ if( (blob_size(&a2)!=UUID_SIZE || !validate16(zTarget, UUID_SIZE))
+ && !wiki_name_is_wellformed((const unsigned char *)zTarget) ){
+ goto manifest_syntax_error;
+ }
+ if( blob_size(&a3)!=UUID_SIZE ) goto manifest_syntax_error;
+ if( !validate16(zSrc, UUID_SIZE) ) goto manifest_syntax_error;
+ p->zAttachName = zName;
+ p->zAttachSrc = zSrc;
+ p->zAttachTarget = zTarget;
break;
}
/*
** C <comment>
@@ -247,33 +233,10 @@
if( p->rDate!=0.0 ) goto manifest_syntax_error;
if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
zDate = blob_terminate(&a1);
p->rDate = db_double(0.0, "SELECT julianday(%Q)", zDate);
- break;
- }
-
- /*
- ** E <mode>
- **
- ** Access mode. <mode> can be one of "read", "append",
- ** or "write".
- */
- case 'E': {
- md5sum_step_text(blob_buffer(&line), blob_size(&line));
- if( p->mode!=0 ) goto manifest_syntax_error;
- if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
- if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
- if( blob_eq(&a1, "write") ){
- p->mode = CFMODE_WRITE;
- }else if( blob_eq(&a1, "append") ){
- p->mode = CFMODE_APPEND;
- }else if( blob_eq(&a1, "read") ){
- p->mode = CFMODE_READ;
- }else{
- goto manifest_syntax_error;
- }
break;
}
/*
** F <filename> <uuid> ?<permissions>? ?<old-name>?
@@ -608,72 +571,74 @@
if( p->nFile>0 || p->zRepoCksum!=0 ){
if( p->nCChild>0 ) goto manifest_syntax_error;
if( p->rDate==0.0 ) goto manifest_syntax_error;
if( p->nField>0 ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
- if( p->nAttach>0 ) goto manifest_syntax_error;
if( p->zWiki ) goto manifest_syntax_error;
if( p->zWikiTitle ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
p->type = CFTYPE_MANIFEST;
}else if( p->nCChild>0 ){
if( p->rDate>0.0 ) goto manifest_syntax_error;
if( p->zComment!=0 ) goto manifest_syntax_error;
if( p->zUser!=0 ) goto manifest_syntax_error;
if( p->nTag>0 ) goto manifest_syntax_error;
if( p->nParent>0 ) goto manifest_syntax_error;
- if( p->zRepoCksum!=0 ) goto manifest_syntax_error;
if( p->nField>0 ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
- if( p->nAttach>0 ) goto manifest_syntax_error;
if( p->zWiki ) goto manifest_syntax_error;
if( p->zWikiTitle ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
if( !seenZ ) goto manifest_syntax_error;
p->type = CFTYPE_CLUSTER;
}else if( p->nField>0 ){
if( p->rDate==0.0 ) goto manifest_syntax_error;
- if( p->zRepoCksum!=0 ) goto manifest_syntax_error;
if( p->zWiki ) goto manifest_syntax_error;
if( p->zWikiTitle ) goto manifest_syntax_error;
if( p->nCChild>0 ) goto manifest_syntax_error;
if( p->nTag>0 ) goto manifest_syntax_error;
if( p->zTicketUuid==0 ) goto manifest_syntax_error;
if( p->zUser==0 ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
if( !seenZ ) goto manifest_syntax_error;
p->type = CFTYPE_TICKET;
}else if( p->zWiki!=0 ){
if( p->rDate==0.0 ) goto manifest_syntax_error;
- if( p->zRepoCksum!=0 ) goto manifest_syntax_error;
if( p->nCChild>0 ) goto manifest_syntax_error;
if( p->nTag>0 ) goto manifest_syntax_error;
if( p->zTicketUuid!=0 ) goto manifest_syntax_error;
if( p->zWikiTitle==0 ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
if( !seenZ ) goto manifest_syntax_error;
p->type = CFTYPE_WIKI;
}else if( p->nTag>0 ){
if( p->rDate<=0.0 ) goto manifest_syntax_error;
- if( p->zRepoCksum!=0 ) goto manifest_syntax_error;
if( p->nParent>0 ) goto manifest_syntax_error;
- if( p->nAttach>0 ) goto manifest_syntax_error;
- if( p->nField>0 ) goto manifest_syntax_error;
- if( p->zWiki ) goto manifest_syntax_error;
if( p->zWikiTitle ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
if( !seenZ ) goto manifest_syntax_error;
p->type = CFTYPE_CONTROL;
- }else{
+ }else if( p->zAttachName ){
if( p->nCChild>0 ) goto manifest_syntax_error;
if( p->rDate==0.0 ) goto manifest_syntax_error;
+ if( p->zTicketUuid ) goto manifest_syntax_error;
+ if( p->zWikiTitle ) goto manifest_syntax_error;
+ p->type = CFTYPE_ATTACHMENT;
+ }else{
+ if( p->nCChild>0 ) goto manifest_syntax_error;
+ if( p->rDate<=0.0 ) goto manifest_syntax_error;
+ if( p->nParent>0 ) goto manifest_syntax_error;
if( p->nField>0 ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
- if( p->nAttach>0 ) goto manifest_syntax_error;
if( p->zWiki ) goto manifest_syntax_error;
if( p->zWikiTitle ) goto manifest_syntax_error;
if( p->zTicketUuid ) goto manifest_syntax_error;
+ if( p->zAttachName ) goto manifest_syntax_error;
p->type = CFTYPE_MANIFEST;
}
-
md5sum_init();
return 1;
manifest_syntax_error:
/*fprintf(stderr, "Manifest error on line %i\n", lineNo);fflush(stderr);*/
Changes to www/fileformat.wiki
@@ -1,26 +1,23 @@ <title>Fossil File Formats</title> <h1 align="center"> Fossil File Formats </h1> -<p>The global state of a fossil repository is kept simple so that it can +The global state of a fossil repository is kept simple so that it can endure in useful form for decades or centuries. A fossil repository is intended to be readable, -searchable, and extensible by people not yet born.</p> +searchable, and extensible by people not yet born. -<p> The global state of a fossil repository is an unordered set of <i>artifacts</i>. An artifact might be a source code file, the text of a wiki page, part of a trouble ticket, or one of several special control artifacts used to show the relationships between other artifacts within the project. Each artifact is normally represented on disk as a separate file. Artifacts can be text or binary. -</p> -<p> In addition to the global state, each fossil repository also contains local state. The local state consists of web-page formatting preferences, authorized users, ticket display and reporting formats, and so forth. The global state is shared in common among all @@ -29,82 +26,73 @@ The local state is not versioned and is not synchronized with the global state. The local state is not composed of artifacts and is not intended to be enduring. This document is concerned with global state only. Local state is only mentioned here in order to distinguish it from global state. -</p> -<p> Each artifact in the repository is named by its SHA1 hash. No prefixes or meta information is added to a artifact before its hash is computed. The name of a artifact in the repository is exactly the same SHA1 hash that is computed by sha1sum on the file as it exists in your source tree.</p> -<p> Some artifacts have a particular format which gives them special -meaning to fossil. Fossil recognizes:</p> +meaning to fossil. Fossil recognizes: <ul> -<li> Manifests </li> -<li> Clusters </li> -<li> Control Artifacts </li> -<li> Wiki Pages </li> -<li> Ticket Changes </li> +<li> [#manifest | Manifests] </li> +<li> [#cluster | Clusters] </li> +<li> [#ctrl | Control Artifacts] </li> +<li> [#wikichng | Wiki Pages] </li> +<li> [#tktchng | Ticket Changes] </li> +<li> [#artifact | Artifacts] </li> </ul> -<p>These five artifact types are described in the sequel.</p> +These five artifact types are described in the sequel. -<p>In the current implementation (as of 2009-01-25) the artifacts that +In the current implementation (as of 2009-01-25) the artifacts that make up a fossil repository are stored in in as delta- and zlib-compressed blobs in an <a href="http://www.sqlite.org/">SQLite</a> database. This is an implementation detail and might change in a future release. For the purpose of this article "file format" means the format of the artifacts, not how the artifacts are stored on disk. It is the artifact format that is intended to be enduring. The specifics of how artifacts are stored on disk, though stable, is not intended to live as long as the -artifact format.</p> +artifact format. +<a name="manifest"></a> <h2>1.0 The Manifest</h2> -<p>A manifest defines a check-in or version of the project +A manifest defines a check-in or version of the project source tree. The manifest contains a list of artifacts for each file in the project and the corresponding filenames, as well as information such as parent check-ins, the name of the programmer who created the check-in, the date and time when the check-in was created, and any check-in comments associated -with the check-in.</p> +with the check-in. -<p> Any artifact in the repository that follows the syntactic rules of a manifest is a manifest. Note that a manifest can be both a real manifest and also a content file, though this is rare. -</p> -<p> A manifest is a text file. Newline characters (ASCII 0x0a) separate the file into "cards". Each card begins with a single character "card type". Zero or more arguments may follow the card type. All arguments are separated from each other and from the card-type character by a single space character. There is no surplus white space between arguments and no leading or trailing whitespace except for the newline character that acts as the card separator. -</p> -<p> All cards of the manifest occur in strict sorted lexicographical order. No card may be duplicated. The entire manifest may be PGP clear-signed, but otherwise it may contain no additional text or data beyond what is described here. -</p> -<p> Allowed cards in the manifest are as follows: -</p> <blockquote> <b>C</b> <i>checkin-comment</i><br> <b>D</b> <i>time-and-date-stamp</i><br> <b>F</b> <i>filename</i> <i>SHA1-hash</i> <i>permissions</i> <i>old-name</i><br> @@ -113,11 +101,10 @@ <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name <b>*</b> ?value?</i><br> <b>U</b> <i>user-login</i><br> <b>Z</b> <i>manifest-checksum</i> </blockquote> -<p> A manifest must have exactly one C-card. The sole argument to the C-card is a check-in comment that describes the check-in that the manifest defines. The check-in comment is text. The following escape sequences are applied to the text: A space (ASCII 0x20) is represented as "\s" (ASCII 0x5C, 0x73). A @@ -124,24 +111,20 @@ newline (ASCII 0x0a) is "\n" (ASCII 0x6C, x6E). A backslash (ASCII 0x5C) is represented as two backslashes "\\". Apart from space and newline, no other whitespace characters are allowed in the check-in comment. Nor are any unprintable characters allowed in the comment. -</p> -<p> A manifest must have exactly one D-card. The sole argument to the D-card is a date-time stamp in the ISO8601 format. The date and time should be in coordinated universal time (UTC). The format is: -</p> <blockquote> <i>YYYY</i><b>-</b><i>MM</i><b>-</b><i>DD</i><b>T</b><i>HH</i><b>:</b><i>MM</i><b>:</b><i>SS</i> </blockquote> -<p> A manifest has zero or more F-cards. Each F-card defines a file (other than the manifest itself) which is part of the check-in that the manifest defines. There are two, three, or four arguments. The first argument is the pathname of the file in the check-in relative to the root @@ -157,13 +140,11 @@ always readable and writable. This can be expressed by "w" permission if desired but is optional. The optional 4th argument is the name of the same file as it existed in the parent check-in. If the name of the file is unchanged from its parent, then the 4th argument is omitted. -</p> -<p> A manifest has zero or one P-cards. Most manifests have one P-card. The P-card has a varying number of arguments that defines other manifests from which the current manifest is derived. Each argument is an 40-character lowercase hexadecimal SHA1 of the predecessor manifest. All arguments @@ -171,13 +152,11 @@ The first predecessor is the direct ancestor of the manifest. Other arguments define manifests with which the first was merged to yield the current manifest. Most manifests have a P-card with a single argument. The first manifest in the project has no ancestors and thus has no P-card. -</p> -<p> A manifest may optionally have a single R-card. The R-card has a single argument which is the MD5 checksum of all files in the check-in except the manifest itself. The checksum is expressed as 32-characters of lowercase hexadecimal. The checksum is computed as follows: For each file in the check-in (except for @@ -185,13 +164,11 @@ take the pathname of the file relative to the root of the repository, append a single space (ASCII 0x20), the size of the file in ASCII decimal, a single newline character (ASCII 0x0A), and the complete text of the file. Compute the MD5 checksum of the the result. -</p> -<p> A manifest might contain one or more T-cards used to set tags or properties on the check-in. The format of the T-card is the same as described in <i>Control Artifacts</i> section below, except that the second argument is the single characcter "<b>*</b>" instead of an artifact ID. The <b>*</b> in place of the artifact ID indicates that @@ -199,42 +176,35 @@ possible to encode the current artifact ID as part of an artifact, since the act of inserting the artifact ID would change the artifact ID, hence a <b>*</b> is used to represent "self". T-cards are typically added to manifests in order to set the <b>branch</b> property and a symbolic name when the check-in is intended to start a new branch. -</p> -<p> Each manifest has a single U-card. The argument to the U-card is the login of the user who created the manifest. The login name is encoded using the same character escapes as is used for the check-in comment argument to the C-card. -</p> -<p> A manifest has an option Z-card as its last line. The argument to the Z-card is a 32-character lowercase hexadecimal MD5 hash of all prior lines of the manifest up to and including the newline character that immediately precedes the "Z". The Z-card is just a sanity check to prove that the manifest is well-formed and consistent. -</p> -<p>A sample manifest from Fossil itself can be seen +A sample manifest from Fossil itself can be seen [/artifact/28987096ac | here]. +<a name="cluster"></a> <h2>2.0 Clusters</h2> -<p> A cluster is a artifact that declares the existence of other artifacts. Clusters are used during repository synchronization to help reduce network traffic. As such, clusters are an optimization and may be removed from a repository without loss or damage to the underlying project code. -</p> -<p> Clusters follow a syntax that is very similar to manifests. A Cluster is a line-oriented text file. Newline characters (ASCII 0x0a) separate the artifact into cards. Each card begins with a single character "card type". Zero or more arguments may follow the card type. All arguments are separated from each other @@ -245,67 +215,58 @@ All cards of a cluster occur in strict sorted lexicographical order. No card may be duplicated. The cluster may not contain additional text or data beyond what is described here. Unlike manifests, clusters are never PGP signed. -</p> -<p> Allowed cards in the cluster are as follows: -</p> <blockquote> <b>M</b> <i>artifact-id</i><br /> <b>Z</b> <i>checksum</i> </blockquote> -<p> A cluster contains one or more "M" cards followed by a single "Z" line. Each M card has a single argument which is the artifact ID of another artifact in the repository. The Z card work exactly like the Z card of a manifest. The argument to the Z card is the lower-case hexadecimal representation of the MD5 checksum of all prior cards in the cluster. Note that the Z card is required on a cluster. -</p> -<p>An example cluster from Fossil can be seen -[/artifact/d03dbdd73a2a8 | here].</p> +An example cluster from Fossil can be seen +[/artifact/d03dbdd73a2a8 | here]. - +<a name="ctrl"></a> <h2>3.0 Control Artifacts</h2> -<p> Control artifacts are used to assign properties to other artifacts within the repository. The basic format of a control artifact is the same as a manifest or cluster. A control artifact is a text files divided into cards by newline characters. Each card has a single-character card type followed by arguments. Spaces separate the card type and the arguments. No surplus whitespace is allowed. All cards must occur in strict lexigraphical order. -</p> -<p> Allowed cards in a control artifact are as follows: -</p> <blockquote> <b>D</b> <i>time-and-date-stamp</i><br /> <b>T</b> (<b>+</b>|<b>-</b>|<b>*</b>)<i>tag-name artifact-id ?value?</i><br /> +<b>U</b> <i>user-name</i><br /> <b>Z</b> <i>checksum</i><br /> </blockquote> -<p> A control artifact must have one D card and one Z card and one or more T cards. No other cards or other text is allowed in a control artifact. Control artifacts might be PGP -clearsigned.</p> +clearsigned. -<p>The D card and the Z card of a control artifact are the same -as in a manifest.</p> +The D card and the Z card of a control artifact are the same +as in a manifest. -<p>The T card represents a "tag" or property that is applied to +The T card represents a "tag" or property that is applied to some other artifact. The T card has two or three values. The second argument is the 40 character lowercase artifact ID of the artifact to which the tag is to be applied. The first value is the tag name. The first character of the tag is either "+", "-", or "*". A "+" means the tag should be added @@ -313,28 +274,37 @@ The "*" character means the tag should be added to the artifact and all direct descendants (but not branches) of the artifact down to but not including the first descendant that contains a more recent "-" tag with the same name. The optional third argument is the value of the tag. A tag -without a value is a boolean.</p> +without a value is a boolean. -<p>When two or more tags with the same name are applied to the +When two or more tags with the same name are applied to the same artifact, the tag with the latest (most recent) date is -used.</p> +used. -<p>Some tags have special meaning. The "comment" tag when applied +Some tags have special meaning. The "comment" tag when applied to a check-in will override the check-in comment of that check-in -for display purposes.</p> +for display purposes. The "user" tag overrides the name of the +check-in user. The "date" tag overrides the check-in date. +The "branch" tag sets the name of the branch that at check-in +belongs to. Symbolic tags begin with the "sym-" prefix. + +The U card is the name of the user that created the control +artifact. The Z card is the usual artifact checksum. + +An example control artifacts can be seen [/info/9d302ccda8 | here]. + <a name="wikichng"></a> <h2>4.0 Wiki Pages</h2> -<p>A wiki page is an artifact with a format similar to manifests, +A wiki page is an artifact with a format similar to manifests, clusters, and control artifacts. The artifact is divided into cards by newline characters. The format of each card is as in manifests, clusters, and control artifacts. Wiki artifacts accept -the following card types:</p> +the following card types: <blockquote> <b>D</b> <i>time-and-date-stamp</i><br /> <b>L</b> <i>wiki-title</i><br /> <b>P</b> <i>parent-artifact-id</i>+<br /> @@ -341,63 +311,245 @@ <b>U</b> <i>user-name</i><br /> <b>W</b> <i>size</i> <b>\n</b> <i>text</i> <b>\n</b><br /> <b>Z</b> <i>checksum</i> </blockquote> -<p>The D card is the date and time when the wiki page was edited. +The D card is the date and time when the wiki page was edited. The P card specifies the parent wiki pages, if any. The L card gives the name of the wiki page. The U card specifies the login of the user who made this edit to the wiki page. The Z card is -the usual checksum over the either artifact.</p> +the usual checksum over the either artifact. -<p>The W card is used to specify the text of the wiki page. The +The W card is used to specify the text of the wiki page. The argument to the W card is an integer which is the number of bytes of text in the wiki page. That text follows the newline character that terminates the W card. The wiki text is always followed by one -extra newline.</p> +extra newline. + +An example wiki artifact can be seen +[/artifact/7b2f5fd0e0 | here]. <a name="tktchng"></a> <h2>5.0 Ticket Changes</h2> -<p>A ticket-change artifact represents a change to a trouble ticket. -The following cards are allowed on a ticket change artifact:</p> +A ticket-change artifact represents a change to a trouble ticket. +The following cards are allowed on a ticket change artifact: <blockquote> <b>D</b> <i>time-and-date-stamp</i><br /> <b>J</b> ?<b>+</b>?<i>name</i> ?<i>value</i>?<br /> <b>K</b> <i>ticket-id</i><br /> <b>U</b> <i>user-name</i><br /> <b>Z</b> <i>checksum</i> </blockquote> -<p> The D card is the usual date and time stamp and represents the point in time when the change was entered. The U card is the login of the programmer who entered this change. The Z card is the checksum over -the entire artifact.</p> +the entire artifact. -<p> Every ticket has a unique ID. The ticket to which this change is applied is specified by the K card. A ticket exists if it contains one or more changes. The first "change" to a ticket is what brings the -ticket into existence.</p> +ticket into existence. -<p> J cards specify changes to the "value" of "fields" in the ticket. If the <i>value</i> parameter of the J card is omitted, then the field is set to an empty string. Each fossil server has a ticket configuration which specifies the fields its understands. The ticket configuration is part of the local state for the repository and thus can vary from one repository to another. Hence a J card might specify a <i>field</i> that do not exist in the local ticket configuration. If a J card specifies a <i>field</i> that is not in the local configuration, then that J card -is simply ignored.</p> +is simply ignored. -<p> The first argument of the J card is the field name. The second value is the field value. If the field name begins with "+" then the value is appended to the prior value. Otherwise, the value on the J card replaces any previous value of the field. The field name and value are both encoded using the character escapes defined for the C card of a manifest. -</p> + +An example ticket-change artifact can be seen +[/artifact/91f1ec6af053 | here]. + +<a name="attachment"></a> +<h2>6.0 Attachments</h2> + +An attachment artifact associates some other artifact that is the +attachment (the source artifact) with a ticket or wiki page to which +the attachment is connected (the target artifact). +The following cards are allowed on an attachment artifact: + +<blockquote> +<b>A</b> (<b>+</b>|<b>-</b>)<i>filename target source</i> +<b>C</b> <i>comment</i><br> +<b>D</b> <i>time-and-date-stamp</i><br /> +<b>U</b> <i>user-name</i><br /> +<b>Z</b> <i>checksum</i> +</blockquote> + +The A card specifies a filename for the attachment in its first argument. +The filename is preceeded by "+" to add the attachment or "-" to +remove the attachment. The second argument to the A card is the name +of the wiki page or ticket to which the attachment is connected. The +third argument is is the 40-character artifact ID of the attachment +itself. Every attachment artifact must have exactly one A card. + +The C card is an optional comment describing what the attachment is about. +The C card is optional, but there can only be one. + +A single D card is required to give the date and time when the attachment +was applied. + +A single U card gives the name of the user to added the attachment. +If an attachment is added anonymously, then the U card may be omitted. + +The Z card is the usual checksum over the rest of the attachment artifact. + + +<a name="summary"></a> +<h2>7.0 Card Summary</h2> + +The following table summaries the various kinds of cards that +appear on Fossil artifacts: + +<table border=1 width="100%"> +<tr> +<th rowspan=2 valign=bottom>Card Format</th> +<th colspan=6>Used By</th> +</tr> +<tr> +<th>Manifest</th> +<th>Cluster</th> +<th>Control</th> +<th>Wiki</th> +<th>Ticket</th> +<th>Attachment</th> +</tr> +<tr> +<td><b>A</b> (<b>+</b>|<b>-</b>)<i>filename target source</i></td> +<td> </td> +<td> </td> +<td> </td> +<td> </td> +<td> </td> +<td align=center><b>X</b></td> +</tr> +<tr> +<td><b>C</b> <i>coment-text</i></td> +<td align=center><b>X</b></td> +<td> </td> +<td> </td> +<td> </td> +<td> </td> +<td align=center><b>X</b></td> +</tr> +<tr> +<td><b>D</b> <i>date-time-stamp</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +</tr> +<tr> +<td><b>F</b> <i>filename uuid permissions oldname</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>J</b> <i>name value</i></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +</tr> +<tr> +<td><b>K</b> <i>ticket-uuid</i></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +</tr> +<tr> +<td><b>L</b> <i>wiki-title</i></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>M</b> <i>uuid</i></td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>P</b> <i>uuid ...</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>R</b> <i>md5sum</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<tr> +<td><b>T</b> (<b>+</b>|<b>*</b>|<b>-</b>)<i>tagname uuid value</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>U</b> <i>username</i></td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +</tr> +<tr> +<td><b>W</b> <i>size</i></td> +<td align=center> </td> +<td align=center> </td> +<td align=center> </td> +<td align=center><b>X</b></td> +<td align=center> </td> +<td align=center> </td> +</tr> +<tr> +<td><b>Z</b> <i>md5sum</i></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +<td align=center><b>X</b></td> +</tr> +</table>