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.

stephan 2021-06-05 11:50 trunk
Commit 04c13581e12ea09fdc93d73b13926c4be958a5911f1b1fa00af4f1d8f60b56f7
1 file changed +13 -6
+13 -6
--- src/tag.c
+++ src/tag.c
@@ -436,17 +436,21 @@
436436
** -n|--dryrun Display the control artifact, but do
437437
** not insert it into the database.
438438
**
439439
** > fossil tag find ?OPTIONS? TAGNAME
440440
**
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.
444442
**
445443
** 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.
448452
** -n|--limit N Limit to N results.
449453
**
450454
** > fossil tag list|ls ?OPTIONS? ?ARTIFACT-ID?
451455
**
452456
** List all tags or, if ARTIFACT-ID is supplied, all tags and
@@ -600,11 +604,14 @@
600604
while( db_step(&q)==SQLITE_ROW ){
601605
fossil_print("%s\n", db_column_text(&q, 0));
602606
}
603607
db_finalize(&q);
604608
}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*/,
606613
g.argv[3]);
607614
if( tagid>0 ){
608615
blob_append_sql(&sql,
609616
"%s"
610617
" AND event.type GLOB '%q'"
611618
--- 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

Keyboard Shortcuts

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