Diff
Not logged in

Differences From:

File src/manifest.c part of check-in [2a069086e9] - Make sure the manifest_crosslink_begin/end pair can be called multiple times. by drh on 2009-09-14 14:10:49. [view]

To:

File src/manifest.c part of check-in [7a2c37063a] - merge trunk into creole branch by bob on 2009-09-22 07:49:39. Also file src/manifest.c part of check-in [df3e34c2e8] - Changes to the event mechanism to abbreviate a sequence of edits to the same ticket. Updates through this check-in require a "rebuild". by drh on 2009-09-14 15:14:32. [view]

@@ -923,19 +923,22 @@
 */
 void manifest_ticket_event(
   int rid,                    /* Artifact ID of the change ticket artifact */
   const Manifest *pManifest,  /* Parsed content of the artifact */
-  int isNew                   /* True if this is the first event */
+  int isNew,                  /* True if this is the first event */
+  int tktTagId                /* Ticket tag ID */
 ){
   int i;
   char *zTitle;
   Blob comment;
+  Blob brief;
   char *zNewStatus = 0;
   static char *zTitleExpr = 0;
   static char *zStatusColumn = 0;
   static int once = 1;
 
   blob_zero(&comment);
+  blob_zero(&brief);
   if( once ){
     once = 0;
     zTitleExpr = db_get("ticket-title-expr", "title");
     zStatusColumn = db_get("ticket-status-column", "status");
@@ -957,8 +960,10 @@
       if( pManifest->nField>1 ){
         blob_appendf(&comment, " plus %d other change%s",
           pManifest->nField-1, pManifest->nField==2 ? "" : "s");
       }
+      blob_appendf(&brief, "%h ticket [%.10s].",
+                   zNewStatus, pManifest->zTicketUuid);
     }else{
       zNewStatus = db_text("unknown",
          "SELECT %s FROM ticket WHERE tkt_uuid='%s'",
          zStatusColumn, pManifest->zTicketUuid
@@ -968,21 +973,28 @@
            pManifest->zTicketUuid, zTitle, zNewStatus, pManifest->nField,
            pManifest->nField==1 ? "" : "s"
       );
       free(zNewStatus);
+      blob_appendf(&brief, "Ticket [%.10s]: %d change%s",
+           pManifest->zTicketUuid, pManifest->nField,
+           pManifest->nField==1 ? "" : "s"
+      );
     }
   }else{
     blob_appendf(&comment, "New ticket [%.10s] <i>%h</i>.",
       pManifest->zTicketUuid, zTitle
     );
+    blob_appendf(&brief, "New ticket [%.10s].", pManifest->zTicketUuid);
   }
   free(zTitle);
   db_multi_exec(
-    "REPLACE INTO event(type,mtime,objid,user,comment)"
-    "VALUES('t',%.17g,%d,%Q,%Q)",
-    pManifest->rDate, rid, pManifest->zUser, blob_str(&comment)
+    "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
+    "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
+    tktTagId, pManifest->rDate, rid, pManifest->zUser,
+    blob_str(&comment), blob_str(&brief)
   );
   blob_reset(&comment);
+  blob_reset(&brief);
 }
 
 /*
 ** Scan artifact rid/pContent to see if it is a control artifact of