Diff
Not logged in

Differences From:

File src/tag.c part of check-in [472f9411ee] - Add the "hyperlinks are disabled" warning to the taglist page. Disable hyperlinks on the leaves page when hyperlinks are suppose to be disabled. by drh on 2009-01-29 03:04:38. [view]

To:

File src/tag.c part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file src/tag.c part of check-in [95f5520a09] - Construct event records for tickets correctly even when the ticket change artifacts arrive out of order. by drh on 2009-09-14 14:08:35. [view]

@@ -143,9 +143,9 @@
 
 /*
 ** Insert a tag into the database.
 */
-void tag_insert(
+int tag_insert(
   const char *zTag,        /* Name of the tag (w/o the "+" or "-" prefix */
   int tagtype,             /* 0:cancel  1:singleton  2:propagated */
   const char *zValue,      /* Value if the tag is really a property */
   int srcId,               /* Artifact that contains this tag */
@@ -171,9 +171,9 @@
   rc = db_step(&s);
   db_finalize(&s);
   if( rc==SQLITE_ROW ){
     /* Another entry that is more recent already exists.  Do nothing */
-    return;
+    return tagid;
   }
   db_prepare(&s,
     "REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid)"
     " VALUES(%d,%d,%d,%d,%Q,:mtime,%d)",
@@ -202,11 +202,16 @@
   }
   if( zCol ){
     db_multi_exec("UPDATE event SET %s=%Q WHERE objid=%d", zCol, zValue, rid);
   }
+  if( tagid==TAG_DATE ){
+    db_multi_exec("UPDATE event SET mtime=julianday(%Q) WHERE objid=%d",
+                  zValue, rid);
+  }
   if( tagtype==0 || tagtype==2 ){
     tag_propagate(rid, tagid, tagtype, rid, zValue, mtime);
   }
+  return tagid;
 }
 
 
 /*
@@ -239,8 +244,9 @@
   rid = name_to_rid(g.argv[3]);
   if( rid==0 ){
     fossil_fatal("no such object: %s", g.argv[3]);
   }
+  g.markPrivate = content_is_private(rid);
   zValue = g.argc==5 ? g.argv[4] : 0;
   db_begin_transaction();
   tag_insert(zTag, tagtype, zValue, -1, 0.0, rid);
   db_end_transaction(0);
@@ -273,8 +279,9 @@
     fossil_fatal("%s", g.zErrMsg);
     return;
   }
   rid = name_to_rid(blob_str(&uuid));
+  g.markPrivate = content_is_private(rid);
   blob_zero(&ctrl);
 
 #if 0
   if( validate16(zTagname, strlen(zTagname)) ){