Fossil SCM
Report syntax errors in T-cards for events when they happen, not when the complete manifest is parsed already.
Commit
512cc1977a40adf57dd6435fef48f2a9d5f7383a
Parent
4bf2708294bf6be…
1 file changed
+4
-4
+4
-4
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -749,13 +749,17 @@ | ||
| 749 | 749 | if( zUuid==0 ) SYNTAX("missing UUID on T-card"); |
| 750 | 750 | zValue = next_token(&x, 0); |
| 751 | 751 | if( zValue ) defossilize(zValue); |
| 752 | 752 | if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){ |
| 753 | 753 | /* A valid uuid */ |
| 754 | + if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); | |
| 754 | 755 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 755 | 756 | zUuid = 0; |
| 756 | 757 | hasSelfRefTag = 1; |
| 758 | + if( p->zEventId && zName[0]!='+' ){ | |
| 759 | + SYNTAX("propagating T-card in event"); | |
| 760 | + } | |
| 757 | 761 | }else{ |
| 758 | 762 | SYNTAX("malformed UUID on T-card"); |
| 759 | 763 | } |
| 760 | 764 | defossilize(zName); |
| 761 | 765 | if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){ |
| @@ -886,14 +890,10 @@ | ||
| 886 | 890 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 887 | 891 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 888 | 892 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 889 | 893 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 890 | 894 | if( p->zAttachName ) SYNTAX("A-card in event"); |
| 891 | - for(i=0; i<p->nTag; i++){ | |
| 892 | - if( p->aTag[i].zName[0]!='+' ) SYNTAX("propagating tag in event"); | |
| 893 | - if( p->aTag[i].zUuid!=0 ) SYNTAX("non-self-referential tag in event"); | |
| 894 | - } | |
| 895 | 895 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 896 | 896 | p->type = CFTYPE_EVENT; |
| 897 | 897 | }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ |
| 898 | 898 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 899 | 899 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 900 | 900 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -749,13 +749,17 @@ | |
| 749 | if( zUuid==0 ) SYNTAX("missing UUID on T-card"); |
| 750 | zValue = next_token(&x, 0); |
| 751 | if( zValue ) defossilize(zValue); |
| 752 | if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){ |
| 753 | /* A valid uuid */ |
| 754 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 755 | zUuid = 0; |
| 756 | hasSelfRefTag = 1; |
| 757 | }else{ |
| 758 | SYNTAX("malformed UUID on T-card"); |
| 759 | } |
| 760 | defossilize(zName); |
| 761 | if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){ |
| @@ -886,14 +890,10 @@ | |
| 886 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 887 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 888 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 889 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 890 | if( p->zAttachName ) SYNTAX("A-card in event"); |
| 891 | for(i=0; i<p->nTag; i++){ |
| 892 | if( p->aTag[i].zName[0]!='+' ) SYNTAX("propagating tag in event"); |
| 893 | if( p->aTag[i].zUuid!=0 ) SYNTAX("non-self-referential tag in event"); |
| 894 | } |
| 895 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 896 | p->type = CFTYPE_EVENT; |
| 897 | }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ |
| 898 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 899 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 900 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -749,13 +749,17 @@ | |
| 749 | if( zUuid==0 ) SYNTAX("missing UUID on T-card"); |
| 750 | zValue = next_token(&x, 0); |
| 751 | if( zValue ) defossilize(zValue); |
| 752 | if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){ |
| 753 | /* A valid uuid */ |
| 754 | if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); |
| 755 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 756 | zUuid = 0; |
| 757 | hasSelfRefTag = 1; |
| 758 | if( p->zEventId && zName[0]!='+' ){ |
| 759 | SYNTAX("propagating T-card in event"); |
| 760 | } |
| 761 | }else{ |
| 762 | SYNTAX("malformed UUID on T-card"); |
| 763 | } |
| 764 | defossilize(zName); |
| 765 | if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){ |
| @@ -886,14 +890,10 @@ | |
| 890 | if( p->nField>0 ) SYNTAX("J-card in event"); |
| 891 | if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 892 | if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 893 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 894 | if( p->zAttachName ) SYNTAX("A-card in event"); |
| 895 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 896 | p->type = CFTYPE_EVENT; |
| 897 | }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ |
| 898 | if( p->rDate<=0.0 ) SYNTAX("missing date on manifest"); |
| 899 | if( p->nField>0 ) SYNTAX("J-card in manifest"); |
| 900 |