Fossil SCM
Initial changes for adding attachments to check-ins.
Commit
cb385ba00906fb9d066adf22d962ded90922241dbca513dcb12a3d0977b9b4b2
Parent
1374d581423a1ee…
2 files changed
+6
-3
+17
+6
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -760,15 +760,19 @@ | ||
| 760 | 760 | zValue = next_token(&x, 0); |
| 761 | 761 | if( zValue ) defossilize(zValue); |
| 762 | 762 | if( hname_validate(zUuid, sz) ){ |
| 763 | 763 | /* A valid artifact hash */ |
| 764 | 764 | if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); |
| 765 | + if( p->zAttachTarget ){ | |
| 766 | + SYNTAX("non-self-referential T-card in attachment"); | |
| 767 | + } | |
| 765 | 768 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 766 | 769 | zUuid = 0; |
| 767 | 770 | hasSelfRefTag = 1; |
| 768 | - if( p->zEventId && zName[0]!='+' ){ | |
| 769 | - SYNTAX("propagating T-card in event"); | |
| 771 | + if( zName[0]!='+' ){ | |
| 772 | + if( p->zEventId ) SYNTAX("propagating T-card in event"); | |
| 773 | + if( p->zAttachTarget ) SYNTAX("propagating T-card in attachment"); | |
| 770 | 774 | } |
| 771 | 775 | }else{ |
| 772 | 776 | SYNTAX("malformed artifact hash on T-card"); |
| 773 | 777 | } |
| 774 | 778 | defossilize(zName); |
| @@ -934,11 +938,10 @@ | ||
| 934 | 938 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 935 | 939 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 936 | 940 | p->type = CFTYPE_TICKET; |
| 937 | 941 | }else if( p->zAttachName ){ |
| 938 | 942 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 939 | - if( p->nTag>0 ) SYNTAX("T-card in attachment"); | |
| 940 | 943 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 941 | 944 | p->type = CFTYPE_ATTACHMENT; |
| 942 | 945 | }else{ |
| 943 | 946 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 944 | 947 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 945 | 948 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -760,15 +760,19 @@ | |
| 760 | zValue = next_token(&x, 0); |
| 761 | if( zValue ) defossilize(zValue); |
| 762 | if( hname_validate(zUuid, sz) ){ |
| 763 | /* A valid artifact hash */ |
| 764 | if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); |
| 765 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 766 | zUuid = 0; |
| 767 | hasSelfRefTag = 1; |
| 768 | if( p->zEventId && zName[0]!='+' ){ |
| 769 | SYNTAX("propagating T-card in event"); |
| 770 | } |
| 771 | }else{ |
| 772 | SYNTAX("malformed artifact hash on T-card"); |
| 773 | } |
| 774 | defossilize(zName); |
| @@ -934,11 +938,10 @@ | |
| 934 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 935 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 936 | p->type = CFTYPE_TICKET; |
| 937 | }else if( p->zAttachName ){ |
| 938 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 939 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 940 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 941 | p->type = CFTYPE_ATTACHMENT; |
| 942 | }else{ |
| 943 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 944 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 945 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -760,15 +760,19 @@ | |
| 760 | zValue = next_token(&x, 0); |
| 761 | if( zValue ) defossilize(zValue); |
| 762 | if( hname_validate(zUuid, sz) ){ |
| 763 | /* A valid artifact hash */ |
| 764 | if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); |
| 765 | if( p->zAttachTarget ){ |
| 766 | SYNTAX("non-self-referential T-card in attachment"); |
| 767 | } |
| 768 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 769 | zUuid = 0; |
| 770 | hasSelfRefTag = 1; |
| 771 | if( zName[0]!='+' ){ |
| 772 | if( p->zEventId ) SYNTAX("propagating T-card in event"); |
| 773 | if( p->zAttachTarget ) SYNTAX("propagating T-card in attachment"); |
| 774 | } |
| 775 | }else{ |
| 776 | SYNTAX("malformed artifact hash on T-card"); |
| 777 | } |
| 778 | defossilize(zName); |
| @@ -934,11 +938,10 @@ | |
| 938 | if( p->zUser==0 ) SYNTAX("missing U-card on ticket"); |
| 939 | if( !seenZ ) SYNTAX("missing Z-card on ticket"); |
| 940 | p->type = CFTYPE_TICKET; |
| 941 | }else if( p->zAttachName ){ |
| 942 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 943 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 944 | p->type = CFTYPE_ATTACHMENT; |
| 945 | }else{ |
| 946 | if( p->rDate<=0.0 ) SYNTAX("missing date on control"); |
| 947 | if( p->zMimetype ) SYNTAX("N-card in control"); |
| 948 |
+17
| --- www/fileformat.wiki | ||
| +++ www/fileformat.wiki | ||
| @@ -429,10 +429,11 @@ | ||
| 429 | 429 | <blockquote> |
| 430 | 430 | <b>A</b> <i>filename target</i> ?<i>source</i>?<br /> |
| 431 | 431 | <b>C</b> <i>comment</i><br /> |
| 432 | 432 | <b>D</b> <i>time-and-date-stamp</i><br /> |
| 433 | 433 | <b>N</b> <i>mimetype</i><br /> |
| 434 | +<b>T</b> <b>+</b><i>tag-name</i> <b>*</b> ?<i>value</i>?<br /> | |
| 434 | 435 | <b>U</b> <i>user-name</i><br /> |
| 435 | 436 | <b>Z</b> <i>checksum</i> |
| 436 | 437 | </blockquote> |
| 437 | 438 | |
| 438 | 439 | The A card specifies a filename for the attachment in its first argument. |
| @@ -449,10 +450,26 @@ | ||
| 449 | 450 | was applied. |
| 450 | 451 | |
| 451 | 452 | There may be zero or one N cards. The N card specifies the mimetype of the |
| 452 | 453 | comment text provided in the C card. If the N card is omitted, the C card |
| 453 | 454 | mimetype is taken to be text/plain. |
| 455 | + | |
| 456 | +An attachment might contain one or more T-cards used to set | |
| 457 | +[./branching.wiki#tags | tags or properties] | |
| 458 | +on the attachment. The format of the T-card is the same as | |
| 459 | +described in [#ctrl | Control Artifacts] section above, except that the | |
| 460 | +second argument is the single character "<b>*</b>" instead of an | |
| 461 | +artifact ID and the name is always prefaced by "<b>+</b>". | |
| 462 | +The <b>*</b> in place of the artifact ID indicates that | |
| 463 | +the tag or property applies to the current artifact. It is not | |
| 464 | +possible to encode the current artifact ID as part of an artifact, | |
| 465 | +since the act of inserting the artifact ID would change the artifact ID, | |
| 466 | +hence a <b>*</b> is used to represent "self". The "<b>+</b>" on the | |
| 467 | +name means that tags can only be add and they can only be non-propagating | |
| 468 | +tags. In an attachment, T cards are normally used to identify test | |
| 469 | +case results on check-ins. | |
| 470 | + | |
| 454 | 471 | |
| 455 | 472 | A single U card gives the name of the user who added the attachment. |
| 456 | 473 | If an attachment is added anonymously, then the U card may be omitted. |
| 457 | 474 | |
| 458 | 475 | The Z card is the usual checksum over the rest of the attachment artifact. |
| 459 | 476 |
| --- www/fileformat.wiki | |
| +++ www/fileformat.wiki | |
| @@ -429,10 +429,11 @@ | |
| 429 | <blockquote> |
| 430 | <b>A</b> <i>filename target</i> ?<i>source</i>?<br /> |
| 431 | <b>C</b> <i>comment</i><br /> |
| 432 | <b>D</b> <i>time-and-date-stamp</i><br /> |
| 433 | <b>N</b> <i>mimetype</i><br /> |
| 434 | <b>U</b> <i>user-name</i><br /> |
| 435 | <b>Z</b> <i>checksum</i> |
| 436 | </blockquote> |
| 437 | |
| 438 | The A card specifies a filename for the attachment in its first argument. |
| @@ -449,10 +450,26 @@ | |
| 449 | was applied. |
| 450 | |
| 451 | There may be zero or one N cards. The N card specifies the mimetype of the |
| 452 | comment text provided in the C card. If the N card is omitted, the C card |
| 453 | mimetype is taken to be text/plain. |
| 454 | |
| 455 | A single U card gives the name of the user who added the attachment. |
| 456 | If an attachment is added anonymously, then the U card may be omitted. |
| 457 | |
| 458 | The Z card is the usual checksum over the rest of the attachment artifact. |
| 459 |
| --- www/fileformat.wiki | |
| +++ www/fileformat.wiki | |
| @@ -429,10 +429,11 @@ | |
| 429 | <blockquote> |
| 430 | <b>A</b> <i>filename target</i> ?<i>source</i>?<br /> |
| 431 | <b>C</b> <i>comment</i><br /> |
| 432 | <b>D</b> <i>time-and-date-stamp</i><br /> |
| 433 | <b>N</b> <i>mimetype</i><br /> |
| 434 | <b>T</b> <b>+</b><i>tag-name</i> <b>*</b> ?<i>value</i>?<br /> |
| 435 | <b>U</b> <i>user-name</i><br /> |
| 436 | <b>Z</b> <i>checksum</i> |
| 437 | </blockquote> |
| 438 | |
| 439 | The A card specifies a filename for the attachment in its first argument. |
| @@ -449,10 +450,26 @@ | |
| 450 | was applied. |
| 451 | |
| 452 | There may be zero or one N cards. The N card specifies the mimetype of the |
| 453 | comment text provided in the C card. If the N card is omitted, the C card |
| 454 | mimetype is taken to be text/plain. |
| 455 | |
| 456 | An attachment might contain one or more T-cards used to set |
| 457 | [./branching.wiki#tags | tags or properties] |
| 458 | on the attachment. The format of the T-card is the same as |
| 459 | described in [#ctrl | Control Artifacts] section above, except that the |
| 460 | second argument is the single character "<b>*</b>" instead of an |
| 461 | artifact ID and the name is always prefaced by "<b>+</b>". |
| 462 | The <b>*</b> in place of the artifact ID indicates that |
| 463 | the tag or property applies to the current artifact. It is not |
| 464 | possible to encode the current artifact ID as part of an artifact, |
| 465 | since the act of inserting the artifact ID would change the artifact ID, |
| 466 | hence a <b>*</b> is used to represent "self". The "<b>+</b>" on the |
| 467 | name means that tags can only be add and they can only be non-propagating |
| 468 | tags. In an attachment, T cards are normally used to identify test |
| 469 | case results on check-ins. |
| 470 | |
| 471 | |
| 472 | A single U card gives the name of the user who added the attachment. |
| 473 | If an attachment is added anonymously, then the U card may be omitted. |
| 474 | |
| 475 | The Z card is the usual checksum over the rest of the attachment artifact. |
| 476 |