| | @@ -33,11 +33,12 @@ |
| 33 | 33 | #define CFTYPE_CLUSTER 2 |
| 34 | 34 | #define CFTYPE_CONTROL 3 |
| 35 | 35 | #define CFTYPE_WIKI 4 |
| 36 | 36 | #define CFTYPE_TICKET 5 |
| 37 | 37 | #define CFTYPE_ATTACHMENT 6 |
| 38 | | -#define CFTYPE_EVENT 7 |
| 38 | +#define CFTYPE_TECHNOTE 7 |
| 39 | +#define CFTYPE_REMARK 8 |
| 39 | 40 | |
| 40 | 41 | /* |
| 41 | 42 | ** File permissions used by Fossil internally. |
| 42 | 43 | */ |
| 43 | 44 | #define PERM_REG 0 /* regular file */ |
| | @@ -77,10 +78,11 @@ |
| 77 | 78 | char *zRepoCksum; /* MD5 checksum of the baseline content. R card. */ |
| 78 | 79 | char *zWiki; /* Text of the wiki page. W card. */ |
| 79 | 80 | char *zWikiTitle; /* Name of the wiki page. L card. */ |
| 80 | 81 | char *zMimetype; /* Mime type of wiki or comment text. N card. */ |
| 81 | 82 | double rEventDate; /* Date of an event. E card. */ |
| 83 | + char *zRemCkin; /* UUID of checkin to which remark attached. G card */ |
| 82 | 84 | char *zEventId; /* UUID for an event. E card. */ |
| 83 | 85 | char *zTicketUuid; /* UUID for a ticket. K card. */ |
| 84 | 86 | char *zAttachName; /* Filename of an attachment. A card. */ |
| 85 | 87 | char *zAttachSrc; /* UUID of document being attached. A card. */ |
| 86 | 88 | char *zAttachTarget; /* Ticket or wiki that attachment applies to. A card */ |
| | @@ -571,10 +573,25 @@ |
| 571 | 573 | if( i>0 && fossil_strcmp(p->aFile[i-1].zName, zName)>=0 ){ |
| 572 | 574 | SYNTAX("incorrect F-card sort order"); |
| 573 | 575 | } |
| 574 | 576 | break; |
| 575 | 577 | } |
| 578 | + |
| 579 | + /* |
| 580 | + ** G <uuid> |
| 581 | + ** |
| 582 | + ** The G card records the UUID of a check-in to which a remark is |
| 583 | + ** attached. |
| 584 | + */ |
| 585 | + case 'G': { |
| 586 | + if( p->zRemCkin ) SYNTAX("more than one G-card"); |
| 587 | + p->zRemCkin = next_token(&x, &sz); |
| 588 | + if( sz!=UUID_SIZE || !validate16(p->zRemCkin, UUID_SIZE) ){ |
| 589 | + SYNTAX("malformed UUID on G-card"); |
| 590 | + } |
| 591 | + break; |
| 592 | + } |
| 576 | 593 | |
| 577 | 594 | /* |
| 578 | 595 | ** J <name> ?<value>? |
| 579 | 596 | ** |
| 580 | 597 | ** Specifies a name value pair for ticket. If the first character |
| | @@ -765,16 +782,16 @@ |
| 765 | 782 | if( zUuid==0 ) SYNTAX("missing UUID on T-card"); |
| 766 | 783 | zValue = next_token(&x, 0); |
| 767 | 784 | if( zValue ) defossilize(zValue); |
| 768 | 785 | if( sz==UUID_SIZE && validate16(zUuid, UUID_SIZE) ){ |
| 769 | 786 | /* A valid uuid */ |
| 770 | | - if( p->zEventId ) SYNTAX("non-self-referential T-card in event"); |
| 787 | + if( p->zEventId ) SYNTAX("non-self-referential T-card in technote"); |
| 771 | 788 | }else if( sz==1 && zUuid[0]=='*' ){ |
| 772 | 789 | zUuid = 0; |
| 773 | 790 | hasSelfRefTag = 1; |
| 774 | 791 | if( p->zEventId && zName[0]!='+' ){ |
| 775 | | - SYNTAX("propagating T-card in event"); |
| 792 | + SYNTAX("propagating T-card in technote"); |
| 776 | 793 | } |
| 777 | 794 | }else{ |
| 778 | 795 | SYNTAX("malformed UUID on T-card"); |
| 779 | 796 | } |
| 780 | 797 | defossilize(zName); |
| | @@ -880,10 +897,11 @@ |
| 880 | 897 | if( p->zAttachName |
| 881 | 898 | || p->zBaseline |
| 882 | 899 | || p->zComment |
| 883 | 900 | || p->rDate>0.0 |
| 884 | 901 | || p->zEventId |
| 902 | + || p->zRemCkin |
| 885 | 903 | || p->nFile>0 |
| 886 | 904 | || p->nField>0 |
| 887 | 905 | || p->zTicketUuid |
| 888 | 906 | || p->zWikiTitle |
| 889 | 907 | || p->zMimetype |
| | @@ -896,22 +914,35 @@ |
| 896 | 914 | ){ |
| 897 | 915 | SYNTAX("cluster contains a card other than M- or Z-"); |
| 898 | 916 | } |
| 899 | 917 | if( !seenZ ) SYNTAX("missing Z-card on cluster"); |
| 900 | 918 | p->type = CFTYPE_CLUSTER; |
| 919 | + }else if( p->zRemCkin ){ |
| 920 | + if( p->zAttachName ) SYNTAX("A-card in remark"); |
| 921 | + if( p->zBaseline ) SYNTAX("B-card in remark"); |
| 922 | + if( p->rDate<=0.0 ) SYNTAX("missing date on remark"); |
| 923 | + if( p->zEventId ) SYNTAX("E-card in remark"); |
| 924 | + if( p->nFile>0 ) SYNTAX("F-card in remark"); |
| 925 | + if( p->nField>0 ) SYNTAX("J-card in remark"); |
| 926 | + if( p->zTicketUuid ) SYNTAX("K-card in remark"); |
| 927 | + if( p->zWikiTitle!=0 ) SYNTAX("L-card in remark"); |
| 928 | + if( p->zRepoCksum ) SYNTAX("R-card in remark"); |
| 929 | + if( p->zWiki==0 ) SYNTAX("missing W-card on remark"); |
| 930 | + if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 931 | + p->type = CFTYPE_REMARK; |
| 901 | 932 | }else if( p->zEventId ){ |
| 902 | | - if( p->zAttachName ) SYNTAX("A-card in event"); |
| 903 | | - if( p->zBaseline ) SYNTAX("B-card in event"); |
| 933 | + if( p->zAttachName ) SYNTAX("A-card in technote"); |
| 934 | + if( p->zBaseline ) SYNTAX("B-card in technote"); |
| 904 | 935 | if( p->rDate<=0.0 ) SYNTAX("missing date on event"); |
| 905 | | - if( p->nFile>0 ) SYNTAX("F-card in event"); |
| 906 | | - if( p->nField>0 ) SYNTAX("J-card in event"); |
| 907 | | - if( p->zTicketUuid ) SYNTAX("K-card in event"); |
| 908 | | - if( p->zWikiTitle!=0 ) SYNTAX("L-card in event"); |
| 909 | | - if( p->zRepoCksum ) SYNTAX("R-card in event"); |
| 936 | + if( p->nFile>0 ) SYNTAX("F-card in technote"); |
| 937 | + if( p->nField>0 ) SYNTAX("J-card in technote"); |
| 938 | + if( p->zTicketUuid ) SYNTAX("K-card in technote"); |
| 939 | + if( p->zWikiTitle!=0 ) SYNTAX("L-card in technote"); |
| 940 | + if( p->zRepoCksum ) SYNTAX("R-card in technote"); |
| 910 | 941 | if( p->zWiki==0 ) SYNTAX("missing W-card on event"); |
| 911 | 942 | if( !seenZ ) SYNTAX("missing Z-card on event"); |
| 912 | | - p->type = CFTYPE_EVENT; |
| 943 | + p->type = CFTYPE_TECHNOTE; |
| 913 | 944 | }else if( p->zWiki!=0 || p->zWikiTitle!=0 ){ |
| 914 | 945 | if( p->zAttachName ) SYNTAX("A-card in wiki"); |
| 915 | 946 | if( p->zBaseline ) SYNTAX("B-card in wiki"); |
| 916 | 947 | if( p->rDate<=0.0 ) SYNTAX("missing date on wiki"); |
| 917 | 948 | if( p->nFile>0 ) SYNTAX("F-card in wiki"); |
| | @@ -2013,11 +2044,11 @@ |
| 2013 | 2044 | } |
| 2014 | 2045 | } |
| 2015 | 2046 | } |
| 2016 | 2047 | if( p->type==CFTYPE_CONTROL |
| 2017 | 2048 | || p->type==CFTYPE_MANIFEST |
| 2018 | | - || p->type==CFTYPE_EVENT |
| 2049 | + || p->type==CFTYPE_TECHNOTE |
| 2019 | 2050 | ){ |
| 2020 | 2051 | for(i=0; i<p->nTag; i++){ |
| 2021 | 2052 | int tid; |
| 2022 | 2053 | int type; |
| 2023 | 2054 | if( p->aTag[i].zUuid ){ |
| | @@ -2081,11 +2112,11 @@ |
| 2081 | 2112 | TAG_USER, rid, |
| 2082 | 2113 | TAG_COMMENT, rid |
| 2083 | 2114 | ); |
| 2084 | 2115 | fossil_free(zComment); |
| 2085 | 2116 | } |
| 2086 | | - if( p->type==CFTYPE_EVENT ){ |
| 2117 | + if( p->type==CFTYPE_TECHNOTE ){ |
| 2087 | 2118 | char *zTag = mprintf("event-%s", p->zEventId); |
| 2088 | 2119 | int tagid = tag_findid(zTag, 1); |
| 2089 | 2120 | int prior, subsequent; |
| 2090 | 2121 | int nWiki; |
| 2091 | 2122 | char zLength[40]; |
| 2092 | 2123 | |