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.

jan.nijtmans 2013-08-23 13:25 trunk
Commit b2a53207376618cfba7eac054324084d8353f108
1 file changed +3 -8
+3 -8
--- src/manifest.c
+++ src/manifest.c
@@ -353,11 +353,11 @@
353353
char cType;
354354
char *z;
355355
int n;
356356
char *zUuid;
357357
int sz = 0;
358
- int isRepeat;
358
+ int isRepeat, hasSelfRefTag = 0;
359359
static Bag seen;
360360
const char *zErr = 0;
361361
362362
if( rid==0 ){
363363
isRepeat = 1;
@@ -751,10 +751,11 @@
751751
if( zValue ) defossilize(zValue);
752752
if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){
753753
/* A valid uuid */
754754
}else if( sz==1 && zUuid[0]=='*' ){
755755
zUuid = 0;
756
+ hasSelfRefTag = 1;
756757
}else{
757758
SYNTAX("malformed UUID on T-card");
758759
}
759760
defossilize(zName);
760761
if( zName[0]!='-' && zName[0]!='+' && zName[0]!='*' ){
@@ -891,11 +892,11 @@
891892
if( p->aTag[i].zName[0]!='+' ) SYNTAX("propagating tag in event");
892893
if( p->aTag[i].zUuid!=0 ) SYNTAX("non-self-referential tag in event");
893894
}
894895
if( !seenZ ) SYNTAX("missing Z-card on event");
895896
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 ){
897898
if( p->rDate<=0.0 ) SYNTAX("missing date on check-in");
898899
if( p->nField>0 ) SYNTAX("J-card in check-in");
899900
if( p->zTicketUuid ) SYNTAX("K-card in check-in");
900901
if( p->zWiki ) SYNTAX("W-card in check-in");
901902
if( p->zWikiTitle ) SYNTAX("L-card in check-in");
@@ -925,21 +926,15 @@
925926
}else if( p->zAttachName ){
926927
if( p->rDate<=0.0 ) SYNTAX("missing date on attachment");
927928
if( p->nTag>0 ) SYNTAX("T-card in attachment");
928929
if( !seenZ ) SYNTAX("missing Z-card on attachment");
929930
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;
933931
}else{
934932
if( p->rDate<=0.0 ) SYNTAX("missing date on tag");
935933
if( p->nParent>0 ) SYNTAX("P-card in tag");
936934
if( p->zMimetype ) SYNTAX("N-card in tag");
937935
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
- }
941936
p->type = CFTYPE_CONTROL;
942937
}
943938
md5sum_init();
944939
if( !isRepeat ) g.parseCnt[p->type]++;
945940
return p;
946941
--- 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

Keyboard Shortcuts

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