Check-in [7c281b629a]
Not logged in
Overview

SHA1 Hash:7c281b629ac5c6a91b2b8143fe48a5714f54e0df
Date: 2008-12-20 11:36:20
User: eric
Comment:Prevent tag cancellations from showing in "fossil tag list" and "fossil tag find", and also on the tagview web page, but make them visible with "--raw" or on the RawTags webpage (admin only). Fixes ticket f273b440c38eb8478822812e0730f0fc2c8b4c36.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/tag.c from [54ace316a9] to [56669f6f87].

@@ -403,14 +403,15 @@
 **     %fossil tag list ?--raw? ?BASELINE?
 **
 **         List all tags, or if BASELINE is supplied, list
 **         all tags and their values for BASELINE.
 **
-** The option --raw allows the manipulation of all types of
-** tags used for various internal purposes in fossil. You
-** should not use this option to make changes unless you are
-** sure what you are doing.
+** The option --raw allows the manipulation of all types of tags
+** used for various internal purposes in fossil. It also shows
+** "cancel" tags for the "find" and "list" subcommands. You should
+** not use this option to make changes unless you are sure what
+** you are doing.
 **
 ** If you need to use a tagname that might be confused with
 ** a hexadecimal baseline or artifact ID, you can explicitly
 ** disambiguate it by prefixing it with "tag:". For instance:
 **
@@ -483,11 +484,12 @@
     }
     blob_append(&tagname, g.argv[3], strlen(g.argv[3]));
     db_prepare(&q,
       "SELECT blob.uuid FROM tagxref, blob"
       " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%B)"
-      "   AND blob.rid=tagxref.rid", &tagname
+      "   AND tagxref.tagtype > %d"
+      "   AND blob.rid=tagxref.rid", &tagname, raw ? -1 : 0
     );
     while( db_step(&q)==SQLITE_ROW ){
       printf("%s\n", db_column_text(&q, 0));
     }
     db_finalize(&q);
@@ -498,12 +500,13 @@
     if( g.argc==3 ){
       db_prepare(&q,
         "SELECT tagname FROM tag"
         " WHERE EXISTS(SELECT 1 FROM tagxref"
         "               WHERE tagid=tag.tagid"
-        "                 AND tagtype>0)"
-        " ORDER BY tagname"
+        "                 AND tagtype>%d)"
+        " ORDER BY tagname",
+        raw ? -1 : 0
       );
       while( db_step(&q)==SQLITE_ROW ){
         const char *name = db_column_text(&q, 0);
         if( raw || strncmp(name, prefix, preflen)==0 ){
           printf("%s\n", name+preflen);
@@ -513,13 +516,14 @@
     }else if( g.argc==4 ){
       int rid = name_to_rid(g.argv[3]);
       db_prepare(&q,
         "SELECT tagname, value FROM tagxref, tag"
         " WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
-        "   AND tagtype>0"
+        "   AND tagtype>%d"
         " ORDER BY tagname",
-        rid
+        rid,
+        raw ? -1 : 0
       );
       while( db_step(&q)==SQLITE_ROW ){
         const char *zName = db_column_text(&q, 0);
         const char *zValue = db_column_text(&q, 1);
         if( zValue ){

Modified src/tagview.c from [cf215193b7] to [748f6b35d4].

@@ -61,11 +61,11 @@
     "   linktagname(t.tagname) AS 'Name',"
     "   DATETIME(tx.mtime) AS 'Timestamp',"
     "   linkuuid(b.uuid) AS 'Version'"
     "  FROM tag t, tagxref tx, blob b "
     " WHERE t.tagid=tx.tagid AND tx.rid=b.rid"
-    "   AND tx.tagtype!=0 %s "
+    " %s "
     TAGVIEW_DEFAULT_FILTER
     " ORDER BY tx.mtime DESC %s",
     zLikeClause, zLimit
   );
   db_generic_query_view(zSql, 1);
@@ -174,10 +174,11 @@
   char *zSql;
   Stmt q;
   zSql = mprintf("%s AND EXISTS (SELECT 1"
          " FROM tagxref"
          "  WHERE tagxref.rid = event.objid"
+         "  AND tagxref.tagtype > 0"
          "  AND tagxref.tagid = (SELECT tagid FROM tag"
          "      WHERE tagname = %Q||%Q))"
          " ORDER BY 3 desc",
          timeline_query_for_www(), pPrefix, pName);
   db_prepare(&q, zSql);