Fossil

Check-in [8f2d519b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the options for the 'tag cancel' command: add --date-override and --user-override, and show a summary for the help text
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cmd-options-amend
Files: files | file ages | folders
SHA3-256: 8f2d519bc01d7e142db752b798bcf905896658424d4f228125c11f6beb2ce07f
User & Date: florian 2018-12-26 14:38:00
Context
2018-12-27
12:36
Remove two unused variables (introduced by [2efcd19f14] through copy-and-paste) Closed-Leaf check-in: cf0f6fc8 user: florian tags: cmd-options-amend
2018-12-26
14:38
Enhance the options for the 'tag cancel' command: add --date-override and --user-override, and show a summary for the help text check-in: 8f2d519b user: florian tags: cmd-options-amend
14:25
For the 'tag' command, parse all options after the sub-commands, so that no unsupported options can be used (for example, disallow 'fossil tag cancel --propagate ...'), and to have a consistent command-line format with sub-commands followed by options check-in: 2efcd19f user: florian tags: cmd-options-amend
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/tag.c.

392
393
394
395
396
397
398







399
400
401
402
403
404
405
...
468
469
470
471
472
473
474


475
476
477
478
479
480

481
482
483
484
485
486
487
**
**     %fossil tag cancel ?--raw? TAGNAME CHECK-IN
**
**         Remove the tag TAGNAME from CHECK-IN, and also remove
**         the propagation of the tag to any descendants.  Use the
**         the --dryrun or -n options to see what would have happened.
**







**     %fossil tag find ?OPTIONS? TAGNAME
**
**         List all objects that use TAGNAME.  TYPE can be "ci" for
**         check-ins or "e" for events. The limit option limits the number
**         of results to the given value.
**
**         Options:
................................................................................
                 "Use the \"fossil branch new\" command instead.");
  }else

  if( strncmp(g.argv[2],"cancel",n)==0 ){
    int dryRun = 0;
    int fRaw = find_option("raw","",0)!=0;
    const char *zPrefix = fRaw ? "" : "sym-";


    if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
    if( g.argc!=5 ){
      usage("cancel ?options? TAGNAME CHECK-IN");
    }
    db_begin_transaction();
    tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun, 0, 0);

    db_end_transaction(0);
  }else

  if( strncmp(g.argv[2],"find",n)==0 ){
    Stmt q;
    int fRaw = find_option("raw","",0)!=0;
    const char *zPrefix = fRaw ? "" : "sym-";







>
>
>
>
>
>
>







 







>
>





|
>







392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
...
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
**
**     %fossil tag cancel ?--raw? TAGNAME CHECK-IN
**
**         Remove the tag TAGNAME from CHECK-IN, and also remove
**         the propagation of the tag to any descendants.  Use the
**         the --dryrun or -n options to see what would have happened.
**
**         Options:
**           --raw                       Raw tag name.
**           --date-override DATETIME    Set date and time deleted.
**           --user-override USER        Name USER when deleting the tag.
**           --dryrun|-n                 Display the control artifact, but do
**                                       not insert it into the database.
**
**     %fossil tag find ?OPTIONS? TAGNAME
**
**         List all objects that use TAGNAME.  TYPE can be "ci" for
**         check-ins or "e" for events. The limit option limits the number
**         of results to the given value.
**
**         Options:
................................................................................
                 "Use the \"fossil branch new\" command instead.");
  }else

  if( strncmp(g.argv[2],"cancel",n)==0 ){
    int dryRun = 0;
    int fRaw = find_option("raw","",0)!=0;
    const char *zPrefix = fRaw ? "" : "sym-";
    const char *zDateOvrd = find_option("date-override",0,1);
    const char *zUserOvrd = find_option("user-override",0,1);
    if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
    if( g.argc!=5 ){
      usage("cancel ?options? TAGNAME CHECK-IN");
    }
    db_begin_transaction();
    tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, dryRun,
                     zDateOvrd, zUserOvrd);
    db_end_transaction(0);
  }else

  if( strncmp(g.argv[2],"find",n)==0 ){
    Stmt q;
    int fRaw = find_option("raw","",0)!=0;
    const char *zPrefix = fRaw ? "" : "sym-";