Fossil

Diff
Login

Differences From Artifact [6b7f77dfee]:

To Artifact [ada6166afd]:


346
347
348
349
350
351
352
353

354
355


356
357
358
359
360
361
362
346
347
348
349
350
351
352

353
354

355
356
357
358
359
360
361
362
363







-
+

-
+
+







**         the tag value propages to all descendants of CHECK-IN
**
**     %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.
**
**     %fossil tag find ?--raw? TAGNAME
**     %fossil tag find ?--raw? ?--type TYPE? TAGNAME
**
**         List all check-ins that use TAGNAME
**         List all objects that use TAGNAME.  TYPE can be "ci" for
**         checkins or "e" for events.
**
**     %fossil tag list ?--raw? ?CHECK-IN?
**
**         List all tags, or if CHECK-IN is supplied, list
**         all tags and their values for CHECK-IN.
**
** The option --raw allows the manipulation of all types of tags
424
425
426
427
428
429
430


431
432
433
434
435
436
437
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440







+
+







    db_begin_transaction();
    tag_add_artifact(zPrefix, g.argv[3], g.argv[4], 0, 0, 0, 0);
    db_end_transaction(0);
  }else

  if( strncmp(g.argv[2],"find",n)==0 ){
    Stmt q;
    const char *zType = find_option("type","t",1);
    if( zType==0 || zType[0]==0 ) zType = "*";
    if( g.argc!=4 ){
      usage("find ?--raw? TAGNAME");
    }
    if( fRaw ){
      db_prepare(&q,
        "SELECT blob.uuid FROM tagxref, blob"
        " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)"
445
446
447
448
449
450
451

452
453
454
455
456
457

458
459
460
461
462
463
464
448
449
450
451
452
453
454
455
456
457
458
459
460

461
462
463
464
465
466
467
468







+





-
+







      db_finalize(&q);
    }else{
      int tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",
                         g.argv[3]);
      if( tagid>0 ){
        db_prepare(&q,
          "%s"
          "  AND event.type GLOB '%q'"
          "  AND blob.rid IN ("
                    " SELECT rid FROM tagxref"
                    "  WHERE tagtype>0 AND tagid=%d"
                    ")"
          " ORDER BY event.mtime DESC",
          timeline_query_for_tty(), tagid
          timeline_query_for_tty(), zType, tagid
        );
        print_timeline(&q, 2000);
        db_finalize(&q);
      }
    }
  }else