Fossil SCM

Prevent tag cancellations from showing in "fossil tag list" and "fossil tag find", and also on the tagview web page, but make them visible with "--raw" or on the RawTags webpage (admin only). Fixes ticket [f273b440c38eb8478822812e0730f0fc2c8b4c36].

eric 2008-12-20 11:36 trunk
Commit 7c281b629ac5c6a91b2b8143fe48a5714f54e0df
2 files changed +13 -9 +2 -1
+13 -9
--- src/tag.c
+++ src/tag.c
@@ -403,14 +403,15 @@
403403
** %fossil tag list ?--raw? ?BASELINE?
404404
**
405405
** List all tags, or if BASELINE is supplied, list
406406
** all tags and their values for BASELINE.
407407
**
408
-** The option --raw allows the manipulation of all types of
409
-** tags used for various internal purposes in fossil. You
410
-** should not use this option to make changes unless you are
411
-** sure what you are doing.
408
+** The option --raw allows the manipulation of all types of tags
409
+** used for various internal purposes in fossil. It also shows
410
+** "cancel" tags for the "find" and "list" subcommands. You should
411
+** not use this option to make changes unless you are sure what
412
+** you are doing.
412413
**
413414
** If you need to use a tagname that might be confused with
414415
** a hexadecimal baseline or artifact ID, you can explicitly
415416
** disambiguate it by prefixing it with "tag:". For instance:
416417
**
@@ -483,11 +484,12 @@
483484
}
484485
blob_append(&tagname, g.argv[3], strlen(g.argv[3]));
485486
db_prepare(&q,
486487
"SELECT blob.uuid FROM tagxref, blob"
487488
" WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%B)"
488
- " AND blob.rid=tagxref.rid", &tagname
489
+ " AND tagxref.tagtype > %d"
490
+ " AND blob.rid=tagxref.rid", &tagname, raw ? -1 : 0
489491
);
490492
while( db_step(&q)==SQLITE_ROW ){
491493
printf("%s\n", db_column_text(&q, 0));
492494
}
493495
db_finalize(&q);
@@ -498,12 +500,13 @@
498500
if( g.argc==3 ){
499501
db_prepare(&q,
500502
"SELECT tagname FROM tag"
501503
" WHERE EXISTS(SELECT 1 FROM tagxref"
502504
" WHERE tagid=tag.tagid"
503
- " AND tagtype>0)"
504
- " ORDER BY tagname"
505
+ " AND tagtype>%d)"
506
+ " ORDER BY tagname",
507
+ raw ? -1 : 0
505508
);
506509
while( db_step(&q)==SQLITE_ROW ){
507510
const char *name = db_column_text(&q, 0);
508511
if( raw || strncmp(name, prefix, preflen)==0 ){
509512
printf("%s\n", name+preflen);
@@ -513,13 +516,14 @@
513516
}else if( g.argc==4 ){
514517
int rid = name_to_rid(g.argv[3]);
515518
db_prepare(&q,
516519
"SELECT tagname, value FROM tagxref, tag"
517520
" WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
518
- " AND tagtype>0"
521
+ " AND tagtype>%d"
519522
" ORDER BY tagname",
520
- rid
523
+ rid,
524
+ raw ? -1 : 0
521525
);
522526
while( db_step(&q)==SQLITE_ROW ){
523527
const char *zName = db_column_text(&q, 0);
524528
const char *zValue = db_column_text(&q, 1);
525529
if( zValue ){
526530
--- src/tag.c
+++ src/tag.c
@@ -403,14 +403,15 @@
403 ** %fossil tag list ?--raw? ?BASELINE?
404 **
405 ** List all tags, or if BASELINE is supplied, list
406 ** all tags and their values for BASELINE.
407 **
408 ** The option --raw allows the manipulation of all types of
409 ** tags used for various internal purposes in fossil. You
410 ** should not use this option to make changes unless you are
411 ** sure what you are doing.
 
412 **
413 ** If you need to use a tagname that might be confused with
414 ** a hexadecimal baseline or artifact ID, you can explicitly
415 ** disambiguate it by prefixing it with "tag:". For instance:
416 **
@@ -483,11 +484,12 @@
483 }
484 blob_append(&tagname, g.argv[3], strlen(g.argv[3]));
485 db_prepare(&q,
486 "SELECT blob.uuid FROM tagxref, blob"
487 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%B)"
488 " AND blob.rid=tagxref.rid", &tagname
 
489 );
490 while( db_step(&q)==SQLITE_ROW ){
491 printf("%s\n", db_column_text(&q, 0));
492 }
493 db_finalize(&q);
@@ -498,12 +500,13 @@
498 if( g.argc==3 ){
499 db_prepare(&q,
500 "SELECT tagname FROM tag"
501 " WHERE EXISTS(SELECT 1 FROM tagxref"
502 " WHERE tagid=tag.tagid"
503 " AND tagtype>0)"
504 " ORDER BY tagname"
 
505 );
506 while( db_step(&q)==SQLITE_ROW ){
507 const char *name = db_column_text(&q, 0);
508 if( raw || strncmp(name, prefix, preflen)==0 ){
509 printf("%s\n", name+preflen);
@@ -513,13 +516,14 @@
513 }else if( g.argc==4 ){
514 int rid = name_to_rid(g.argv[3]);
515 db_prepare(&q,
516 "SELECT tagname, value FROM tagxref, tag"
517 " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
518 " AND tagtype>0"
519 " ORDER BY tagname",
520 rid
 
521 );
522 while( db_step(&q)==SQLITE_ROW ){
523 const char *zName = db_column_text(&q, 0);
524 const char *zValue = db_column_text(&q, 1);
525 if( zValue ){
526
--- src/tag.c
+++ src/tag.c
@@ -403,14 +403,15 @@
403 ** %fossil tag list ?--raw? ?BASELINE?
404 **
405 ** List all tags, or if BASELINE is supplied, list
406 ** all tags and their values for BASELINE.
407 **
408 ** The option --raw allows the manipulation of all types of tags
409 ** used for various internal purposes in fossil. It also shows
410 ** "cancel" tags for the "find" and "list" subcommands. You should
411 ** not use this option to make changes unless you are sure what
412 ** you are doing.
413 **
414 ** If you need to use a tagname that might be confused with
415 ** a hexadecimal baseline or artifact ID, you can explicitly
416 ** disambiguate it by prefixing it with "tag:". For instance:
417 **
@@ -483,11 +484,12 @@
484 }
485 blob_append(&tagname, g.argv[3], strlen(g.argv[3]));
486 db_prepare(&q,
487 "SELECT blob.uuid FROM tagxref, blob"
488 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%B)"
489 " AND tagxref.tagtype > %d"
490 " AND blob.rid=tagxref.rid", &tagname, raw ? -1 : 0
491 );
492 while( db_step(&q)==SQLITE_ROW ){
493 printf("%s\n", db_column_text(&q, 0));
494 }
495 db_finalize(&q);
@@ -498,12 +500,13 @@
500 if( g.argc==3 ){
501 db_prepare(&q,
502 "SELECT tagname FROM tag"
503 " WHERE EXISTS(SELECT 1 FROM tagxref"
504 " WHERE tagid=tag.tagid"
505 " AND tagtype>%d)"
506 " ORDER BY tagname",
507 raw ? -1 : 0
508 );
509 while( db_step(&q)==SQLITE_ROW ){
510 const char *name = db_column_text(&q, 0);
511 if( raw || strncmp(name, prefix, preflen)==0 ){
512 printf("%s\n", name+preflen);
@@ -513,13 +516,14 @@
516 }else if( g.argc==4 ){
517 int rid = name_to_rid(g.argv[3]);
518 db_prepare(&q,
519 "SELECT tagname, value FROM tagxref, tag"
520 " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
521 " AND tagtype>%d"
522 " ORDER BY tagname",
523 rid,
524 raw ? -1 : 0
525 );
526 while( db_step(&q)==SQLITE_ROW ){
527 const char *zName = db_column_text(&q, 0);
528 const char *zValue = db_column_text(&q, 1);
529 if( zValue ){
530
+2 -1
--- src/tagview.c
+++ src/tagview.c
@@ -61,11 +61,11 @@
6161
" linktagname(t.tagname) AS 'Name',"
6262
" DATETIME(tx.mtime) AS 'Timestamp',"
6363
" linkuuid(b.uuid) AS 'Version'"
6464
" FROM tag t, tagxref tx, blob b "
6565
" WHERE t.tagid=tx.tagid AND tx.rid=b.rid"
66
- " AND tx.tagtype!=0 %s "
66
+ " %s "
6767
TAGVIEW_DEFAULT_FILTER
6868
" ORDER BY tx.mtime DESC %s",
6969
zLikeClause, zLimit
7070
);
7171
db_generic_query_view(zSql, 1);
@@ -174,10 +174,11 @@
174174
char *zSql;
175175
Stmt q;
176176
zSql = mprintf("%s AND EXISTS (SELECT 1"
177177
" FROM tagxref"
178178
" WHERE tagxref.rid = event.objid"
179
+ " AND tagxref.tagtype > 0"
179180
" AND tagxref.tagid = (SELECT tagid FROM tag"
180181
" WHERE tagname = %Q||%Q))"
181182
" ORDER BY 3 desc",
182183
timeline_query_for_www(), pPrefix, pName);
183184
db_prepare(&q, zSql);
184185
--- src/tagview.c
+++ src/tagview.c
@@ -61,11 +61,11 @@
61 " linktagname(t.tagname) AS 'Name',"
62 " DATETIME(tx.mtime) AS 'Timestamp',"
63 " linkuuid(b.uuid) AS 'Version'"
64 " FROM tag t, tagxref tx, blob b "
65 " WHERE t.tagid=tx.tagid AND tx.rid=b.rid"
66 " AND tx.tagtype!=0 %s "
67 TAGVIEW_DEFAULT_FILTER
68 " ORDER BY tx.mtime DESC %s",
69 zLikeClause, zLimit
70 );
71 db_generic_query_view(zSql, 1);
@@ -174,10 +174,11 @@
174 char *zSql;
175 Stmt q;
176 zSql = mprintf("%s AND EXISTS (SELECT 1"
177 " FROM tagxref"
178 " WHERE tagxref.rid = event.objid"
 
179 " AND tagxref.tagid = (SELECT tagid FROM tag"
180 " WHERE tagname = %Q||%Q))"
181 " ORDER BY 3 desc",
182 timeline_query_for_www(), pPrefix, pName);
183 db_prepare(&q, zSql);
184
--- src/tagview.c
+++ src/tagview.c
@@ -61,11 +61,11 @@
61 " linktagname(t.tagname) AS 'Name',"
62 " DATETIME(tx.mtime) AS 'Timestamp',"
63 " linkuuid(b.uuid) AS 'Version'"
64 " FROM tag t, tagxref tx, blob b "
65 " WHERE t.tagid=tx.tagid AND tx.rid=b.rid"
66 " %s "
67 TAGVIEW_DEFAULT_FILTER
68 " ORDER BY tx.mtime DESC %s",
69 zLikeClause, zLimit
70 );
71 db_generic_query_view(zSql, 1);
@@ -174,10 +174,11 @@
174 char *zSql;
175 Stmt q;
176 zSql = mprintf("%s AND EXISTS (SELECT 1"
177 " FROM tagxref"
178 " WHERE tagxref.rid = event.objid"
179 " AND tagxref.tagtype > 0"
180 " AND tagxref.tagid = (SELECT tagid FROM tag"
181 " WHERE tagname = %Q||%Q))"
182 " ORDER BY 3 desc",
183 timeline_query_for_www(), pPrefix, pName);
184 db_prepare(&q, zSql);
185

Keyboard Shortcuts

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