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].
Commit
7c281b629ac5c6a91b2b8143fe48a5714f54e0df
Parent
491b2c69ec500c6…
2 files changed
+13
-9
+2
-1
+13
-9
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -403,14 +403,15 @@ | ||
| 403 | 403 | ** %fossil tag list ?--raw? ?BASELINE? |
| 404 | 404 | ** |
| 405 | 405 | ** List all tags, or if BASELINE is supplied, list |
| 406 | 406 | ** all tags and their values for BASELINE. |
| 407 | 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. | |
| 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. | |
| 412 | 413 | ** |
| 413 | 414 | ** If you need to use a tagname that might be confused with |
| 414 | 415 | ** a hexadecimal baseline or artifact ID, you can explicitly |
| 415 | 416 | ** disambiguate it by prefixing it with "tag:". For instance: |
| 416 | 417 | ** |
| @@ -483,11 +484,12 @@ | ||
| 483 | 484 | } |
| 484 | 485 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 485 | 486 | db_prepare(&q, |
| 486 | 487 | "SELECT blob.uuid FROM tagxref, blob" |
| 487 | 488 | " 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 | |
| 489 | 491 | ); |
| 490 | 492 | while( db_step(&q)==SQLITE_ROW ){ |
| 491 | 493 | printf("%s\n", db_column_text(&q, 0)); |
| 492 | 494 | } |
| 493 | 495 | db_finalize(&q); |
| @@ -498,12 +500,13 @@ | ||
| 498 | 500 | if( g.argc==3 ){ |
| 499 | 501 | db_prepare(&q, |
| 500 | 502 | "SELECT tagname FROM tag" |
| 501 | 503 | " WHERE EXISTS(SELECT 1 FROM tagxref" |
| 502 | 504 | " WHERE tagid=tag.tagid" |
| 503 | - " AND tagtype>0)" | |
| 504 | - " ORDER BY tagname" | |
| 505 | + " AND tagtype>%d)" | |
| 506 | + " ORDER BY tagname", | |
| 507 | + raw ? -1 : 0 | |
| 505 | 508 | ); |
| 506 | 509 | while( db_step(&q)==SQLITE_ROW ){ |
| 507 | 510 | const char *name = db_column_text(&q, 0); |
| 508 | 511 | if( raw || strncmp(name, prefix, preflen)==0 ){ |
| 509 | 512 | printf("%s\n", name+preflen); |
| @@ -513,13 +516,14 @@ | ||
| 513 | 516 | }else if( g.argc==4 ){ |
| 514 | 517 | int rid = name_to_rid(g.argv[3]); |
| 515 | 518 | db_prepare(&q, |
| 516 | 519 | "SELECT tagname, value FROM tagxref, tag" |
| 517 | 520 | " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid" |
| 518 | - " AND tagtype>0" | |
| 521 | + " AND tagtype>%d" | |
| 519 | 522 | " ORDER BY tagname", |
| 520 | - rid | |
| 523 | + rid, | |
| 524 | + raw ? -1 : 0 | |
| 521 | 525 | ); |
| 522 | 526 | while( db_step(&q)==SQLITE_ROW ){ |
| 523 | 527 | const char *zName = db_column_text(&q, 0); |
| 524 | 528 | const char *zValue = db_column_text(&q, 1); |
| 525 | 529 | if( zValue ){ |
| 526 | 530 |
| --- 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 @@ | ||
| 61 | 61 | " linktagname(t.tagname) AS 'Name'," |
| 62 | 62 | " DATETIME(tx.mtime) AS 'Timestamp'," |
| 63 | 63 | " linkuuid(b.uuid) AS 'Version'" |
| 64 | 64 | " FROM tag t, tagxref tx, blob b " |
| 65 | 65 | " WHERE t.tagid=tx.tagid AND tx.rid=b.rid" |
| 66 | - " AND tx.tagtype!=0 %s " | |
| 66 | + " %s " | |
| 67 | 67 | TAGVIEW_DEFAULT_FILTER |
| 68 | 68 | " ORDER BY tx.mtime DESC %s", |
| 69 | 69 | zLikeClause, zLimit |
| 70 | 70 | ); |
| 71 | 71 | db_generic_query_view(zSql, 1); |
| @@ -174,10 +174,11 @@ | ||
| 174 | 174 | char *zSql; |
| 175 | 175 | Stmt q; |
| 176 | 176 | zSql = mprintf("%s AND EXISTS (SELECT 1" |
| 177 | 177 | " FROM tagxref" |
| 178 | 178 | " WHERE tagxref.rid = event.objid" |
| 179 | + " AND tagxref.tagtype > 0" | |
| 179 | 180 | " AND tagxref.tagid = (SELECT tagid FROM tag" |
| 180 | 181 | " WHERE tagname = %Q||%Q))" |
| 181 | 182 | " ORDER BY 3 desc", |
| 182 | 183 | timeline_query_for_www(), pPrefix, pName); |
| 183 | 184 | db_prepare(&q, zSql); |
| 184 | 185 |
| --- 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 |