Fossil SCM

Initial changes for adding attachments to check-ins.

drh 2017-10-19 20:39 trunk
Commit cb385ba00906fb9d066adf22d962ded90922241dbca513dcb12a3d0977b9b4b2
+6 -3
--- src/manifest.c
+++ src/manifest.c
@@ -760,15 +760,19 @@
760760
zValue = next_token(&x, 0);
761761
if( zValue ) defossilize(zValue);
762762
if( hname_validate(zUuid, sz) ){
763763
/* A valid artifact hash */
764764
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
+ }
765768
}else if( sz==1 && zUuid[0]=='*' ){
766769
zUuid = 0;
767770
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");
770774
}
771775
}else{
772776
SYNTAX("malformed artifact hash on T-card");
773777
}
774778
defossilize(zName);
@@ -934,11 +938,10 @@
934938
if( p->zUser==0 ) SYNTAX("missing U-card on ticket");
935939
if( !seenZ ) SYNTAX("missing Z-card on ticket");
936940
p->type = CFTYPE_TICKET;
937941
}else if( p->zAttachName ){
938942
if( p->rDate<=0.0 ) SYNTAX("missing date on attachment");
939
- if( p->nTag>0 ) SYNTAX("T-card in attachment");
940943
if( !seenZ ) SYNTAX("missing Z-card on attachment");
941944
p->type = CFTYPE_ATTACHMENT;
942945
}else{
943946
if( p->rDate<=0.0 ) SYNTAX("missing date on control");
944947
if( p->zMimetype ) SYNTAX("N-card in control");
945948
--- 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
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -429,10 +429,11 @@
429429
<blockquote>
430430
<b>A</b> <i>filename target</i> ?<i>source</i>?<br />
431431
<b>C</b> <i>comment</i><br />
432432
<b>D</b> <i>time-and-date-stamp</i><br />
433433
<b>N</b> <i>mimetype</i><br />
434
+<b>T</b> <b>+</b><i>tag-name</i> <b>*</b> ?<i>value</i>?<br />
434435
<b>U</b> <i>user-name</i><br />
435436
<b>Z</b> <i>checksum</i>
436437
</blockquote>
437438
438439
The A card specifies a filename for the attachment in its first argument.
@@ -449,10 +450,26 @@
449450
was applied.
450451
451452
There may be zero or one N cards. The N card specifies the mimetype of the
452453
comment text provided in the C card. If the N card is omitted, the C card
453454
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
+
454471
455472
A single U card gives the name of the user who added the attachment.
456473
If an attachment is added anonymously, then the U card may be omitted.
457474
458475
The Z card is the usual checksum over the rest of the attachment artifact.
459476
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button