Fossil SCM
Update tag find subcommand to be able to handle more artifact types. This concludes(?) the enhancements required for the tag command to be able to make use of the recent tag propagation features.
Commit
04c13581e12ea09fdc93d73b13926c4be958a5911f1b1fa00af4f1d8f60b56f7
Parent
4218b200312f420…
1 file changed
+13
-6
+13
-6
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -436,17 +436,21 @@ | ||
| 436 | 436 | ** -n|--dryrun Display the control artifact, but do |
| 437 | 437 | ** not insert it into the database. |
| 438 | 438 | ** |
| 439 | 439 | ** > fossil tag find ?OPTIONS? TAGNAME |
| 440 | 440 | ** |
| 441 | -** List all objects that use TAGNAME. TYPE can be "ci" for | |
| 442 | -** check-ins or "e" for events. The limit option limits the number | |
| 443 | -** of results to the given value. | |
| 441 | +** List all objects that use TAGNAME. | |
| 444 | 442 | ** |
| 445 | 443 | ** Options: |
| 446 | -** --raw Raw tag name. | |
| 447 | -** -t|--type TYPE One of "ci", or "e". | |
| 444 | +** --raw Interprets tag as a raw name instead of a | |
| 445 | +** branch name and matches any type of artifact. | |
| 446 | +** Changes the output to include only the | |
| 447 | +** hashes of matching objects. | |
| 448 | +** -t|--type TYPE One of: ci (check-in), w (wiki), | |
| 449 | +** e (event/technote), f (forum post), | |
| 450 | +** t (ticket). Default is all types. Ignored | |
| 451 | +** if --raw is used. | |
| 448 | 452 | ** -n|--limit N Limit to N results. |
| 449 | 453 | ** |
| 450 | 454 | ** > fossil tag list|ls ?OPTIONS? ?ARTIFACT-ID? |
| 451 | 455 | ** |
| 452 | 456 | ** List all tags or, if ARTIFACT-ID is supplied, all tags and |
| @@ -600,11 +604,14 @@ | ||
| 600 | 604 | while( db_step(&q)==SQLITE_ROW ){ |
| 601 | 605 | fossil_print("%s\n", db_column_text(&q, 0)); |
| 602 | 606 | } |
| 603 | 607 | db_finalize(&q); |
| 604 | 608 | }else{ |
| 605 | - int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", | |
| 609 | + int tagid = db_int(0, "SELECT tagid FROM tag " | |
| 610 | + "WHERE tagname='%s%q'", | |
| 611 | + (zType && 'c'==zType[0]) | |
| 612 | + ? "sym-" : ""/*safe-for-%s*/, | |
| 606 | 613 | g.argv[3]); |
| 607 | 614 | if( tagid>0 ){ |
| 608 | 615 | blob_append_sql(&sql, |
| 609 | 616 | "%s" |
| 610 | 617 | " AND event.type GLOB '%q'" |
| 611 | 618 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -436,17 +436,21 @@ | |
| 436 | ** -n|--dryrun Display the control artifact, but do |
| 437 | ** not insert it into the database. |
| 438 | ** |
| 439 | ** > fossil tag find ?OPTIONS? TAGNAME |
| 440 | ** |
| 441 | ** List all objects that use TAGNAME. TYPE can be "ci" for |
| 442 | ** check-ins or "e" for events. The limit option limits the number |
| 443 | ** of results to the given value. |
| 444 | ** |
| 445 | ** Options: |
| 446 | ** --raw Raw tag name. |
| 447 | ** -t|--type TYPE One of "ci", or "e". |
| 448 | ** -n|--limit N Limit to N results. |
| 449 | ** |
| 450 | ** > fossil tag list|ls ?OPTIONS? ?ARTIFACT-ID? |
| 451 | ** |
| 452 | ** List all tags or, if ARTIFACT-ID is supplied, all tags and |
| @@ -600,11 +604,14 @@ | |
| 600 | while( db_step(&q)==SQLITE_ROW ){ |
| 601 | fossil_print("%s\n", db_column_text(&q, 0)); |
| 602 | } |
| 603 | db_finalize(&q); |
| 604 | }else{ |
| 605 | int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", |
| 606 | g.argv[3]); |
| 607 | if( tagid>0 ){ |
| 608 | blob_append_sql(&sql, |
| 609 | "%s" |
| 610 | " AND event.type GLOB '%q'" |
| 611 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -436,17 +436,21 @@ | |
| 436 | ** -n|--dryrun Display the control artifact, but do |
| 437 | ** not insert it into the database. |
| 438 | ** |
| 439 | ** > fossil tag find ?OPTIONS? TAGNAME |
| 440 | ** |
| 441 | ** List all objects that use TAGNAME. |
| 442 | ** |
| 443 | ** Options: |
| 444 | ** --raw Interprets tag as a raw name instead of a |
| 445 | ** branch name and matches any type of artifact. |
| 446 | ** Changes the output to include only the |
| 447 | ** hashes of matching objects. |
| 448 | ** -t|--type TYPE One of: ci (check-in), w (wiki), |
| 449 | ** e (event/technote), f (forum post), |
| 450 | ** t (ticket). Default is all types. Ignored |
| 451 | ** if --raw is used. |
| 452 | ** -n|--limit N Limit to N results. |
| 453 | ** |
| 454 | ** > fossil tag list|ls ?OPTIONS? ?ARTIFACT-ID? |
| 455 | ** |
| 456 | ** List all tags or, if ARTIFACT-ID is supplied, all tags and |
| @@ -600,11 +604,14 @@ | |
| 604 | while( db_step(&q)==SQLITE_ROW ){ |
| 605 | fossil_print("%s\n", db_column_text(&q, 0)); |
| 606 | } |
| 607 | db_finalize(&q); |
| 608 | }else{ |
| 609 | int tagid = db_int(0, "SELECT tagid FROM tag " |
| 610 | "WHERE tagname='%s%q'", |
| 611 | (zType && 'c'==zType[0]) |
| 612 | ? "sym-" : ""/*safe-for-%s*/, |
| 613 | g.argv[3]); |
| 614 | if( tagid>0 ){ |
| 615 | blob_append_sql(&sql, |
| 616 | "%s" |
| 617 | " AND event.type GLOB '%q'" |
| 618 |