Fossil SCM
Control files containing self-referencial T-cards can be valid Manifests, but some are mis-catogorized as (invalid) Control artifacts if they don't contain F- or R- cards (which is allowed, according to the documentation). Example: [2a4e4cf03e]. A "fossil rebuild" is needed to see the effect of this change.
Commit
b2a53207376618cfba7eac054324084d8353f108
Parent
6324a3ce6b8ffb2…
1 file changed
+3
-8
+3
-8
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -353,11 +353,11 @@ | ||
| 353 | 353 | char cType; |
| 354 | 354 | char *z; |
| 355 | 355 | int n; |
| 356 | 356 | char *zUuid; |
| 357 | 357 | int sz = 0; |
| 358 | - int isRepeat; | |
| 358 | + int isRepeat, hasSelfRefTag = 0; | |
| 359 | 359 | static Bag seen; |
| 360 | 360 | const char *zErr = 0; |
| 361 | 361 | |
| 362 | 362 | if( rid==0 ){ |
| 363 | 363 | isRepeat = 1; |
| @@ -751,10 +751,11 @@ | ||
| 751 | 751 | if( zValue ) defossilize(zValue); |
| 752 | 752 | if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){ |
| 753 | 753 | /* A valid uuid */ |
| 754 | 754 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 755 | 755 | zUuid = 0; |
| 756 | + hasSelfRefTag = 1; | |
| 756 | 757 | }else{ |
| 757 | 758 | SYNTAX("malformed UUID on T-card"); |
| 758 | 759 | } |
| 759 | 760 | defossilize(zName); |
| 760 | 761 | if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){ |
| @@ -891,11 +892,11 @@ | ||
| 891 | 892 | if( p->aTag[i].zName[0]!='+' ) SYNTAX("propagating tag in event"); |
| 892 | 893 | if( p->aTag[i].zUuid!=0 ) SYNTAX("non-self-referential tag in event"); |
| 893 | 894 | } |
| 894 | 895 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 895 | 896 | p->type = CFTYPE_EVENT; |
| 896 | - }else if( p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ | |
| 897 | + }else if( hasSelfRefTag || p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ | |
| 897 | 898 | if( p->rDate<=0.0 ) SYNTAX("missing date on check-in"); |
| 898 | 899 | if( p->nField>0 ) SYNTAX("J-card in check-in"); |
| 899 | 900 | if( p->zTicketUuid ) SYNTAX("K-card in check-in"); |
| 900 | 901 | if( p->zWiki ) SYNTAX("W-card in check-in"); |
| 901 | 902 | if( p->zWikiTitle ) SYNTAX("L-card in check-in"); |
| @@ -925,21 +926,15 @@ | ||
| 925 | 926 | }else if( p->zAttachName ){ |
| 926 | 927 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 927 | 928 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 928 | 929 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 929 | 930 | p->type = CFTYPE_ATTACHMENT; |
| 930 | - }else if( p->nTag==0 ){ | |
| 931 | - if( p->rDate<=0.0 ) SYNTAX("missing date on check-in"); | |
| 932 | - p->type = CFTYPE_MANIFEST; | |
| 933 | 931 | }else{ |
| 934 | 932 | if( p->rDate<=0.0 ) SYNTAX("missing date on tag"); |
| 935 | 933 | if( p->nParent>0 ) SYNTAX("P-card in tag"); |
| 936 | 934 | if( p->zMimetype ) SYNTAX("N-card in tag"); |
| 937 | 935 | if( !seenZ ) SYNTAX("missing Z-card on tag"); |
| 938 | - for(i=0; i<p->nTag; i++){ | |
| 939 | - if( p->aTag[i].zUuid==0 ) SYNTAX("self-referential T-card in tag"); | |
| 940 | - } | |
| 941 | 936 | p->type = CFTYPE_CONTROL; |
| 942 | 937 | } |
| 943 | 938 | md5sum_init(); |
| 944 | 939 | if( !isRepeat ) g.parseCnt[p->type]++; |
| 945 | 940 | return p; |
| 946 | 941 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -353,11 +353,11 @@ | |
| 353 | char cType; |
| 354 | char *z; |
| 355 | int n; |
| 356 | char *zUuid; |
| 357 | int sz = 0; |
| 358 | int isRepeat; |
| 359 | static Bag seen; |
| 360 | const char *zErr = 0; |
| 361 | |
| 362 | if( rid==0 ){ |
| 363 | isRepeat = 1; |
| @@ -751,10 +751,11 @@ | |
| 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 | }else{ |
| 757 | SYNTAX("malformed UUID on T-card"); |
| 758 | } |
| 759 | defossilize(zName); |
| 760 | if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){ |
| @@ -891,11 +892,11 @@ | |
| 891 | if( p->aTag[i].zName[0]!='+' ) SYNTAX("propagating tag in event"); |
| 892 | if( p->aTag[i].zUuid!=0 ) SYNTAX("non-self-referential tag in event"); |
| 893 | } |
| 894 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 895 | p->type = CFTYPE_EVENT; |
| 896 | }else if( p->nFile>0 || p->zRepoCksum!=0 || p->zBaseline ){ |
| 897 | if( p->rDate<=0.0 ) SYNTAX("missing date on check-in"); |
| 898 | if( p->nField>0 ) SYNTAX("J-card in check-in"); |
| 899 | if( p->zTicketUuid ) SYNTAX("K-card in check-in"); |
| 900 | if( p->zWiki ) SYNTAX("W-card in check-in"); |
| 901 | if( p->zWikiTitle ) SYNTAX("L-card in check-in"); |
| @@ -925,21 +926,15 @@ | |
| 925 | }else if( p->zAttachName ){ |
| 926 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 927 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 928 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 929 | p->type = CFTYPE_ATTACHMENT; |
| 930 | }else if( p->nTag==0 ){ |
| 931 | if( p->rDate<=0.0 ) SYNTAX("missing date on check-in"); |
| 932 | p->type = CFTYPE_MANIFEST; |
| 933 | }else{ |
| 934 | if( p->rDate<=0.0 ) SYNTAX("missing date on tag"); |
| 935 | if( p->nParent>0 ) SYNTAX("P-card in tag"); |
| 936 | if( p->zMimetype ) SYNTAX("N-card in tag"); |
| 937 | if( !seenZ ) SYNTAX("missing Z-card on tag"); |
| 938 | for(i=0; i<p->nTag; i++){ |
| 939 | if( p->aTag[i].zUuid==0 ) SYNTAX("self-referential T-card in tag"); |
| 940 | } |
| 941 | p->type = CFTYPE_CONTROL; |
| 942 | } |
| 943 | md5sum_init(); |
| 944 | if( !isRepeat ) g.parseCnt[p->type]++; |
| 945 | return p; |
| 946 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -353,11 +353,11 @@ | |
| 353 | char cType; |
| 354 | char *z; |
| 355 | int n; |
| 356 | char *zUuid; |
| 357 | int sz = 0; |
| 358 | int isRepeat, hasSelfRefTag = 0; |
| 359 | static Bag seen; |
| 360 | const char *zErr = 0; |
| 361 | |
| 362 | if( rid==0 ){ |
| 363 | isRepeat = 1; |
| @@ -751,10 +751,11 @@ | |
| 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]!='*' ){ |
| @@ -891,11 +892,11 @@ | |
| 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 check-in"); |
| 899 | if( p->nField>0 ) SYNTAX("J-card in check-in"); |
| 900 | if( p->zTicketUuid ) SYNTAX("K-card in check-in"); |
| 901 | if( p->zWiki ) SYNTAX("W-card in check-in"); |
| 902 | if( p->zWikiTitle ) SYNTAX("L-card in check-in"); |
| @@ -925,21 +926,15 @@ | |
| 926 | }else if( p->zAttachName ){ |
| 927 | if( p->rDate<=0.0 ) SYNTAX("missing date on attachment"); |
| 928 | if( p->nTag>0 ) SYNTAX("T-card in attachment"); |
| 929 | if( !seenZ ) SYNTAX("missing Z-card on attachment"); |
| 930 | p->type = CFTYPE_ATTACHMENT; |
| 931 | }else{ |
| 932 | if( p->rDate<=0.0 ) SYNTAX("missing date on tag"); |
| 933 | if( p->nParent>0 ) SYNTAX("P-card in tag"); |
| 934 | if( p->zMimetype ) SYNTAX("N-card in tag"); |
| 935 | if( !seenZ ) SYNTAX("missing Z-card on tag"); |
| 936 | p->type = CFTYPE_CONTROL; |
| 937 | } |
| 938 | md5sum_init(); |
| 939 | if( !isRepeat ) g.parseCnt[p->type]++; |
| 940 | return p; |
| 941 |