Fossil SCM

More work on tags and properties. Getting late. Need to check-in changes before stopping for the day...

drh 2007-09-22 02:22 trunk
Commit f73c0e792b242e97c5cdd79ea3afc488bcf70551
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
+
117
Possible ticket file format:
218
319
"Ticket"
420
title: TEXT
521
ticketid: TEXT
@@ -245,6 +261,6 @@
245261
R repository-md5sum
246262
T uuid
247263
U user-login
248264
V (+|-)version-tag uuid
249265
W uuid
250
- Z manifest-checksum
266
+ Z manifest-checksum
251267
--- 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 @@
5252
int nTag; /* Number of T lines */
5353
int nTagAlloc; /* Slots allocated in aTag[] */
5454
struct {
5555
char *zName; /* Name of the tag */
5656
char *zUuid; /* UUID that the tag is applied to */
57
+ char *zValue; /* Value if the tag is really a property */
5758
} *aTag;
5859
};
5960
#endif
6061
6162
@@ -216,24 +217,31 @@
216217
}
217218
break;
218219
}
219220
220221
/*
221
- ** T (+|-)<tagname> <uuid>
222
+ ** T (+|-)<tagname> <uuid> ?<value>?
222223
**
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.
225228
** Tags are not allowed in clusters. Multiple T lines are allowed.
226229
*/
227230
case 'T': {
228
- char *zName, *zUuid;
231
+ char *zName, *zUuid, *zValue;
229232
md5sum_step_text(blob_buffer(&line), blob_size(&line));
230233
if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
231234
if( blob_token(&line, &a2)==0 ) goto manifest_syntax_error;
232
- if( blob_token(&line, &a3)!=0 ) goto manifest_syntax_error;
233235
zName = blob_terminate(&a1);
234236
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
+ }
235243
if( blob_size(&a2)!=UUID_SIZE ) goto manifest_syntax_error;
236244
if( !validate16(zUuid, UUID_SIZE) ) goto manifest_syntax_error;
237245
defossilize(zName);
238246
if( zName[0]!='-' && zName[0]!='+' ){
239247
goto manifest_syntax_error;
@@ -244,10 +252,11 @@
244252
if( p->aTag==0 ) fossil_panic("out of memory");
245253
}
246254
i = p->nTag++;
247255
p->aTag[i].zName = zName;
248256
p->aTag[i].zUuid = zUuid;
257
+ p->aTag[i].zValue = zValue;
249258
if( i>0 && strcmp(p->aTag[i-1].zName, zName)>=0 ){
250259
goto manifest_syntax_error;
251260
}
252261
break;
253262
}
254263
--- 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

Keyboard Shortcuts

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