| | @@ -192,10 +192,11 @@ |
| 192 | 192 | const char *zThisUser, /* Suppress links to this user */ |
| 193 | 193 | const char *zThisTag, /* Suppress links to this tag */ |
| 194 | 194 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 195 | 195 | ){ |
| 196 | 196 | int wikiFlags; |
| 197 | + int plainText; |
| 197 | 198 | int mxWikiLen; |
| 198 | 199 | Blob comment; |
| 199 | 200 | int prevTagid = 0; |
| 200 | 201 | int suppressCnt = 0; |
| 201 | 202 | char zPrevDate[20]; |
| | @@ -205,10 +206,11 @@ |
| 205 | 206 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 206 | 207 | static Stmt qbranch; |
| 207 | 208 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 208 | 209 | |
| 209 | 210 | zPrevDate[0] = 0; |
| 211 | + plainText = db_get_int("timeline-plaintext", 0); |
| 210 | 212 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 211 | 213 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 212 | 214 | wikiFlags = WIKI_INLINE; |
| 213 | 215 | }else{ |
| 214 | 216 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; |
| | @@ -285,11 +287,11 @@ |
| 285 | 287 | @ <td class="timelineGraph"> |
| 286 | 288 | if( tmFlags & TIMELINE_UCOLOR ) zBgClr = zUser ? hash_color(zUser) : 0; |
| 287 | 289 | if( zType[0]=='c' |
| 288 | 290 | && (pGraph || zBgClr==0 || (tmFlags & TIMELINE_BRCOLOR)!=0) |
| 289 | 291 | ){ |
| 290 | | - db_reset(&qbranch); |
| 292 | + db_reset(&qbranch); |
| 291 | 293 | db_bind_int(&qbranch, ":rid", rid); |
| 292 | 294 | if( db_step(&qbranch)==SQLITE_ROW ){ |
| 293 | 295 | zBr = db_column_text(&qbranch, 0); |
| 294 | 296 | }else{ |
| 295 | 297 | zBr = "trunk"; |
| | @@ -353,12 +355,18 @@ |
| 353 | 355 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 354 | 356 | Blob truncated; |
| 355 | 357 | blob_zero(&truncated); |
| 356 | 358 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 357 | 359 | blob_append(&truncated, "...", 3); |
| 358 | | - wiki_convert(&truncated, 0, wikiFlags); |
| 360 | + if( plainText ){ |
| 361 | + @ %h(blob_str(&truncated)) |
| 362 | + }else{ |
| 363 | + wiki_convert(&truncated, 0, wikiFlags); |
| 364 | + } |
| 359 | 365 | blob_reset(&truncated); |
| 366 | + }else if( plainText ){ |
| 367 | + @ %h(blob_str(&comment)); |
| 360 | 368 | }else{ |
| 361 | 369 | wiki_convert(&comment, 0, wikiFlags); |
| 362 | 370 | } |
| 363 | 371 | blob_reset(&comment); |
| 364 | 372 | |
| | @@ -365,11 +373,11 @@ |
| 365 | 373 | /* Generate the "user: USERNAME" at the end of the comment, together |
| 366 | 374 | ** with a hyperlink to another timeline for that user. |
| 367 | 375 | */ |
| 368 | 376 | if( zTagList && zTagList[0]==0 ) zTagList = 0; |
| 369 | 377 | if( g.perm.Hyperlink && fossil_strcmp(zUser, zThisUser)!=0 ){ |
| 370 | | - char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd", zUser, zDate); |
| 378 | + char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd", zUser, zDate); |
| 371 | 379 | @ (user: %z(href("%z",zLink))%h(zUser)</a>%s(zTagList?",":"\051") |
| 372 | 380 | }else{ |
| 373 | 381 | @ (user: %h(zUser)%s(zTagList?",":"\051") |
| 374 | 382 | } |
| 375 | 383 | |
| | @@ -390,11 +398,11 @@ |
| 390 | 398 | while( z && z[0] ){ |
| 391 | 399 | for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){} |
| 392 | 400 | if( zThisTag==0 || memcmp(z, zThisTag, i)!=0 || zThisTag[i]!=0 ){ |
| 393 | 401 | blob_appendf(&links, |
| 394 | 402 | "%z%#h</a>%.2s", |
| 395 | | - href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i] |
| 403 | + href("%R/timeline?r=%#t&nd&c=%t",i,z,zDate), i,z, &z[i] |
| 396 | 404 | ); |
| 397 | 405 | }else{ |
| 398 | 406 | blob_appendf(&links, "%#h", i+2, z); |
| 399 | 407 | } |
| 400 | 408 | if( z[i]==0 ) break; |
| | @@ -415,11 +423,11 @@ |
| 415 | 423 | |
| 416 | 424 | /* Generate the file-change list if requested */ |
| 417 | 425 | if( (tmFlags & TIMELINE_FCHANGES)!=0 && zType[0]=='c' && g.perm.Hyperlink ){ |
| 418 | 426 | int inUl = 0; |
| 419 | 427 | if( !fchngQueryInit ){ |
| 420 | | - db_prepare(&fchngQuery, |
| 428 | + db_prepare(&fchngQuery, |
| 421 | 429 | "SELECT (pid==0) AS isnew," |
| 422 | 430 | " (fid==0) AS isdel," |
| 423 | 431 | " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name," |
| 424 | 432 | " (SELECT uuid FROM blob WHERE rid=fid)," |
| 425 | 433 | " (SELECT uuid FROM blob WHERE rid=pid)," |
| | @@ -484,11 +492,11 @@ |
| 484 | 492 | pGraph = 0; |
| 485 | 493 | }else{ |
| 486 | 494 | /* style is not moved to css, because this is |
| 487 | 495 | ** a technical div for the timeline graph |
| 488 | 496 | */ |
| 489 | | - @ <tr><td /><td> |
| 497 | + @ <tr><td></td><td> |
| 490 | 498 | @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 491 | 499 | @ </td></tr> |
| 492 | 500 | } |
| 493 | 501 | } |
| 494 | 502 | @ </table> |
| | @@ -653,11 +661,11 @@ |
| 653 | 661 | @ if( p.u>0 ) drawUpArrow(p.x, rowinfo[p.u-1].y+6, p.y-5); |
| 654 | 662 | if( !omitDescenders ){ |
| 655 | 663 | @ if( p.u==0 ) drawUpArrow(p.x, 0, p.y-5); |
| 656 | 664 | @ if( p.f&1 ) drawBox("black",p.x-1,p.y-1,p.x+2,p.y+2); |
| 657 | 665 | @ if( p.d ) drawUpArrow(p.x, p.y+6, btm); |
| 658 | | - } |
| 666 | + } |
| 659 | 667 | @ if( p.mo>0 ){ |
| 660 | 668 | @ var x1 = p.mo + left - 1; |
| 661 | 669 | @ var y1 = p.y-3; |
| 662 | 670 | @ var x0 = x1>p.x ? p.x+7 : p.x-6; |
| 663 | 671 | @ var u = rowinfo[p.mu-1]; |
| | @@ -758,11 +766,11 @@ |
| 758 | 766 | |
| 759 | 767 | /* |
| 760 | 768 | ** Create a temporary table suitable for storing timeline data. |
| 761 | 769 | */ |
| 762 | 770 | static void timeline_temp_table(void){ |
| 763 | | - static const char zSql[] = |
| 771 | + static const char zSql[] = |
| 764 | 772 | @ CREATE TEMP TABLE IF NOT EXISTS timeline( |
| 765 | 773 | @ rid INTEGER PRIMARY KEY, |
| 766 | 774 | @ uuid TEXT, |
| 767 | 775 | @ timestamp TEXT, |
| 768 | 776 | @ comment TEXT, |
| | @@ -799,11 +807,11 @@ |
| 799 | 807 | @ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid |
| 800 | 808 | @ AND tagxref.rid=blob.rid AND tagxref.tagtype>0) AS tags, |
| 801 | 809 | @ tagid AS tagid, |
| 802 | 810 | @ brief AS brief, |
| 803 | 811 | @ event.mtime AS mtime |
| 804 | | - @ FROM event CROSS JOIN blob |
| 812 | + @ FROM event CROSS JOIN blob |
| 805 | 813 | @ WHERE blob.rid=event.objid |
| 806 | 814 | ; |
| 807 | 815 | if( zBase==0 ){ |
| 808 | 816 | zBase = mprintf(zBaseSql, TAG_BRANCH, TAG_BRANCH); |
| 809 | 817 | } |
| | @@ -1167,24 +1175,24 @@ |
| 1167 | 1175 | rBefore = symbolic_name_to_mtime(zBefore); |
| 1168 | 1176 | rAfter = symbolic_name_to_mtime(zAfter); |
| 1169 | 1177 | rCirca = symbolic_name_to_mtime(zCirca); |
| 1170 | 1178 | if( rAfter>0.0 ){ |
| 1171 | 1179 | if( rBefore>0.0 ){ |
| 1172 | | - blob_appendf(&sql, |
| 1180 | + blob_appendf(&sql, |
| 1173 | 1181 | " AND event.mtime>=%.17g AND event.mtime<=%.17g" |
| 1174 | 1182 | " ORDER BY event.mtime ASC", rAfter-ONE_SECOND, rBefore+ONE_SECOND); |
| 1175 | 1183 | url_add_parameter(&url, "a", zAfter); |
| 1176 | 1184 | url_add_parameter(&url, "b", zBefore); |
| 1177 | 1185 | nEntry = 1000000; |
| 1178 | 1186 | }else{ |
| 1179 | | - blob_appendf(&sql, |
| 1187 | + blob_appendf(&sql, |
| 1180 | 1188 | " AND event.mtime>=%.17g ORDER BY event.mtime ASC", |
| 1181 | 1189 | rAfter-ONE_SECOND); |
| 1182 | 1190 | url_add_parameter(&url, "a", zAfter); |
| 1183 | 1191 | } |
| 1184 | 1192 | }else if( rBefore>0.0 ){ |
| 1185 | | - blob_appendf(&sql, |
| 1193 | + blob_appendf(&sql, |
| 1186 | 1194 | " AND event.mtime<=%.17g ORDER BY event.mtime DESC", |
| 1187 | 1195 | rBefore+ONE_SECOND); |
| 1188 | 1196 | url_add_parameter(&url, "b", zBefore); |
| 1189 | 1197 | }else if( rCirca>0.0 ){ |
| 1190 | 1198 | Blob sql2; |
| | @@ -1300,11 +1308,11 @@ |
| 1300 | 1308 | /* |
| 1301 | 1309 | ** The input query q selects various records. Print a human-readable |
| 1302 | 1310 | ** summary of those records. |
| 1303 | 1311 | ** |
| 1304 | 1312 | ** Limit the number of entries printed to nLine. |
| 1305 | | -** |
| 1313 | +** |
| 1306 | 1314 | ** The query should return these columns: |
| 1307 | 1315 | ** |
| 1308 | 1316 | ** 0. rid |
| 1309 | 1317 | ** 1. uuid |
| 1310 | 1318 | ** 2. Date/Time |
| | @@ -1334,11 +1342,11 @@ |
| 1334 | 1342 | int nParent = db_column_int(q, 5); |
| 1335 | 1343 | char *zFree = 0; |
| 1336 | 1344 | int n = 0; |
| 1337 | 1345 | char zPrefix[80]; |
| 1338 | 1346 | char zUuid[UUID_SIZE+1]; |
| 1339 | | - |
| 1347 | + |
| 1340 | 1348 | sqlite3_snprintf(sizeof(zUuid), zUuid, "%.10s", zId); |
| 1341 | 1349 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 1342 | 1350 | fossil_print("=== %.10s ===\n", zDate); |
| 1343 | 1351 | memcpy(zPrevDate, zDate, 10); |
| 1344 | 1352 | nLine++; |
| | @@ -1368,11 +1376,11 @@ |
| 1368 | 1376 | nLine += comment_print(zFree, 9, 79); |
| 1369 | 1377 | sqlite3_free(zFree); |
| 1370 | 1378 | |
| 1371 | 1379 | if(showfiles){ |
| 1372 | 1380 | if( !fchngQueryInit ){ |
| 1373 | | - db_prepare(&fchngQuery, |
| 1381 | + db_prepare(&fchngQuery, |
| 1374 | 1382 | "SELECT (pid==0) AS isnew," |
| 1375 | 1383 | " (fid==0) AS isdel," |
| 1376 | 1384 | " (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name," |
| 1377 | 1385 | " (SELECT uuid FROM blob WHERE rid=fid)," |
| 1378 | 1386 | " (SELECT uuid FROM blob WHERE rid=pid)" |
| | @@ -1385,11 +1393,11 @@ |
| 1385 | 1393 | db_bind_int(&fchngQuery, ":mid", rid); |
| 1386 | 1394 | while( db_step(&fchngQuery)==SQLITE_ROW ){ |
| 1387 | 1395 | const char *zFilename = db_column_text(&fchngQuery, 2); |
| 1388 | 1396 | int isNew = db_column_int(&fchngQuery, 0); |
| 1389 | 1397 | int isDel = db_column_int(&fchngQuery, 1); |
| 1390 | | - if( isNew ){ |
| 1398 | + if( isNew ){ |
| 1391 | 1399 | fossil_print(" ADDED %s\n",zFilename); |
| 1392 | 1400 | }else if( isDel ){ |
| 1393 | 1401 | fossil_print(" DELETED %s\n",zFilename); |
| 1394 | 1402 | }else{ |
| 1395 | 1403 | fossil_print(" EDITED %s\n", zFilename); |
| | @@ -1404,11 +1412,11 @@ |
| 1404 | 1412 | /* |
| 1405 | 1413 | ** Return a pointer to a static string that forms the basis for |
| 1406 | 1414 | ** a timeline query for display on a TTY. |
| 1407 | 1415 | */ |
| 1408 | 1416 | const char *timeline_query_for_tty(void){ |
| 1409 | | - static const char zBaseSql[] = |
| 1417 | + static const char zBaseSql[] = |
| 1410 | 1418 | @ SELECT |
| 1411 | 1419 | @ blob.rid AS rid, |
| 1412 | 1420 | @ uuid, |
| 1413 | 1421 | @ datetime(event.mtime,'localtime') AS mDateTime, |
| 1414 | 1422 | @ coalesce(ecomment,comment) |
| 1415 | 1423 | |