Fossil SCM

Use the (existing) 'T' card in stead of an (incompatible) 'C' card, to store GIT's Tag comment.

jan.nijtmans 2017-04-03 11:33 UTC roy-export merge
Commit f2e075b9d5e7015e7760cf7f05baa3f9520ad59c486fb01b33519925aa746b8b
+4 -4
--- src/export.c
+++ src/export.c
@@ -698,32 +698,32 @@
698698
699699
/* Output tags */
700700
db_prepare(&q,
701701
"SELECT tagname, rid, strftime('%%s',mtime),"
702702
" (SELECT coalesce(euser, user) FROM event WHERE objid=rid),"
703
- " tagcomment"
703
+ " value"
704704
" FROM tagxref JOIN tag USING(tagid)"
705705
" WHERE tagtype=1 AND tagname GLOB 'sym-*'"
706706
);
707707
while( db_step(&q)==SQLITE_ROW ){
708708
const char *zTagname = db_column_text(&q, 0);
709709
int rid = db_column_int(&q, 1);
710710
char *zMark = mark_name_from_rid(rid, &unused_mark);
711711
const char *zSecSince1970 = db_column_text(&q, 2);
712712
const char *zUser = db_column_text(&q, 3);
713
- const char *zComment = db_column_text(&q, 4);
713
+ const char *zValue = db_column_text(&q, 4);
714714
if( rid==0 || !bag_find(&vers, rid) ) continue;
715715
zTagname += 4;
716716
printf("tag ");
717717
print_ref(zTagname);
718718
printf("\nfrom %s\n", zMark);
719719
free(zMark);
720720
printf("tagger");
721721
print_person(zUser);
722722
printf(" %s +0000\n", zSecSince1970);
723
- printf("data %d\n", zComment==NULL?0:(int)strlen(zComment)+1);
724
- if( zComment!=NULL ) printf("%s\n",zComment);
723
+ printf("data %d\n", zValue==NULL?0:strlen(zValue)+1);
724
+ if( zValue!=NULL ) printf("%s\n",zValue);
725725
}
726726
db_finalize(&q);
727727
728728
if( markfile_out!=0 ){
729729
FILE *f;
730730
--- src/export.c
+++ src/export.c
@@ -698,32 +698,32 @@
698
699 /* Output tags */
700 db_prepare(&q,
701 "SELECT tagname, rid, strftime('%%s',mtime),"
702 " (SELECT coalesce(euser, user) FROM event WHERE objid=rid),"
703 " tagcomment"
704 " FROM tagxref JOIN tag USING(tagid)"
705 " WHERE tagtype=1 AND tagname GLOB 'sym-*'"
706 );
707 while( db_step(&q)==SQLITE_ROW ){
708 const char *zTagname = db_column_text(&q, 0);
709 int rid = db_column_int(&q, 1);
710 char *zMark = mark_name_from_rid(rid, &unused_mark);
711 const char *zSecSince1970 = db_column_text(&q, 2);
712 const char *zUser = db_column_text(&q, 3);
713 const char *zComment = db_column_text(&q, 4);
714 if( rid==0 || !bag_find(&vers, rid) ) continue;
715 zTagname += 4;
716 printf("tag ");
717 print_ref(zTagname);
718 printf("\nfrom %s\n", zMark);
719 free(zMark);
720 printf("tagger");
721 print_person(zUser);
722 printf(" %s +0000\n", zSecSince1970);
723 printf("data %d\n", zComment==NULL?0:(int)strlen(zComment)+1);
724 if( zComment!=NULL ) printf("%s\n",zComment);
725 }
726 db_finalize(&q);
727
728 if( markfile_out!=0 ){
729 FILE *f;
730
--- src/export.c
+++ src/export.c
@@ -698,32 +698,32 @@
698
699 /* Output tags */
700 db_prepare(&q,
701 "SELECT tagname, rid, strftime('%%s',mtime),"
702 " (SELECT coalesce(euser, user) FROM event WHERE objid=rid),"
703 " value"
704 " FROM tagxref JOIN tag USING(tagid)"
705 " WHERE tagtype=1 AND tagname GLOB 'sym-*'"
706 );
707 while( db_step(&q)==SQLITE_ROW ){
708 const char *zTagname = db_column_text(&q, 0);
709 int rid = db_column_int(&q, 1);
710 char *zMark = mark_name_from_rid(rid, &unused_mark);
711 const char *zSecSince1970 = db_column_text(&q, 2);
712 const char *zUser = db_column_text(&q, 3);
713 const char *zValue = db_column_text(&q, 4);
714 if( rid==0 || !bag_find(&vers, rid) ) continue;
715 zTagname += 4;
716 printf("tag ");
717 print_ref(zTagname);
718 printf("\nfrom %s\n", zMark);
719 free(zMark);
720 printf("tagger");
721 print_person(zUser);
722 printf(" %s +0000\n", zSecSince1970);
723 printf("data %d\n", zValue==NULL?0:strlen(zValue)+1);
724 if( zValue!=NULL ) printf("%s\n",zValue);
725 }
726 db_finalize(&q);
727
728 if( markfile_out!=0 ){
729 FILE *f;
730
+5 -3
--- src/import.c
+++ src/import.c
@@ -215,15 +215,17 @@
215215
*/
216216
static void finish_tag(void){
217217
Blob record, cksum;
218218
if( gg.zDate && gg.zTag && gg.zFrom && gg.zUser ){
219219
blob_zero(&record);
220
- if( gg.zComment ) blob_appendf(&record, "C %F\n", gg.zComment);
221220
blob_appendf(&record, "D %s\n", gg.zDate);
222
- blob_appendf(&record, "T +sym-%F%F%F %s\n", gimport.zTagPre, gg.zTag,
221
+ blob_appendf(&record, "T +sym-%F%F%F %s", gimport.zTagPre, gg.zTag,
223222
gimport.zTagSuf, gg.zFrom);
224
- blob_appendf(&record, "U %F\n", gg.zUser);
223
+ if( gg.zComment ){
224
+ blob_appendf(&record, " %F", gg.zComment);
225
+ }
226
+ blob_appendf(&record, "\nU %F\n", gg.zUser);
225227
md5sum_blob(&record, &cksum);
226228
blob_appendf(&record, "Z %b\n", &cksum);
227229
fast_insert_content(&record, 0, 0, 1);
228230
blob_reset(&cksum);
229231
}
230232
--- src/import.c
+++ src/import.c
@@ -215,15 +215,17 @@
215 */
216 static void finish_tag(void){
217 Blob record, cksum;
218 if( gg.zDate && gg.zTag && gg.zFrom && gg.zUser ){
219 blob_zero(&record);
220 if( gg.zComment ) blob_appendf(&record, "C %F\n", gg.zComment);
221 blob_appendf(&record, "D %s\n", gg.zDate);
222 blob_appendf(&record, "T +sym-%F%F%F %s\n", gimport.zTagPre, gg.zTag,
223 gimport.zTagSuf, gg.zFrom);
224 blob_appendf(&record, "U %F\n", gg.zUser);
 
 
 
225 md5sum_blob(&record, &cksum);
226 blob_appendf(&record, "Z %b\n", &cksum);
227 fast_insert_content(&record, 0, 0, 1);
228 blob_reset(&cksum);
229 }
230
--- src/import.c
+++ src/import.c
@@ -215,15 +215,17 @@
215 */
216 static void finish_tag(void){
217 Blob record, cksum;
218 if( gg.zDate && gg.zTag && gg.zFrom && gg.zUser ){
219 blob_zero(&record);
 
220 blob_appendf(&record, "D %s\n", gg.zDate);
221 blob_appendf(&record, "T +sym-%F%F%F %s", gimport.zTagPre, gg.zTag,
222 gimport.zTagSuf, gg.zFrom);
223 if( gg.zComment ){
224 blob_appendf(&record, " %F", gg.zComment);
225 }
226 blob_appendf(&record, "\nU %F\n", gg.zUser);
227 md5sum_blob(&record, &cksum);
228 blob_appendf(&record, "Z %b\n", &cksum);
229 fast_insert_content(&record, 0, 0, 1);
230 blob_reset(&cksum);
231 }
232
+5 -5
--- src/manifest.c
+++ src/manifest.c
@@ -1999,11 +1999,11 @@
19991999
}
20002000
}
20012001
}
20022002
if( p->type==CFTYPE_CLUSTER ){
20032003
static Stmt del1;
2004
- tag_insert("cluster", 1, 0, rid, p->rDate, rid, NULL);
2004
+ tag_insert("cluster", 1, 0, rid, p->rDate, rid);
20052005
db_static_prepare(&del1, "DELETE FROM unclustered WHERE rid=:rid");
20062006
for(i=0; i<p->nCChild; i++){
20072007
int mid;
20082008
mid = uuid_to_rid(p->azCChild[i], 1);
20092009
if( mid>0 ){
@@ -2033,11 +2033,11 @@
20332033
default:
20342034
fossil_error(1, "unknown tag type in manifest: %s", p->aTag);
20352035
return 0;
20362036
}
20372037
tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue,
2038
- rid, p->rDate, tid, p->zComment);
2038
+ rid, p->rDate, tid);
20392039
}
20402040
}
20412041
if( parentid ){
20422042
tag_propagate_all(parentid);
20432043
}
@@ -2050,11 +2050,11 @@
20502050
int nWiki;
20512051
char zLength[40];
20522052
while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
20532053
nWiki = strlen(p->zWiki);
20542054
sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2055
- tag_insert(zTag, 1, zLength, rid, p->rDate, rid, p->zComment);
2055
+ tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
20562056
fossil_free(zTag);
20572057
prior = db_int(0,
20582058
"SELECT rid FROM tagxref"
20592059
" WHERE tagid=%d AND mtime<%.17g"
20602060
" ORDER BY mtime DESC",
@@ -2091,11 +2091,11 @@
20912091
char zLength[40];
20922092
Stmt qatt;
20932093
while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
20942094
nWiki = strlen(p->zWiki);
20952095
sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2096
- tag_insert(zTag, 1, zLength, rid, p->rDate, rid, p->zComment);
2096
+ tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
20972097
fossil_free(zTag);
20982098
prior = db_int(0,
20992099
"SELECT rid FROM tagxref"
21002100
" WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
21012101
" ORDER BY mtime DESC",
@@ -2165,11 +2165,11 @@
21652165
if( p->type==CFTYPE_TICKET ){
21662166
char *zTag;
21672167
Stmt qatt;
21682168
assert( manifest_crosslink_busy==1 );
21692169
zTag = mprintf("tkt-%s", p->zTicketUuid);
2170
- tag_insert(zTag, 1, 0, rid, p->rDate, rid, p->zComment);
2170
+ tag_insert(zTag, 1, 0, rid, p->rDate, rid);
21712171
fossil_free(zTag);
21722172
db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
21732173
p->zTicketUuid);
21742174
/* Locate and update comment for any attachments */
21752175
db_prepare(&qatt,
21762176
--- src/manifest.c
+++ src/manifest.c
@@ -1999,11 +1999,11 @@
1999 }
2000 }
2001 }
2002 if( p->type==CFTYPE_CLUSTER ){
2003 static Stmt del1;
2004 tag_insert("cluster", 1, 0, rid, p->rDate, rid, NULL);
2005 db_static_prepare(&del1, "DELETE FROM unclustered WHERE rid=:rid");
2006 for(i=0; i<p->nCChild; i++){
2007 int mid;
2008 mid = uuid_to_rid(p->azCChild[i], 1);
2009 if( mid>0 ){
@@ -2033,11 +2033,11 @@
2033 default:
2034 fossil_error(1, "unknown tag type in manifest: %s", p->aTag);
2035 return 0;
2036 }
2037 tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue,
2038 rid, p->rDate, tid, p->zComment);
2039 }
2040 }
2041 if( parentid ){
2042 tag_propagate_all(parentid);
2043 }
@@ -2050,11 +2050,11 @@
2050 int nWiki;
2051 char zLength[40];
2052 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2053 nWiki = strlen(p->zWiki);
2054 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2055 tag_insert(zTag, 1, zLength, rid, p->rDate, rid, p->zComment);
2056 fossil_free(zTag);
2057 prior = db_int(0,
2058 "SELECT rid FROM tagxref"
2059 " WHERE tagid=%d AND mtime<%.17g"
2060 " ORDER BY mtime DESC",
@@ -2091,11 +2091,11 @@
2091 char zLength[40];
2092 Stmt qatt;
2093 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2094 nWiki = strlen(p->zWiki);
2095 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2096 tag_insert(zTag, 1, zLength, rid, p->rDate, rid, p->zComment);
2097 fossil_free(zTag);
2098 prior = db_int(0,
2099 "SELECT rid FROM tagxref"
2100 " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
2101 " ORDER BY mtime DESC",
@@ -2165,11 +2165,11 @@
2165 if( p->type==CFTYPE_TICKET ){
2166 char *zTag;
2167 Stmt qatt;
2168 assert( manifest_crosslink_busy==1 );
2169 zTag = mprintf("tkt-%s", p->zTicketUuid);
2170 tag_insert(zTag, 1, 0, rid, p->rDate, rid, p->zComment);
2171 fossil_free(zTag);
2172 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
2173 p->zTicketUuid);
2174 /* Locate and update comment for any attachments */
2175 db_prepare(&qatt,
2176
--- src/manifest.c
+++ src/manifest.c
@@ -1999,11 +1999,11 @@
1999 }
2000 }
2001 }
2002 if( p->type==CFTYPE_CLUSTER ){
2003 static Stmt del1;
2004 tag_insert("cluster", 1, 0, rid, p->rDate, rid);
2005 db_static_prepare(&del1, "DELETE FROM unclustered WHERE rid=:rid");
2006 for(i=0; i<p->nCChild; i++){
2007 int mid;
2008 mid = uuid_to_rid(p->azCChild[i], 1);
2009 if( mid>0 ){
@@ -2033,11 +2033,11 @@
2033 default:
2034 fossil_error(1, "unknown tag type in manifest: %s", p->aTag);
2035 return 0;
2036 }
2037 tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue,
2038 rid, p->rDate, tid);
2039 }
2040 }
2041 if( parentid ){
2042 tag_propagate_all(parentid);
2043 }
@@ -2050,11 +2050,11 @@
2050 int nWiki;
2051 char zLength[40];
2052 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2053 nWiki = strlen(p->zWiki);
2054 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2055 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
2056 fossil_free(zTag);
2057 prior = db_int(0,
2058 "SELECT rid FROM tagxref"
2059 " WHERE tagid=%d AND mtime<%.17g"
2060 " ORDER BY mtime DESC",
@@ -2091,11 +2091,11 @@
2091 char zLength[40];
2092 Stmt qatt;
2093 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2094 nWiki = strlen(p->zWiki);
2095 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2096 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
2097 fossil_free(zTag);
2098 prior = db_int(0,
2099 "SELECT rid FROM tagxref"
2100 " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
2101 " ORDER BY mtime DESC",
@@ -2165,11 +2165,11 @@
2165 if( p->type==CFTYPE_TICKET ){
2166 char *zTag;
2167 Stmt qatt;
2168 assert( manifest_crosslink_busy==1 );
2169 zTag = mprintf("tkt-%s", p->zTicketUuid);
2170 tag_insert(zTag, 1, 0, rid, p->rDate, rid);
2171 fossil_free(zTag);
2172 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
2173 p->zTicketUuid);
2174 /* Locate and update comment for any attachments */
2175 db_prepare(&qatt,
2176
+2 -2
--- src/rebuild.c
+++ src/rebuild.c
@@ -313,12 +313,12 @@
313313
if( rid==0 ) return;
314314
315315
/* Add the trunk tag to the root of the whole tree */
316316
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
317317
if( zUuid==0 ) return;
318
- tag_add_artifact("sym-", "trunk", zUuid, 0, 2, 0, 0, 0);
319
- tag_add_artifact("", "branch", zUuid, "trunk", 2, 0, 0, 0);
318
+ tag_add_artifact("sym-", "trunk", zUuid, 0, 2, 0, 0);
319
+ tag_add_artifact("", "branch", zUuid, "trunk", 2, 0, 0);
320320
}
321321
322322
/*
323323
** Core function to rebuild the information in the derived tables of a
324324
** fossil repository from the blobs. This function is shared between
325325
--- src/rebuild.c
+++ src/rebuild.c
@@ -313,12 +313,12 @@
313 if( rid==0 ) return;
314
315 /* Add the trunk tag to the root of the whole tree */
316 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
317 if( zUuid==0 ) return;
318 tag_add_artifact("sym-", "trunk", zUuid, 0, 2, 0, 0, 0);
319 tag_add_artifact("", "branch", zUuid, "trunk", 2, 0, 0, 0);
320 }
321
322 /*
323 ** Core function to rebuild the information in the derived tables of a
324 ** fossil repository from the blobs. This function is shared between
325
--- src/rebuild.c
+++ src/rebuild.c
@@ -313,12 +313,12 @@
313 if( rid==0 ) return;
314
315 /* Add the trunk tag to the root of the whole tree */
316 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
317 if( zUuid==0 ) return;
318 tag_add_artifact("sym-", "trunk", zUuid, 0, 2, 0, 0);
319 tag_add_artifact("", "branch", zUuid, "trunk", 2, 0, 0);
320 }
321
322 /*
323 ** Core function to rebuild the information in the derived tables of a
324 ** fossil repository from the blobs. This function is shared between
325
--- src/schema.c
+++ src/schema.c
@@ -384,11 +384,10 @@
384384
@ srcid INTEGER REFERENCES blob, -- Artifact of tag. 0 for propagated tags
385385
@ origid INTEGER REFERENCES blob, -- check-in holding propagated tag
386386
@ value TEXT, -- Value of the tag. Might be NULL.
387387
@ mtime TIMESTAMP, -- Time of addition or removal. Julian day
388388
@ rid INTEGER REFERENCE blob, -- Artifact tag is applied to
389
-@ tagcomment TEXT, -- Comment of the tag
390389
@ UNIQUE(rid, tagid)
391390
@ );
392391
@ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime);
393392
@
394393
@ -- When a hyperlink occurs from one artifact to another (for example
395394
--- src/schema.c
+++ src/schema.c
@@ -384,11 +384,10 @@
384 @ srcid INTEGER REFERENCES blob, -- Artifact of tag. 0 for propagated tags
385 @ origid INTEGER REFERENCES blob, -- check-in holding propagated tag
386 @ value TEXT, -- Value of the tag. Might be NULL.
387 @ mtime TIMESTAMP, -- Time of addition or removal. Julian day
388 @ rid INTEGER REFERENCE blob, -- Artifact tag is applied to
389 @ tagcomment TEXT, -- Comment of the tag
390 @ UNIQUE(rid, tagid)
391 @ );
392 @ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime);
393 @
394 @ -- When a hyperlink occurs from one artifact to another (for example
395
--- src/schema.c
+++ src/schema.c
@@ -384,11 +384,10 @@
384 @ srcid INTEGER REFERENCES blob, -- Artifact of tag. 0 for propagated tags
385 @ origid INTEGER REFERENCES blob, -- check-in holding propagated tag
386 @ value TEXT, -- Value of the tag. Might be NULL.
387 @ mtime TIMESTAMP, -- Time of addition or removal. Julian day
388 @ rid INTEGER REFERENCE blob, -- Artifact tag is applied to
 
389 @ UNIQUE(rid, tagid)
390 @ );
391 @ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime);
392 @
393 @ -- When a hyperlink occurs from one artifact to another (for example
394
+9 -14
--- src/tag.c
+++ src/tag.c
@@ -158,12 +158,11 @@
158158
const char *zTag, /* Name of the tag (w/o the "+" or "-" prefix */
159159
int tagtype, /* 0:cancel 1:singleton 2:propagated */
160160
const char *zValue, /* Value if the tag is really a property */
161161
int srcId, /* Artifact that contains this tag */
162162
double mtime, /* Timestamp. Use default if <=0.0 */
163
- int rid, /* Artifact to which the tag is to attached */
164
- const char *zComment /* Comment for the tag */
163
+ int rid /* Artifact to which the tag is to attached */
165164
){
166165
Stmt s;
167166
const char *zCol;
168167
int tagid = tag_findid(zTag, 1);
169168
int rc;
@@ -184,13 +183,13 @@
184183
if( rc==SQLITE_ROW ){
185184
/* Another entry that is more recent already exists. Do nothing */
186185
return tagid;
187186
}
188187
db_prepare(&s,
189
- "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid,tagcomment)"
190
- " VALUES(%d,%d,%d,%d,%Q,:mtime,%d,%Q)",
191
- tagid, tagtype, srcId, rid, zValue, rid, zComment
188
+ "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
189
+ " VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
190
+ tagid, tagtype, srcId, rid, zValue, rid
192191
);
193192
db_bind_double(&s, ":mtime", mtime);
194193
db_step(&s);
195194
db_finalize(&s);
196195
if( tagid==TAG_BRANCH ) leaf_eventually_check(rid);
@@ -276,11 +275,11 @@
276275
fossil_fatal("no such object: %s", g.argv[3]);
277276
}
278277
g.markPrivate = content_is_private(rid);
279278
zValue = g.argc==5 ? g.argv[4] : 0;
280279
db_begin_transaction();
281
- tag_insert(zTag, tagtype, zValue, -1, 0.0, rid, NULL);
280
+ tag_insert(zTag, tagtype, zValue, -1, 0.0, rid);
282281
db_end_transaction(0);
283282
}
284283
285284
/*
286285
** OR this value into the tagtype argument to tag_add_artifact to
@@ -303,11 +302,10 @@
303302
const char *zPrefix, /* Prefix to prepend to tag name */
304303
const char *zTagname, /* The tag to add or cancel */
305304
const char *zObjName, /* Name of object attached to */
306305
const char *zValue, /* Value for the tag. Might be NULL */
307306
int tagtype, /* 0:cancel 1:singleton 2:propagated */
308
- const char *zComment, /* Comment for the tag */
309307
const char *zDateOvrd, /* Override date string */
310308
const char *zUserOvrd /* Override user name */
311309
){
312310
int rid;
313311
int nrid;
@@ -341,11 +339,10 @@
341339
" a hexadecimal artifact ID",
342340
zTagname
343341
);
344342
}
345343
#endif
346
- if( zComment ) blob_appendf(&ctrl, "C %F\n", zComment);
347344
zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now");
348345
blob_appendf(&ctrl, "D %s\n", zDate);
349346
blob_appendf(&ctrl, "T %c%s%F %b",
350347
zTagtype[tagtype], zPrefix, zTagname, &uuid);
351348
if( tagtype>0 && zValue && zValue[0] ){
@@ -382,11 +379,10 @@
382379
** the tag value propagates to all descendants of CHECK-IN
383380
**
384381
** Options:
385382
** --raw Raw tag name.
386383
** --propagate Propagating tag.
387
-** --comment Set a comment for the tag.
388384
** --date-override DATETIME Set date and time added.
389385
** --user-override USER Name USER when adding the tag.
390386
** --dryrun|-n Display the tag text, but do not
391387
** actually insert it into the database.
392388
**
@@ -454,21 +450,20 @@
454450
}
455451
456452
if( strncmp(g.argv[2],"add",n)==0 ){
457453
char *zValue;
458454
int dryRun = 0;
459
- const char *zComment = find_option("comment",0,1);
460455
const char *zDateOvrd = find_option("date-override",0,1);
461456
const char *zUserOvrd = find_option("user-override",0,1);
462457
if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
463458
if( g.argc!=5 && g.argc!=6 ){
464459
usage("add ?options? TAGNAME CHECK-IN ?VALUE?");
465460
}
466461
zValue = g.argc==6 ? g.argv[5] : 0;
467462
db_begin_transaction();
468463
tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue,
469
- 1+fPropagate+dryRun,zComment,zDateOvrd,zUserOvrd);
464
+ 1+fPropagate+dryRun,zDateOvrd,zUserOvrd);
470465
db_end_transaction(0);
471466
}else
472467
473468
if( strncmp(g.argv[2],"branch",n)==0 ){
474469
fossil_fatal("the \"fossil tag branch\" command is discontinued\n"
@@ -480,11 +475,11 @@
480475
if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
481476
if( g.argc!=5 ){
482477
usage("cancel ?options? TAGNAME CHECK-IN");
483478
}
484479
db_begin_transaction();
485
- tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0, 0);
480
+ tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0);
486481
db_end_transaction(0);
487482
}else
488483
489484
if( strncmp(g.argv[2],"find",n)==0 ){
490485
Stmt q;
@@ -636,14 +631,14 @@
636631
zUuid = rid_to_uuid(pid);
637632
blob_append(&value, zUuid, UUID_SIZE);
638633
fossil_free(zUuid);
639634
}
640635
if( bTest && !dryRun ){
641
- tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid, NULL);
636
+ tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid);
642637
}else{
643638
zUuid = rid_to_uuid(rid);
644
- tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0,0);
639
+ tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0);
645640
}
646641
}
647642
648643
649644
/*
650645
--- src/tag.c
+++ src/tag.c
@@ -158,12 +158,11 @@
158 const char *zTag, /* Name of the tag (w/o the "+" or "-" prefix */
159 int tagtype, /* 0:cancel 1:singleton 2:propagated */
160 const char *zValue, /* Value if the tag is really a property */
161 int srcId, /* Artifact that contains this tag */
162 double mtime, /* Timestamp. Use default if <=0.0 */
163 int rid, /* Artifact to which the tag is to attached */
164 const char *zComment /* Comment for the tag */
165 ){
166 Stmt s;
167 const char *zCol;
168 int tagid = tag_findid(zTag, 1);
169 int rc;
@@ -184,13 +183,13 @@
184 if( rc==SQLITE_ROW ){
185 /* Another entry that is more recent already exists. Do nothing */
186 return tagid;
187 }
188 db_prepare(&s,
189 "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid,tagcomment)"
190 " VALUES(%d,%d,%d,%d,%Q,:mtime,%d,%Q)",
191 tagid, tagtype, srcId, rid, zValue, rid, zComment
192 );
193 db_bind_double(&s, ":mtime", mtime);
194 db_step(&s);
195 db_finalize(&s);
196 if( tagid==TAG_BRANCH ) leaf_eventually_check(rid);
@@ -276,11 +275,11 @@
276 fossil_fatal("no such object: %s", g.argv[3]);
277 }
278 g.markPrivate = content_is_private(rid);
279 zValue = g.argc==5 ? g.argv[4] : 0;
280 db_begin_transaction();
281 tag_insert(zTag, tagtype, zValue, -1, 0.0, rid, NULL);
282 db_end_transaction(0);
283 }
284
285 /*
286 ** OR this value into the tagtype argument to tag_add_artifact to
@@ -303,11 +302,10 @@
303 const char *zPrefix, /* Prefix to prepend to tag name */
304 const char *zTagname, /* The tag to add or cancel */
305 const char *zObjName, /* Name of object attached to */
306 const char *zValue, /* Value for the tag. Might be NULL */
307 int tagtype, /* 0:cancel 1:singleton 2:propagated */
308 const char *zComment, /* Comment for the tag */
309 const char *zDateOvrd, /* Override date string */
310 const char *zUserOvrd /* Override user name */
311 ){
312 int rid;
313 int nrid;
@@ -341,11 +339,10 @@
341 " a hexadecimal artifact ID",
342 zTagname
343 );
344 }
345 #endif
346 if( zComment ) blob_appendf(&ctrl, "C %F\n", zComment);
347 zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now");
348 blob_appendf(&ctrl, "D %s\n", zDate);
349 blob_appendf(&ctrl, "T %c%s%F %b",
350 zTagtype[tagtype], zPrefix, zTagname, &uuid);
351 if( tagtype>0 && zValue && zValue[0] ){
@@ -382,11 +379,10 @@
382 ** the tag value propagates to all descendants of CHECK-IN
383 **
384 ** Options:
385 ** --raw Raw tag name.
386 ** --propagate Propagating tag.
387 ** --comment Set a comment for the tag.
388 ** --date-override DATETIME Set date and time added.
389 ** --user-override USER Name USER when adding the tag.
390 ** --dryrun|-n Display the tag text, but do not
391 ** actually insert it into the database.
392 **
@@ -454,21 +450,20 @@
454 }
455
456 if( strncmp(g.argv[2],"add",n)==0 ){
457 char *zValue;
458 int dryRun = 0;
459 const char *zComment = find_option("comment",0,1);
460 const char *zDateOvrd = find_option("date-override",0,1);
461 const char *zUserOvrd = find_option("user-override",0,1);
462 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
463 if( g.argc!=5 && g.argc!=6 ){
464 usage("add ?options? TAGNAME CHECK-IN ?VALUE?");
465 }
466 zValue = g.argc==6 ? g.argv[5] : 0;
467 db_begin_transaction();
468 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue,
469 1+fPropagate+dryRun,zComment,zDateOvrd,zUserOvrd);
470 db_end_transaction(0);
471 }else
472
473 if( strncmp(g.argv[2],"branch",n)==0 ){
474 fossil_fatal("the \"fossil tag branch\" command is discontinued\n"
@@ -480,11 +475,11 @@
480 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
481 if( g.argc!=5 ){
482 usage("cancel ?options? TAGNAME CHECK-IN");
483 }
484 db_begin_transaction();
485 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0, 0);
486 db_end_transaction(0);
487 }else
488
489 if( strncmp(g.argv[2],"find",n)==0 ){
490 Stmt q;
@@ -636,14 +631,14 @@
636 zUuid = rid_to_uuid(pid);
637 blob_append(&value, zUuid, UUID_SIZE);
638 fossil_free(zUuid);
639 }
640 if( bTest && !dryRun ){
641 tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid, NULL);
642 }else{
643 zUuid = rid_to_uuid(rid);
644 tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0,0);
645 }
646 }
647
648
649 /*
650
--- src/tag.c
+++ src/tag.c
@@ -158,12 +158,11 @@
158 const char *zTag, /* Name of the tag (w/o the "+" or "-" prefix */
159 int tagtype, /* 0:cancel 1:singleton 2:propagated */
160 const char *zValue, /* Value if the tag is really a property */
161 int srcId, /* Artifact that contains this tag */
162 double mtime, /* Timestamp. Use default if <=0.0 */
163 int rid /* Artifact to which the tag is to attached */
 
164 ){
165 Stmt s;
166 const char *zCol;
167 int tagid = tag_findid(zTag, 1);
168 int rc;
@@ -184,13 +183,13 @@
183 if( rc==SQLITE_ROW ){
184 /* Another entry that is more recent already exists. Do nothing */
185 return tagid;
186 }
187 db_prepare(&s,
188 "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
189 " VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
190 tagid, tagtype, srcId, rid, zValue, rid
191 );
192 db_bind_double(&s, ":mtime", mtime);
193 db_step(&s);
194 db_finalize(&s);
195 if( tagid==TAG_BRANCH ) leaf_eventually_check(rid);
@@ -276,11 +275,11 @@
275 fossil_fatal("no such object: %s", g.argv[3]);
276 }
277 g.markPrivate = content_is_private(rid);
278 zValue = g.argc==5 ? g.argv[4] : 0;
279 db_begin_transaction();
280 tag_insert(zTag, tagtype, zValue, -1, 0.0, rid);
281 db_end_transaction(0);
282 }
283
284 /*
285 ** OR this value into the tagtype argument to tag_add_artifact to
@@ -303,11 +302,10 @@
302 const char *zPrefix, /* Prefix to prepend to tag name */
303 const char *zTagname, /* The tag to add or cancel */
304 const char *zObjName, /* Name of object attached to */
305 const char *zValue, /* Value for the tag. Might be NULL */
306 int tagtype, /* 0:cancel 1:singleton 2:propagated */
 
307 const char *zDateOvrd, /* Override date string */
308 const char *zUserOvrd /* Override user name */
309 ){
310 int rid;
311 int nrid;
@@ -341,11 +339,10 @@
339 " a hexadecimal artifact ID",
340 zTagname
341 );
342 }
343 #endif
 
344 zDate = date_in_standard_format(zDateOvrd ? zDateOvrd : "now");
345 blob_appendf(&ctrl, "D %s\n", zDate);
346 blob_appendf(&ctrl, "T %c%s%F %b",
347 zTagtype[tagtype], zPrefix, zTagname, &uuid);
348 if( tagtype>0 && zValue && zValue[0] ){
@@ -382,11 +379,10 @@
379 ** the tag value propagates to all descendants of CHECK-IN
380 **
381 ** Options:
382 ** --raw Raw tag name.
383 ** --propagate Propagating tag.
 
384 ** --date-override DATETIME Set date and time added.
385 ** --user-override USER Name USER when adding the tag.
386 ** --dryrun|-n Display the tag text, but do not
387 ** actually insert it into the database.
388 **
@@ -454,21 +450,20 @@
450 }
451
452 if( strncmp(g.argv[2],"add",n)==0 ){
453 char *zValue;
454 int dryRun = 0;
 
455 const char *zDateOvrd = find_option("date-override",0,1);
456 const char *zUserOvrd = find_option("user-override",0,1);
457 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
458 if( g.argc!=5 && g.argc!=6 ){
459 usage("add ?options? TAGNAME CHECK-IN ?VALUE?");
460 }
461 zValue = g.argc==6 ? g.argv[5] : 0;
462 db_begin_transaction();
463 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], zValue,
464 1+fPropagate+dryRun,zDateOvrd,zUserOvrd);
465 db_end_transaction(0);
466 }else
467
468 if( strncmp(g.argv[2],"branch",n)==0 ){
469 fossil_fatal("the \"fossil tag branch\" command is discontinued\n"
@@ -480,11 +475,11 @@
475 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
476 if( g.argc!=5 ){
477 usage("cancel ?options? TAGNAME CHECK-IN");
478 }
479 db_begin_transaction();
480 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0);
481 db_end_transaction(0);
482 }else
483
484 if( strncmp(g.argv[2],"find",n)==0 ){
485 Stmt q;
@@ -636,14 +631,14 @@
631 zUuid = rid_to_uuid(pid);
632 blob_append(&value, zUuid, UUID_SIZE);
633 fossil_free(zUuid);
634 }
635 if( bTest && !dryRun ){
636 tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid);
637 }else{
638 zUuid = rid_to_uuid(rid);
639 tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0);
640 }
641 }
642
643
644 /*
645

Keyboard Shortcuts

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