Fossil SCM

Changes to the event mechanism to abbreviate a sequence of edits to the same ticket. Updates through this check-in require a "rebuild".

drh 2009-09-14 15:14 trunk
Commit df3e34c2e8b22fab30f92d5c41c692f428353232
+16 -4
--- src/manifest.c
+++ src/manifest.c
@@ -922,21 +922,24 @@
922922
** Make an entry in the event table for a ticket change artifact.
923923
*/
924924
void manifest_ticket_event(
925925
int rid, /* Artifact ID of the change ticket artifact */
926926
const Manifest *pManifest, /* Parsed content of the artifact */
927
- int isNew /* True if this is the first event */
927
+ int isNew, /* True if this is the first event */
928
+ int tktTagId /* Ticket tag ID */
928929
){
929930
int i;
930931
char *zTitle;
931932
Blob comment;
933
+ Blob brief;
932934
char *zNewStatus = 0;
933935
static char *zTitleExpr = 0;
934936
static char *zStatusColumn = 0;
935937
static int once = 1;
936938
937939
blob_zero(&comment);
940
+ blob_zero(&brief);
938941
if( once ){
939942
once = 0;
940943
zTitleExpr = db_get("ticket-title-expr", "title");
941944
zStatusColumn = db_get("ticket-status-column", "status");
942945
}
@@ -956,10 +959,12 @@
956959
);
957960
if( pManifest->nField>1 ){
958961
blob_appendf(&comment, " plus %d other change%s",
959962
pManifest->nField-1, pManifest->nField==2 ? "" : "s");
960963
}
964
+ blob_appendf(&brief, "%h ticket [%.10s].",
965
+ zNewStatus, pManifest->zTicketUuid);
961966
}else{
962967
zNewStatus = db_text("unknown",
963968
"SELECT %s FROM ticket WHERE tkt_uuid='%s'",
964969
zStatusColumn, pManifest->zTicketUuid
965970
);
@@ -967,23 +972,30 @@
967972
"%d other change%s",
968973
pManifest->zTicketUuid, zTitle, zNewStatus, pManifest->nField,
969974
pManifest->nField==1 ? "" : "s"
970975
);
971976
free(zNewStatus);
977
+ blob_appendf(&brief, "Ticket [%.10s]: %d change%s",
978
+ pManifest->zTicketUuid, pManifest->nField,
979
+ pManifest->nField==1 ? "" : "s"
980
+ );
972981
}
973982
}else{
974983
blob_appendf(&comment, "New ticket [%.10s] <i>%h</i>.",
975984
pManifest->zTicketUuid, zTitle
976985
);
986
+ blob_appendf(&brief, "New ticket [%.10s].", pManifest->zTicketUuid);
977987
}
978988
free(zTitle);
979989
db_multi_exec(
980
- "REPLACE INTO event(type,mtime,objid,user,comment)"
981
- "VALUES('t',%.17g,%d,%Q,%Q)",
982
- pManifest->rDate, rid, pManifest->zUser, blob_str(&comment)
990
+ "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
991
+ "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
992
+ tktTagId, pManifest->rDate, rid, pManifest->zUser,
993
+ blob_str(&comment), blob_str(&brief)
983994
);
984995
blob_reset(&comment);
996
+ blob_reset(&brief);
985997
}
986998
987999
/*
9881000
** Scan artifact rid/pContent to see if it is a control artifact of
9891001
** any key:
9901002
--- src/manifest.c
+++ src/manifest.c
@@ -922,21 +922,24 @@
922 ** Make an entry in the event table for a ticket change artifact.
923 */
924 void manifest_ticket_event(
925 int rid, /* Artifact ID of the change ticket artifact */
926 const Manifest *pManifest, /* Parsed content of the artifact */
927 int isNew /* True if this is the first event */
 
928 ){
929 int i;
930 char *zTitle;
931 Blob comment;
 
932 char *zNewStatus = 0;
933 static char *zTitleExpr = 0;
934 static char *zStatusColumn = 0;
935 static int once = 1;
936
937 blob_zero(&comment);
 
938 if( once ){
939 once = 0;
940 zTitleExpr = db_get("ticket-title-expr", "title");
941 zStatusColumn = db_get("ticket-status-column", "status");
942 }
@@ -956,10 +959,12 @@
956 );
957 if( pManifest->nField>1 ){
958 blob_appendf(&comment, " plus %d other change%s",
959 pManifest->nField-1, pManifest->nField==2 ? "" : "s");
960 }
 
 
961 }else{
962 zNewStatus = db_text("unknown",
963 "SELECT %s FROM ticket WHERE tkt_uuid='%s'",
964 zStatusColumn, pManifest->zTicketUuid
965 );
@@ -967,23 +972,30 @@
967 "%d other change%s",
968 pManifest->zTicketUuid, zTitle, zNewStatus, pManifest->nField,
969 pManifest->nField==1 ? "" : "s"
970 );
971 free(zNewStatus);
 
 
 
 
972 }
973 }else{
974 blob_appendf(&comment, "New ticket [%.10s] <i>%h</i>.",
975 pManifest->zTicketUuid, zTitle
976 );
 
977 }
978 free(zTitle);
979 db_multi_exec(
980 "REPLACE INTO event(type,mtime,objid,user,comment)"
981 "VALUES('t',%.17g,%d,%Q,%Q)",
982 pManifest->rDate, rid, pManifest->zUser, blob_str(&comment)
 
983 );
984 blob_reset(&comment);
 
985 }
986
987 /*
988 ** Scan artifact rid/pContent to see if it is a control artifact of
989 ** any key:
990
--- src/manifest.c
+++ src/manifest.c
@@ -922,21 +922,24 @@
922 ** Make an entry in the event table for a ticket change artifact.
923 */
924 void manifest_ticket_event(
925 int rid, /* Artifact ID of the change ticket artifact */
926 const Manifest *pManifest, /* Parsed content of the artifact */
927 int isNew, /* True if this is the first event */
928 int tktTagId /* Ticket tag ID */
929 ){
930 int i;
931 char *zTitle;
932 Blob comment;
933 Blob brief;
934 char *zNewStatus = 0;
935 static char *zTitleExpr = 0;
936 static char *zStatusColumn = 0;
937 static int once = 1;
938
939 blob_zero(&comment);
940 blob_zero(&brief);
941 if( once ){
942 once = 0;
943 zTitleExpr = db_get("ticket-title-expr", "title");
944 zStatusColumn = db_get("ticket-status-column", "status");
945 }
@@ -956,10 +959,12 @@
959 );
960 if( pManifest->nField>1 ){
961 blob_appendf(&comment, " plus %d other change%s",
962 pManifest->nField-1, pManifest->nField==2 ? "" : "s");
963 }
964 blob_appendf(&brief, "%h ticket [%.10s].",
965 zNewStatus, pManifest->zTicketUuid);
966 }else{
967 zNewStatus = db_text("unknown",
968 "SELECT %s FROM ticket WHERE tkt_uuid='%s'",
969 zStatusColumn, pManifest->zTicketUuid
970 );
@@ -967,23 +972,30 @@
972 "%d other change%s",
973 pManifest->zTicketUuid, zTitle, zNewStatus, pManifest->nField,
974 pManifest->nField==1 ? "" : "s"
975 );
976 free(zNewStatus);
977 blob_appendf(&brief, "Ticket [%.10s]: %d change%s",
978 pManifest->zTicketUuid, pManifest->nField,
979 pManifest->nField==1 ? "" : "s"
980 );
981 }
982 }else{
983 blob_appendf(&comment, "New ticket [%.10s] <i>%h</i>.",
984 pManifest->zTicketUuid, zTitle
985 );
986 blob_appendf(&brief, "New ticket [%.10s].", pManifest->zTicketUuid);
987 }
988 free(zTitle);
989 db_multi_exec(
990 "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
991 "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
992 tktTagId, pManifest->rDate, rid, pManifest->zUser,
993 blob_str(&comment), blob_str(&brief)
994 );
995 blob_reset(&comment);
996 blob_reset(&brief);
997 }
998
999 /*
1000 ** Scan artifact rid/pContent to see if it is a control artifact of
1001 ** any key:
1002
+3 -1
--- src/schema.c
+++ src/schema.c
@@ -223,16 +223,18 @@
223223
@ --
224224
@ CREATE TABLE event(
225225
@ type TEXT, -- Type of event
226226
@ mtime DATETIME, -- Date and time when the event occurs
227227
@ objid INTEGER PRIMARY KEY, -- Associated record ID
228
+@ tagid INTEGER, -- Associated ticket or wiki name tag
228229
@ uid INTEGER REFERENCES user, -- User who caused the event
229230
@ bgcolor TEXT, -- Color set by 'bgcolor' property
230231
@ euser TEXT, -- User set by 'user' property
231232
@ user TEXT, -- Name of the user
232233
@ ecomment TEXT, -- Comment set by 'comment' property
233
-@ comment TEXT -- Comment describing the event
234
+@ comment TEXT, -- Comment describing the event
235
+@ brief TEXT -- Short comment when tagid already seen
234236
@ );
235237
@ CREATE INDEX event_i1 ON event(mtime);
236238
@
237239
@ -- A record of phantoms. A phantom is a record for which we know the
238240
@ -- UUID but we do not (yet) know the file content.
239241
--- src/schema.c
+++ src/schema.c
@@ -223,16 +223,18 @@
223 @ --
224 @ CREATE TABLE event(
225 @ type TEXT, -- Type of event
226 @ mtime DATETIME, -- Date and time when the event occurs
227 @ objid INTEGER PRIMARY KEY, -- Associated record ID
 
228 @ uid INTEGER REFERENCES user, -- User who caused the event
229 @ bgcolor TEXT, -- Color set by 'bgcolor' property
230 @ euser TEXT, -- User set by 'user' property
231 @ user TEXT, -- Name of the user
232 @ ecomment TEXT, -- Comment set by 'comment' property
233 @ comment TEXT -- Comment describing the event
 
234 @ );
235 @ CREATE INDEX event_i1 ON event(mtime);
236 @
237 @ -- A record of phantoms. A phantom is a record for which we know the
238 @ -- UUID but we do not (yet) know the file content.
239
--- src/schema.c
+++ src/schema.c
@@ -223,16 +223,18 @@
223 @ --
224 @ CREATE TABLE event(
225 @ type TEXT, -- Type of event
226 @ mtime DATETIME, -- Date and time when the event occurs
227 @ objid INTEGER PRIMARY KEY, -- Associated record ID
228 @ tagid INTEGER, -- Associated ticket or wiki name tag
229 @ uid INTEGER REFERENCES user, -- User who caused the event
230 @ bgcolor TEXT, -- Color set by 'bgcolor' property
231 @ euser TEXT, -- User set by 'user' property
232 @ user TEXT, -- Name of the user
233 @ ecomment TEXT, -- Comment set by 'comment' property
234 @ comment TEXT, -- Comment describing the event
235 @ brief TEXT -- Short comment when tagid already seen
236 @ );
237 @ CREATE INDEX event_i1 ON event(mtime);
238 @
239 @ -- A record of phantoms. A phantom is a record for which we know the
240 @ -- UUID but we do not (yet) know the file content.
241
+39 -5
--- src/timeline.c
+++ src/timeline.c
@@ -132,10 +132,11 @@
132132
** Allowed flags for the tmFlags argument to www_print_timeline
133133
*/
134134
#if INTERFACE
135135
#define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
136136
#define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
137
+#define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */
137138
#endif
138139
139140
/*
140141
** Output a timeline in the web format given a query. The query
141142
** should return these columns:
@@ -147,12 +148,14 @@
147148
** 4. User
148149
** 5. Number of non-merge children
149150
** 6. Number of parents
150151
** 7. True if is a leaf
151152
** 8. background color
152
-** 9. type ("ci", "w")
153
+** 9. type ("ci", "w", "t")
153154
** 10. list of symbolic tags.
155
+** 11. tagid for ticket or wiki
156
+** 12. Short comment to user for repeated tickets and wiki
154157
*/
155158
void www_print_timeline(
156159
Stmt *pQuery, /* Query to implement the timeline */
157160
int tmFlags, /* Flags controlling display behavior */
158161
void (*xExtra)(int) /* Routine to call on each line of display */
@@ -160,10 +163,12 @@
160163
int wikiFlags;
161164
int mxWikiLen;
162165
Blob comment;
163166
char zPrevDate[20];
164167
zPrevDate[0] = 0;
168
+ int prevTagid = 0;
169
+ int suppressCnt = 0;
165170
166171
mxWikiLen = db_get_int("timeline-max-comment", 0);
167172
if( db_get_boolean("timeline-block-markup", 0) ){
168173
wikiFlags = WIKI_INLINE;
169174
}else{
@@ -185,10 +190,29 @@
185190
const char *zBgClr = db_column_text(pQuery, 8);
186191
const char *zDate = db_column_text(pQuery, 2);
187192
const char *zType = db_column_text(pQuery, 9);
188193
const char *zUser = db_column_text(pQuery, 4);
189194
const char *zTagList = db_column_text(pQuery, 10);
195
+ int tagid = db_column_int(pQuery, 11);
196
+ int commentColumn = 3; /* Column containing comment text */
197
+ if( tagid ){
198
+ if( tagid==prevTagid ){
199
+ if( tmFlags & TIMELINE_BRIEF ){
200
+ suppressCnt++;
201
+ continue;
202
+ }else{
203
+ commentColumn = 12;
204
+ }
205
+ }
206
+ }
207
+ prevTagid = tagid;
208
+ if( suppressCnt ){
209
+ @ <tr><td><td><td>
210
+ @ ... preceded by %d(suppressCnt) other
211
+ @ similar event%s(suppressCnt>1?"s":"").</tr>
212
+ suppressCnt = 0;
213
+ }
190214
if( strcmp(zType,"div")==0 ){
191215
@ <tr><td colspan=3><hr></td></tr>
192216
continue;
193217
}
194218
db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid);
@@ -239,11 +263,11 @@
239263
}
240264
}
241265
}else if( (tmFlags & TIMELINE_ARTID)!=0 ){
242266
hyperlink_to_uuid(zUuid);
243267
}
244
- db_column_blob(pQuery, 3, &comment);
268
+ db_column_blob(pQuery, commentColumn, &comment);
245269
if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
246270
Blob truncated;
247271
blob_zero(&truncated);
248272
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
249273
blob_append(&truncated, "...", 3);
@@ -280,11 +304,13 @@
280304
@ nchild INTEGER,
281305
@ nparent INTEGER,
282306
@ isleaf BOOLEAN,
283307
@ bgcolor TEXT,
284308
@ etype TEXT,
285
- @ taglist TEXT
309
+ @ taglist TEXT,
310
+ @ tagid INTEGER,
311
+ @ short TEXT
286312
@ )
287313
;
288314
db_multi_exec(zSql);
289315
}
290316
@@ -311,11 +337,13 @@
311337
@ WHERE tagid=%d AND rid=plink.cid), 'trunk')),
312338
@ bgcolor,
313339
@ event.type,
314340
@ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
315341
@ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
316
- @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
342
+ @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0),
343
+ @ tagid,
344
+ @ brief
317345
@ FROM event JOIN blob
318346
@ WHERE blob.rid=event.objid
319347
;
320348
if( zBase==0 ){
321349
zBase = mprintf(zBaseSql, TAG_BRANCH, TAG_BRANCH);
@@ -393,19 +421,25 @@
393421
const char *zBefore = P("b"); /* Events before this time */
394422
const char *zCirca = P("c"); /* Events near this time */
395423
const char *zTagName = P("t"); /* Show events with this tag */
396424
HQuery url; /* URL for various branch links */
397425
int tagid; /* Tag ID */
426
+ int tmFlags; /* Timeline flags */
398427
399428
/* To view the timeline, must have permission to read project data.
400429
*/
401430
login_check_credentials();
402431
if( !g.okRead ){ login_needed(); return; }
403432
if( zTagName ){
404433
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
405434
}else{
406435
tagid = 0;
436
+ }
437
+ if( zType[0]=='a' ){
438
+ tmFlags = TIMELINE_BRIEF;
439
+ }else{
440
+ tmFlags = 0;
407441
}
408442
409443
style_header("Timeline");
410444
login_anonymous_available();
411445
timeline_temp_table();
@@ -597,11 +631,11 @@
597631
}
598632
blob_zero(&sql);
599633
db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");
600634
@ <h2>%b(&desc)</h2>
601635
blob_reset(&desc);
602
- www_print_timeline(&q, 0, 0);
636
+ www_print_timeline(&q, tmFlags, 0);
603637
db_finalize(&q);
604638
605639
@ <script>
606640
@ var parentof = new Object();
607641
@ var childof = new Object();
608642
--- src/timeline.c
+++ src/timeline.c
@@ -132,10 +132,11 @@
132 ** Allowed flags for the tmFlags argument to www_print_timeline
133 */
134 #if INTERFACE
135 #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
136 #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
 
137 #endif
138
139 /*
140 ** Output a timeline in the web format given a query. The query
141 ** should return these columns:
@@ -147,12 +148,14 @@
147 ** 4. User
148 ** 5. Number of non-merge children
149 ** 6. Number of parents
150 ** 7. True if is a leaf
151 ** 8. background color
152 ** 9. type ("ci", "w")
153 ** 10. list of symbolic tags.
 
 
154 */
155 void www_print_timeline(
156 Stmt *pQuery, /* Query to implement the timeline */
157 int tmFlags, /* Flags controlling display behavior */
158 void (*xExtra)(int) /* Routine to call on each line of display */
@@ -160,10 +163,12 @@
160 int wikiFlags;
161 int mxWikiLen;
162 Blob comment;
163 char zPrevDate[20];
164 zPrevDate[0] = 0;
 
 
165
166 mxWikiLen = db_get_int("timeline-max-comment", 0);
167 if( db_get_boolean("timeline-block-markup", 0) ){
168 wikiFlags = WIKI_INLINE;
169 }else{
@@ -185,10 +190,29 @@
185 const char *zBgClr = db_column_text(pQuery, 8);
186 const char *zDate = db_column_text(pQuery, 2);
187 const char *zType = db_column_text(pQuery, 9);
188 const char *zUser = db_column_text(pQuery, 4);
189 const char *zTagList = db_column_text(pQuery, 10);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190 if( strcmp(zType,"div")==0 ){
191 @ <tr><td colspan=3><hr></td></tr>
192 continue;
193 }
194 db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid);
@@ -239,11 +263,11 @@
239 }
240 }
241 }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
242 hyperlink_to_uuid(zUuid);
243 }
244 db_column_blob(pQuery, 3, &comment);
245 if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
246 Blob truncated;
247 blob_zero(&truncated);
248 blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
249 blob_append(&truncated, "...", 3);
@@ -280,11 +304,13 @@
280 @ nchild INTEGER,
281 @ nparent INTEGER,
282 @ isleaf BOOLEAN,
283 @ bgcolor TEXT,
284 @ etype TEXT,
285 @ taglist TEXT
 
 
286 @ )
287 ;
288 db_multi_exec(zSql);
289 }
290
@@ -311,11 +337,13 @@
311 @ WHERE tagid=%d AND rid=plink.cid), 'trunk')),
312 @ bgcolor,
313 @ event.type,
314 @ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
315 @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
316 @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
 
 
317 @ FROM event JOIN blob
318 @ WHERE blob.rid=event.objid
319 ;
320 if( zBase==0 ){
321 zBase = mprintf(zBaseSql, TAG_BRANCH, TAG_BRANCH);
@@ -393,19 +421,25 @@
393 const char *zBefore = P("b"); /* Events before this time */
394 const char *zCirca = P("c"); /* Events near this time */
395 const char *zTagName = P("t"); /* Show events with this tag */
396 HQuery url; /* URL for various branch links */
397 int tagid; /* Tag ID */
 
398
399 /* To view the timeline, must have permission to read project data.
400 */
401 login_check_credentials();
402 if( !g.okRead ){ login_needed(); return; }
403 if( zTagName ){
404 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
405 }else{
406 tagid = 0;
 
 
 
 
 
407 }
408
409 style_header("Timeline");
410 login_anonymous_available();
411 timeline_temp_table();
@@ -597,11 +631,11 @@
597 }
598 blob_zero(&sql);
599 db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");
600 @ <h2>%b(&desc)</h2>
601 blob_reset(&desc);
602 www_print_timeline(&q, 0, 0);
603 db_finalize(&q);
604
605 @ <script>
606 @ var parentof = new Object();
607 @ var childof = new Object();
608
--- src/timeline.c
+++ src/timeline.c
@@ -132,10 +132,11 @@
132 ** Allowed flags for the tmFlags argument to www_print_timeline
133 */
134 #if INTERFACE
135 #define TIMELINE_ARTID 0x0001 /* Show artifact IDs on non-check-in lines */
136 #define TIMELINE_LEAFONLY 0x0002 /* Show "Leaf", but not "Merge", "Fork" etc */
137 #define TIMELINE_BRIEF 0x0004 /* Combine adjacent elements of same object */
138 #endif
139
140 /*
141 ** Output a timeline in the web format given a query. The query
142 ** should return these columns:
@@ -147,12 +148,14 @@
148 ** 4. User
149 ** 5. Number of non-merge children
150 ** 6. Number of parents
151 ** 7. True if is a leaf
152 ** 8. background color
153 ** 9. type ("ci", "w", "t")
154 ** 10. list of symbolic tags.
155 ** 11. tagid for ticket or wiki
156 ** 12. Short comment to user for repeated tickets and wiki
157 */
158 void www_print_timeline(
159 Stmt *pQuery, /* Query to implement the timeline */
160 int tmFlags, /* Flags controlling display behavior */
161 void (*xExtra)(int) /* Routine to call on each line of display */
@@ -160,10 +163,12 @@
163 int wikiFlags;
164 int mxWikiLen;
165 Blob comment;
166 char zPrevDate[20];
167 zPrevDate[0] = 0;
168 int prevTagid = 0;
169 int suppressCnt = 0;
170
171 mxWikiLen = db_get_int("timeline-max-comment", 0);
172 if( db_get_boolean("timeline-block-markup", 0) ){
173 wikiFlags = WIKI_INLINE;
174 }else{
@@ -185,10 +190,29 @@
190 const char *zBgClr = db_column_text(pQuery, 8);
191 const char *zDate = db_column_text(pQuery, 2);
192 const char *zType = db_column_text(pQuery, 9);
193 const char *zUser = db_column_text(pQuery, 4);
194 const char *zTagList = db_column_text(pQuery, 10);
195 int tagid = db_column_int(pQuery, 11);
196 int commentColumn = 3; /* Column containing comment text */
197 if( tagid ){
198 if( tagid==prevTagid ){
199 if( tmFlags & TIMELINE_BRIEF ){
200 suppressCnt++;
201 continue;
202 }else{
203 commentColumn = 12;
204 }
205 }
206 }
207 prevTagid = tagid;
208 if( suppressCnt ){
209 @ <tr><td><td><td>
210 @ ... preceded by %d(suppressCnt) other
211 @ similar event%s(suppressCnt>1?"s":"").</tr>
212 suppressCnt = 0;
213 }
214 if( strcmp(zType,"div")==0 ){
215 @ <tr><td colspan=3><hr></td></tr>
216 continue;
217 }
218 db_multi_exec("INSERT OR IGNORE INTO seen VALUES(%d)", rid);
@@ -239,11 +263,11 @@
263 }
264 }
265 }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
266 hyperlink_to_uuid(zUuid);
267 }
268 db_column_blob(pQuery, commentColumn, &comment);
269 if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
270 Blob truncated;
271 blob_zero(&truncated);
272 blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
273 blob_append(&truncated, "...", 3);
@@ -280,11 +304,13 @@
304 @ nchild INTEGER,
305 @ nparent INTEGER,
306 @ isleaf BOOLEAN,
307 @ bgcolor TEXT,
308 @ etype TEXT,
309 @ taglist TEXT,
310 @ tagid INTEGER,
311 @ short TEXT
312 @ )
313 ;
314 db_multi_exec(zSql);
315 }
316
@@ -311,11 +337,13 @@
337 @ WHERE tagid=%d AND rid=plink.cid), 'trunk')),
338 @ bgcolor,
339 @ event.type,
340 @ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
341 @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
342 @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0),
343 @ tagid,
344 @ brief
345 @ FROM event JOIN blob
346 @ WHERE blob.rid=event.objid
347 ;
348 if( zBase==0 ){
349 zBase = mprintf(zBaseSql, TAG_BRANCH, TAG_BRANCH);
@@ -393,19 +421,25 @@
421 const char *zBefore = P("b"); /* Events before this time */
422 const char *zCirca = P("c"); /* Events near this time */
423 const char *zTagName = P("t"); /* Show events with this tag */
424 HQuery url; /* URL for various branch links */
425 int tagid; /* Tag ID */
426 int tmFlags; /* Timeline flags */
427
428 /* To view the timeline, must have permission to read project data.
429 */
430 login_check_credentials();
431 if( !g.okRead ){ login_needed(); return; }
432 if( zTagName ){
433 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
434 }else{
435 tagid = 0;
436 }
437 if( zType[0]=='a' ){
438 tmFlags = TIMELINE_BRIEF;
439 }else{
440 tmFlags = 0;
441 }
442
443 style_header("Timeline");
444 login_anonymous_available();
445 timeline_temp_table();
@@ -597,11 +631,11 @@
631 }
632 blob_zero(&sql);
633 db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC");
634 @ <h2>%b(&desc)</h2>
635 blob_reset(&desc);
636 www_print_timeline(&q, tmFlags, 0);
637 db_finalize(&q);
638
639 @ <script>
640 @ var parentof = new Object();
641 @ var childof = new Object();
642
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -264,11 +264,11 @@
264264
while( db_step(&q)==SQLITE_ROW ){
265265
int rid = db_column_int(&q, 0);
266266
content_get(rid, &content);
267267
manifest_parse(&manifest, &content);
268268
ticket_insert(&manifest, createFlag, 0);
269
- manifest_ticket_event(rid, &manifest, createFlag);
269
+ manifest_ticket_event(rid, &manifest, createFlag, tagid);
270270
manifest_clear(&manifest);
271271
createFlag = 0;
272272
}
273273
db_finalize(&q);
274274
}
275275
--- src/tkt.c
+++ src/tkt.c
@@ -264,11 +264,11 @@
264 while( db_step(&q)==SQLITE_ROW ){
265 int rid = db_column_int(&q, 0);
266 content_get(rid, &content);
267 manifest_parse(&manifest, &content);
268 ticket_insert(&manifest, createFlag, 0);
269 manifest_ticket_event(rid, &manifest, createFlag);
270 manifest_clear(&manifest);
271 createFlag = 0;
272 }
273 db_finalize(&q);
274 }
275
--- src/tkt.c
+++ src/tkt.c
@@ -264,11 +264,11 @@
264 while( db_step(&q)==SQLITE_ROW ){
265 int rid = db_column_int(&q, 0);
266 content_get(rid, &content);
267 manifest_parse(&manifest, &content);
268 ticket_insert(&manifest, createFlag, 0);
269 manifest_ticket_event(rid, &manifest, createFlag, tagid);
270 manifest_clear(&manifest);
271 createFlag = 0;
272 }
273 db_finalize(&q);
274 }
275

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button