Fossil SCM
Add the --type option to the "fossil tag find" command. Ticket [9bed1f604e0773]
Commit
d5b9674ec5232df7d8ec51de3c056f1f45897917
Parent
2a013f02282f36c…
1 file changed
+7
-3
+7
-3
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -348,13 +348,14 @@ | ||
| 348 | 348 | ** %fossil tag cancel ?--raw? TAGNAME CHECK-IN |
| 349 | 349 | ** |
| 350 | 350 | ** Remove the tag TAGNAME from CHECK-IN, and also remove |
| 351 | 351 | ** the propagation of the tag to any descendants. |
| 352 | 352 | ** |
| 353 | -** %fossil tag find ?--raw? TAGNAME | |
| 353 | +** %fossil tag find ?--raw? ?--type TYPE? TAGNAME | |
| 354 | 354 | ** |
| 355 | -** List all check-ins that use TAGNAME | |
| 355 | +** List all objects that use TAGNAME. TYPE can be "ci" for | |
| 356 | +** checkins or "e" for events. | |
| 356 | 357 | ** |
| 357 | 358 | ** %fossil tag list ?--raw? ?CHECK-IN? |
| 358 | 359 | ** |
| 359 | 360 | ** List all tags, or if CHECK-IN is supplied, list |
| 360 | 361 | ** all tags and their values for CHECK-IN. |
| @@ -426,10 +427,12 @@ | ||
| 426 | 427 | db_end_transaction(0); |
| 427 | 428 | }else |
| 428 | 429 | |
| 429 | 430 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 430 | 431 | Stmt q; |
| 432 | + const char *zType = find_option("type","t",1); | |
| 433 | + if( zType==0 || zType[0]==0 ) zType = "*"; | |
| 431 | 434 | if( g.argc!=4 ){ |
| 432 | 435 | usage("find ?--raw? TAGNAME"); |
| 433 | 436 | } |
| 434 | 437 | if( fRaw ){ |
| 435 | 438 | db_prepare(&q, |
| @@ -447,16 +450,17 @@ | ||
| 447 | 450 | int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", |
| 448 | 451 | g.argv[3]); |
| 449 | 452 | if( tagid>0 ){ |
| 450 | 453 | db_prepare(&q, |
| 451 | 454 | "%s" |
| 455 | + " AND event.type GLOB '%q'" | |
| 452 | 456 | " AND blob.rid IN (" |
| 453 | 457 | " SELECT rid FROM tagxref" |
| 454 | 458 | " WHERE tagtype>0 AND tagid=%d" |
| 455 | 459 | ")" |
| 456 | 460 | " ORDER BY event.mtime DESC", |
| 457 | - timeline_query_for_tty(), tagid | |
| 461 | + timeline_query_for_tty(), zType, tagid | |
| 458 | 462 | ); |
| 459 | 463 | print_timeline(&q, 2000); |
| 460 | 464 | db_finalize(&q); |
| 461 | 465 | } |
| 462 | 466 | } |
| 463 | 467 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -348,13 +348,14 @@ | |
| 348 | ** %fossil tag cancel ?--raw? TAGNAME CHECK-IN |
| 349 | ** |
| 350 | ** Remove the tag TAGNAME from CHECK-IN, and also remove |
| 351 | ** the propagation of the tag to any descendants. |
| 352 | ** |
| 353 | ** %fossil tag find ?--raw? TAGNAME |
| 354 | ** |
| 355 | ** List all check-ins that use TAGNAME |
| 356 | ** |
| 357 | ** %fossil tag list ?--raw? ?CHECK-IN? |
| 358 | ** |
| 359 | ** List all tags, or if CHECK-IN is supplied, list |
| 360 | ** all tags and their values for CHECK-IN. |
| @@ -426,10 +427,12 @@ | |
| 426 | db_end_transaction(0); |
| 427 | }else |
| 428 | |
| 429 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 430 | Stmt q; |
| 431 | if( g.argc!=4 ){ |
| 432 | usage("find ?--raw? TAGNAME"); |
| 433 | } |
| 434 | if( fRaw ){ |
| 435 | db_prepare(&q, |
| @@ -447,16 +450,17 @@ | |
| 447 | int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", |
| 448 | g.argv[3]); |
| 449 | if( tagid>0 ){ |
| 450 | db_prepare(&q, |
| 451 | "%s" |
| 452 | " AND blob.rid IN (" |
| 453 | " SELECT rid FROM tagxref" |
| 454 | " WHERE tagtype>0 AND tagid=%d" |
| 455 | ")" |
| 456 | " ORDER BY event.mtime DESC", |
| 457 | timeline_query_for_tty(), tagid |
| 458 | ); |
| 459 | print_timeline(&q, 2000); |
| 460 | db_finalize(&q); |
| 461 | } |
| 462 | } |
| 463 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -348,13 +348,14 @@ | |
| 348 | ** %fossil tag cancel ?--raw? TAGNAME CHECK-IN |
| 349 | ** |
| 350 | ** Remove the tag TAGNAME from CHECK-IN, and also remove |
| 351 | ** the propagation of the tag to any descendants. |
| 352 | ** |
| 353 | ** %fossil tag find ?--raw? ?--type TYPE? TAGNAME |
| 354 | ** |
| 355 | ** List all objects that use TAGNAME. TYPE can be "ci" for |
| 356 | ** checkins or "e" for events. |
| 357 | ** |
| 358 | ** %fossil tag list ?--raw? ?CHECK-IN? |
| 359 | ** |
| 360 | ** List all tags, or if CHECK-IN is supplied, list |
| 361 | ** all tags and their values for CHECK-IN. |
| @@ -426,10 +427,12 @@ | |
| 427 | db_end_transaction(0); |
| 428 | }else |
| 429 | |
| 430 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 431 | Stmt q; |
| 432 | const char *zType = find_option("type","t",1); |
| 433 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 434 | if( g.argc!=4 ){ |
| 435 | usage("find ?--raw? TAGNAME"); |
| 436 | } |
| 437 | if( fRaw ){ |
| 438 | db_prepare(&q, |
| @@ -447,16 +450,17 @@ | |
| 450 | int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", |
| 451 | g.argv[3]); |
| 452 | if( tagid>0 ){ |
| 453 | db_prepare(&q, |
| 454 | "%s" |
| 455 | " AND event.type GLOB '%q'" |
| 456 | " AND blob.rid IN (" |
| 457 | " SELECT rid FROM tagxref" |
| 458 | " WHERE tagtype>0 AND tagid=%d" |
| 459 | ")" |
| 460 | " ORDER BY event.mtime DESC", |
| 461 | timeline_query_for_tty(), zType, tagid |
| 462 | ); |
| 463 | print_timeline(&q, 2000); |
| 464 | db_finalize(&q); |
| 465 | } |
| 466 | } |
| 467 |