Fossil SCM

Enhance the options for the 'tag cancel' command: add --date-override and --user-override, and show a summary for the help text

florian 2018-12-26 14:37 cmd-options-amend
Commit 8f2d519bc01d7e142db752b798bcf905896658424d4f228125c11f6beb2ce07f
1 file changed +11 -1
+11 -1
--- src/tag.c
+++ src/tag.c
@@ -394,10 +394,17 @@
394394
**
395395
** Remove the tag TAGNAME from CHECK-IN, and also remove
396396
** the propagation of the tag to any descendants. Use the
397397
** the --dryrun or -n options to see what would have happened.
398398
**
399
+** Options:
400
+** --raw Raw tag name.
401
+** --date-override DATETIME Set date and time deleted.
402
+** --user-override USER Name USER when deleting the tag.
403
+** --dryrun|-n Display the control artifact, but do
404
+** not insert it into the database.
405
+**
399406
** %fossil tag find ?OPTIONS? TAGNAME
400407
**
401408
** List all objects that use TAGNAME. TYPE can be "ci" for
402409
** check-ins or "e" for events. The limit option limits the number
403410
** of results to the given value.
@@ -470,16 +477,19 @@
470477
471478
if( strncmp(g.argv[2],"cancel",n)==0 ){
472479
int dryRun = 0;
473480
int fRaw = find_option("raw","",0)!=0;
474481
const char *zPrefix = fRaw ? "" : "sym-";
482
+ const char *zDateOvrd = find_option("date-override",0,1);
483
+ const char *zUserOvrd = find_option("user-override",0,1);
475484
if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
476485
if( g.argc!=5 ){
477486
usage("cancel ?options? TAGNAME CHECK-IN");
478487
}
479488
db_begin_transaction();
480
- tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0);
489
+ tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun,
490
+ zDateOvrd, zUserOvrd);
481491
db_end_transaction(0);
482492
}else
483493
484494
if( strncmp(g.argv[2],"find",n)==0 ){
485495
Stmt q;
486496
--- src/tag.c
+++ src/tag.c
@@ -394,10 +394,17 @@
394 **
395 ** Remove the tag TAGNAME from CHECK-IN, and also remove
396 ** the propagation of the tag to any descendants. Use the
397 ** the --dryrun or -n options to see what would have happened.
398 **
 
 
 
 
 
 
 
399 ** %fossil tag find ?OPTIONS? TAGNAME
400 **
401 ** List all objects that use TAGNAME. TYPE can be "ci" for
402 ** check-ins or "e" for events. The limit option limits the number
403 ** of results to the given value.
@@ -470,16 +477,19 @@
470
471 if( strncmp(g.argv[2],"cancel",n)==0 ){
472 int dryRun = 0;
473 int fRaw = find_option("raw","",0)!=0;
474 const char *zPrefix = fRaw ? "" : "sym-";
 
 
475 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
476 if( g.argc!=5 ){
477 usage("cancel ?options? TAGNAME CHECK-IN");
478 }
479 db_begin_transaction();
480 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0);
 
481 db_end_transaction(0);
482 }else
483
484 if( strncmp(g.argv[2],"find",n)==0 ){
485 Stmt q;
486
--- src/tag.c
+++ src/tag.c
@@ -394,10 +394,17 @@
394 **
395 ** Remove the tag TAGNAME from CHECK-IN, and also remove
396 ** the propagation of the tag to any descendants. Use the
397 ** the --dryrun or -n options to see what would have happened.
398 **
399 ** Options:
400 ** --raw Raw tag name.
401 ** --date-override DATETIME Set date and time deleted.
402 ** --user-override USER Name USER when deleting the tag.
403 ** --dryrun|-n Display the control artifact, but do
404 ** not insert it into the database.
405 **
406 ** %fossil tag find ?OPTIONS? TAGNAME
407 **
408 ** List all objects that use TAGNAME. TYPE can be "ci" for
409 ** check-ins or "e" for events. The limit option limits the number
410 ** of results to the given value.
@@ -470,16 +477,19 @@
477
478 if( strncmp(g.argv[2],"cancel",n)==0 ){
479 int dryRun = 0;
480 int fRaw = find_option("raw","",0)!=0;
481 const char *zPrefix = fRaw ? "" : "sym-";
482 const char *zDateOvrd = find_option("date-override",0,1);
483 const char *zUserOvrd = find_option("user-override",0,1);
484 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
485 if( g.argc!=5 ){
486 usage("cancel ?options? TAGNAME CHECK-IN");
487 }
488 db_begin_transaction();
489 tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun,
490 zDateOvrd, zUserOvrd);
491 db_end_transaction(0);
492 }else
493
494 if( strncmp(g.argv[2],"find",n)==0 ){
495 Stmt q;
496

Keyboard Shortcuts

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