Fossil SCM
More work on tags and properties. Getting late. Need to check-in changes before stopping for the day...
Commit
f73c0e792b242e97c5cdd79ea3afc488bcf70551
Parent
5e2392307d800c3…
2 files changed
+17
-1
+14
-5
+17
-1
| --- ideas.txt | ||
| +++ ideas.txt | ||
| @@ -1,5 +1,21 @@ | ||
| 1 | +Properties: | |
| 2 | + | |
| 3 | + * Started out as tags. AKU suggests adding a value. That | |
| 4 | + seems to work well. | |
| 5 | + * If the name begins with "br" then it propagates to non-merge | |
| 6 | + children. | |
| 7 | + * Special tags and properties: | |
| 8 | + + br-bg-color=COLOR and bg-color=COLOR -- Set timeline BG color | |
| 9 | + + comment=TEXT -- Revise the check-in comment text | |
| 10 | + + user=TEXT -- Revise the check-in username | |
| 11 | + + closed -- Do not display as a leaf | |
| 12 | + * Tags and properties initially live in the tagxref table. | |
| 13 | + * Separate operation captured tags and properites as artifacts | |
| 14 | + so that they can be synced. | |
| 15 | + | |
| 16 | + | |
| 1 | 17 | Possible ticket file format: |
| 2 | 18 | |
| 3 | 19 | "Ticket" |
| 4 | 20 | title: TEXT |
| 5 | 21 | ticketid: TEXT |
| @@ -245,6 +261,6 @@ | ||
| 245 | 261 | R repository-md5sum |
| 246 | 262 | T uuid |
| 247 | 263 | U user-login |
| 248 | 264 | V (+|-)version-tag uuid |
| 249 | 265 | W uuid |
| 250 | - Z manifest-checksum | |
| 266 | + Z manifest-checksum | |
| 251 | 267 |
| --- ideas.txt | |
| +++ ideas.txt | |
| @@ -1,5 +1,21 @@ | |
| 1 | Possible ticket file format: |
| 2 | |
| 3 | "Ticket" |
| 4 | title: TEXT |
| 5 | ticketid: TEXT |
| @@ -245,6 +261,6 @@ | |
| 245 | R repository-md5sum |
| 246 | T uuid |
| 247 | U user-login |
| 248 | V (+|-)version-tag uuid |
| 249 | W uuid |
| 250 | Z manifest-checksum |
| 251 |
| --- ideas.txt | |
| +++ ideas.txt | |
| @@ -1,5 +1,21 @@ | |
| 1 | Properties: |
| 2 | |
| 3 | * Started out as tags. AKU suggests adding a value. That |
| 4 | seems to work well. |
| 5 | * If the name begins with "br" then it propagates to non-merge |
| 6 | children. |
| 7 | * Special tags and properties: |
| 8 | + br-bg-color=COLOR and bg-color=COLOR -- Set timeline BG color |
| 9 | + comment=TEXT -- Revise the check-in comment text |
| 10 | + user=TEXT -- Revise the check-in username |
| 11 | + closed -- Do not display as a leaf |
| 12 | * Tags and properties initially live in the tagxref table. |
| 13 | * Separate operation captured tags and properites as artifacts |
| 14 | so that they can be synced. |
| 15 | |
| 16 | |
| 17 | Possible ticket file format: |
| 18 | |
| 19 | "Ticket" |
| 20 | title: TEXT |
| 21 | ticketid: TEXT |
| @@ -245,6 +261,6 @@ | |
| 261 | R repository-md5sum |
| 262 | T uuid |
| 263 | U user-login |
| 264 | V (+|-)version-tag uuid |
| 265 | W uuid |
| 266 | Z manifest-checksum |
| 267 |
+14
-5
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -52,10 +52,11 @@ | ||
| 52 | 52 | int nTag; /* Number of T lines */ |
| 53 | 53 | int nTagAlloc; /* Slots allocated in aTag[] */ |
| 54 | 54 | struct { |
| 55 | 55 | char *zName; /* Name of the tag */ |
| 56 | 56 | char *zUuid; /* UUID that the tag is applied to */ |
| 57 | + char *zValue; /* Value if the tag is really a property */ | |
| 57 | 58 | } *aTag; |
| 58 | 59 | }; |
| 59 | 60 | #endif |
| 60 | 61 | |
| 61 | 62 | |
| @@ -216,24 +217,31 @@ | ||
| 216 | 217 | } |
| 217 | 218 | break; |
| 218 | 219 | } |
| 219 | 220 | |
| 220 | 221 | /* |
| 221 | - ** T (+|-)<tagname> <uuid> | |
| 222 | + ** T (+|-)<tagname> <uuid> ?<value>? | |
| 222 | 223 | ** |
| 223 | - ** Create or cancel a tag. The tagname is fossil-encoded. The | |
| 224 | - ** first character must be either "+" to create or "-" to delete. | |
| 224 | + ** Create or cancel a tag or property. The tagname is fossil-encoded. | |
| 225 | + ** The first character of the name must be either "+" to create or | |
| 226 | + ** "-" to cancel. The tag is applied to <uuid>. If <value> is | |
| 227 | + ** provided then the tag is really a property with the given value. | |
| 225 | 228 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 226 | 229 | */ |
| 227 | 230 | case 'T': { |
| 228 | - char *zName, *zUuid; | |
| 231 | + char *zName, *zUuid, *zValue; | |
| 229 | 232 | md5sum_step_text(blob_buffer(&line), blob_size(&line)); |
| 230 | 233 | if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error; |
| 231 | 234 | if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error; |
| 232 | - if( blob_token(&line, &a3)!=0 ) goto manifest_syntax_error; | |
| 233 | 235 | zName = blob_terminate(&a1); |
| 234 | 236 | zUuid = blob_terminate(&a2); |
| 237 | + if( blob_token(&line, &a3)==0 ){ | |
| 238 | + zValue = 0; | |
| 239 | + }else{ | |
| 240 | + zValue = blob_terminate(&a3); | |
| 241 | + defossilize(zValue); | |
| 242 | + } | |
| 235 | 243 | if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error; |
| 236 | 244 | if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error; |
| 237 | 245 | defossilize(zName); |
| 238 | 246 | if( zName[0]!='-' && zName[0]!='+' ){ |
| 239 | 247 | goto manifest_syntax_error; |
| @@ -244,10 +252,11 @@ | ||
| 244 | 252 | if( p->aTag==0 ) fossil_panic("out of memory"); |
| 245 | 253 | } |
| 246 | 254 | i = p->nTag++; |
| 247 | 255 | p->aTag[i].zName = zName; |
| 248 | 256 | p->aTag[i].zUuid = zUuid; |
| 257 | + p->aTag[i].zValue = zValue; | |
| 249 | 258 | if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){ |
| 250 | 259 | goto manifest_syntax_error; |
| 251 | 260 | } |
| 252 | 261 | break; |
| 253 | 262 | } |
| 254 | 263 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -52,10 +52,11 @@ | |
| 52 | int nTag; /* Number of T lines */ |
| 53 | int nTagAlloc; /* Slots allocated in aTag[] */ |
| 54 | struct { |
| 55 | char *zName; /* Name of the tag */ |
| 56 | char *zUuid; /* UUID that the tag is applied to */ |
| 57 | } *aTag; |
| 58 | }; |
| 59 | #endif |
| 60 | |
| 61 | |
| @@ -216,24 +217,31 @@ | |
| 216 | } |
| 217 | break; |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | ** T (+|-)<tagname> <uuid> |
| 222 | ** |
| 223 | ** Create or cancel a tag. The tagname is fossil-encoded. The |
| 224 | ** first character must be either "+" to create or "-" to delete. |
| 225 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 226 | */ |
| 227 | case 'T': { |
| 228 | char *zName, *zUuid; |
| 229 | md5sum_step_text(blob_buffer(&line), blob_size(&line)); |
| 230 | if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error; |
| 231 | if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error; |
| 232 | if( blob_token(&line, &a3)!=0 ) goto manifest_syntax_error; |
| 233 | zName = blob_terminate(&a1); |
| 234 | zUuid = blob_terminate(&a2); |
| 235 | if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error; |
| 236 | if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error; |
| 237 | defossilize(zName); |
| 238 | if( zName[0]!='-' && zName[0]!='+' ){ |
| 239 | goto manifest_syntax_error; |
| @@ -244,10 +252,11 @@ | |
| 244 | if( p->aTag==0 ) fossil_panic("out of memory"); |
| 245 | } |
| 246 | i = p->nTag++; |
| 247 | p->aTag[i].zName = zName; |
| 248 | p->aTag[i].zUuid = zUuid; |
| 249 | if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){ |
| 250 | goto manifest_syntax_error; |
| 251 | } |
| 252 | break; |
| 253 | } |
| 254 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -52,10 +52,11 @@ | |
| 52 | int nTag; /* Number of T lines */ |
| 53 | int nTagAlloc; /* Slots allocated in aTag[] */ |
| 54 | struct { |
| 55 | char *zName; /* Name of the tag */ |
| 56 | char *zUuid; /* UUID that the tag is applied to */ |
| 57 | char *zValue; /* Value if the tag is really a property */ |
| 58 | } *aTag; |
| 59 | }; |
| 60 | #endif |
| 61 | |
| 62 | |
| @@ -216,24 +217,31 @@ | |
| 217 | } |
| 218 | break; |
| 219 | } |
| 220 | |
| 221 | /* |
| 222 | ** T (+|-)<tagname> <uuid> ?<value>? |
| 223 | ** |
| 224 | ** Create or cancel a tag or property. The tagname is fossil-encoded. |
| 225 | ** The first character of the name must be either "+" to create or |
| 226 | ** "-" to cancel. The tag is applied to <uuid>. If <value> is |
| 227 | ** provided then the tag is really a property with the given value. |
| 228 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 229 | */ |
| 230 | case 'T': { |
| 231 | char *zName, *zUuid, *zValue; |
| 232 | md5sum_step_text(blob_buffer(&line), blob_size(&line)); |
| 233 | if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error; |
| 234 | if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error; |
| 235 | zName = blob_terminate(&a1); |
| 236 | zUuid = blob_terminate(&a2); |
| 237 | if( blob_token(&line, &a3)==0 ){ |
| 238 | zValue = 0; |
| 239 | }else{ |
| 240 | zValue = blob_terminate(&a3); |
| 241 | defossilize(zValue); |
| 242 | } |
| 243 | if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error; |
| 244 | if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error; |
| 245 | defossilize(zName); |
| 246 | if( zName[0]!='-' && zName[0]!='+' ){ |
| 247 | goto manifest_syntax_error; |
| @@ -244,10 +252,11 @@ | |
| 252 | if( p->aTag==0 ) fossil_panic("out of memory"); |
| 253 | } |
| 254 | i = p->nTag++; |
| 255 | p->aTag[i].zName = zName; |
| 256 | p->aTag[i].zUuid = zUuid; |
| 257 | p->aTag[i].zValue = zValue; |
| 258 | if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){ |
| 259 | goto manifest_syntax_error; |
| 260 | } |
| 261 | break; |
| 262 | } |
| 263 |