Fossil SCM

Refinements to the timeline for giving better information about wiki pages.

drh 2007-10-09 02:35 trunk
Commit dfea940da850d6844c2b13f2b4515e4463773230
2 files changed +107 -16 +47 -12
+107 -16
--- src/info.c
+++ src/info.c
@@ -373,10 +373,70 @@
373373
showDescendents(rid, 2, "Descendents");
374374
showLeaves();
375375
showAncestors(rid, 2, "Ancestors");
376376
style_footer();
377377
}
378
+
379
+/*
380
+** WEBPAGE: winfo
381
+**
382
+** Return information about a wiki page. The version number is contained
383
+** in g.zExtra.
384
+*/
385
+void winfo_page(void){
386
+ Stmt q;
387
+ int rid;
388
+
389
+ login_check_credentials();
390
+ if( !g.okHistory ){ login_needed(); return; }
391
+ rid = name_to_rid(g.zExtra);
392
+ if( rid==0 ){
393
+ style_header("Wiki Page Information Error");
394
+ @ No such object: %h(g.argv[2])
395
+ style_footer();
396
+ return;
397
+ }
398
+ db_prepare(&q,
399
+ "SELECT substr(tagname, 6, 1000), uuid,"
400
+ " datetime(event.mtime, 'localtime'), user"
401
+ " FROM tagxref, tag, blob, event"
402
+ " WHERE tagxref.rid=%d"
403
+ " AND tag.tagid=tagxref.tagid"
404
+ " AND tag.tagname LIKE 'wiki-%%'"
405
+ " AND blob.rid=%d"
406
+ " AND event.objid=%d",
407
+ rid, rid, rid
408
+ );
409
+ if( db_step(&q)==SQLITE_ROW ){
410
+ const char *zName = db_column_text(&q, 0);
411
+ const char *zUuid = db_column_text(&q, 1);
412
+ char *zTitle = mprintf("Wiki Page %s", zName);
413
+ style_header(zTitle);
414
+ free(zTitle);
415
+ @ <div class="section-title">Overview</div>
416
+ @ <p><table class="label-value">
417
+ @ <tr><th>Version:</th><td>%s(zUuid)</td></tr>
418
+ @ <tr><th>Date:</th><td>%s(db_column_text(&q, 2))</td></tr>
419
+ if( g.okSetup ){
420
+ @ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
421
+ }
422
+ @ <tr><th>Original&nbsp;User:</th><td>%s(db_column_text(&q, 3))</td></tr>
423
+ @ <tr><th>Commands:</th>
424
+ @ <td>
425
+/* @ <a href="%s(g.zBaseURL)/wdiff/%d(rid)">diff</a> | */
426
+ @ <a href="%s(g.zBaseURL)/wlist/%t(zName)">history</a>
427
+ @ | <a href="%s(g.zBaseURL)/fview/%d(rid)">raw-text</a>
428
+ @ </td>
429
+ @ </tr>
430
+ @ </table></p>
431
+ }else{
432
+ style_header("Wiki Information");
433
+ }
434
+ db_finalize(&q);
435
+ showTags(rid);
436
+ style_footer();
437
+}
378438
379439
/*
380440
** WEBPAGE: finfo
381441
**
382442
** Show the complete change history for a single file. The name
@@ -515,10 +575,11 @@
515575
** * Comment & user
516576
*/
517577
static void object_description(int rid, int linkToView){
518578
Stmt q;
519579
int cnt = 0;
580
+ int nWiki = 0;
520581
db_prepare(&q,
521582
"SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
522583
" coalesce(event.comment,event.ecomment),"
523584
" coalesce(event.euser,event.user),"
524585
" b.uuid"
@@ -542,28 +603,52 @@
542603
hyperlink_to_uuid(zVers);
543604
@ %s(zCom) by %s(zUser) on %s(zDate).
544605
cnt++;
545606
}
546607
db_finalize(&q);
547
- db_prepare(&q,
548
- "SELECT datetime(mtime), user, comment, uuid"
549
- " FROM event, blob"
550
- " WHERE event.objid=%d"
551
- " AND blob.rid=%d",
552
- rid, rid
608
+ db_prepare(&q,
609
+ "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
610
+ " coalesce(event.euser, event.user), uuid"
611
+ " FROM tagxref, tag, event, blob"
612
+ " WHERE tagxref.rid=%d"
613
+ " AND tag.tagid=tagxref.tagid"
614
+ " AND tag.tagname LIKE 'wiki-%%'"
615
+ " AND event.objid=tagxref.rid"
616
+ " AND blob.rid=tagxref.rid",
617
+ rid
553618
);
554619
while( db_step(&q)==SQLITE_ROW ){
555
- const char *zDate = db_column_text(&q, 0);
620
+ const char *zPagename = db_column_text(&q, 0);
621
+ const char *zDate = db_column_text(&q, 1);
622
+ const char *zUser = db_column_text(&q, 2);
556623
const char *zUuid = db_column_text(&q, 3);
557
- const char *zCom = db_column_text(&q, 2);
558
- const char *zUser = db_column_text(&q, 1);
559
- @ Manifest of version
560
- hyperlink_to_uuid(zUuid);
561
- @ %s(zCom) by %s(zUser) on %s(zDate).
624
+ @ Wiki page [<a href="%s(g.zBaseURL)/wiki/%t(zPagename)">%h(zPagename)</a>]
625
+ @ uuid %s(zUuid) by %h(zUser) on %s(zDate)
626
+ nWiki++;
562627
cnt++;
563628
}
564629
db_finalize(&q);
630
+ if( nWiki==0 ){
631
+ db_prepare(&q,
632
+ "SELECT datetime(mtime), user, comment, uuid"
633
+ " FROM event, blob"
634
+ " WHERE event.objid=%d"
635
+ " AND blob.rid=%d",
636
+ rid, rid
637
+ );
638
+ while( db_step(&q)==SQLITE_ROW ){
639
+ const char *zDate = db_column_text(&q, 0);
640
+ const char *zUuid = db_column_text(&q, 3);
641
+ const char *zCom = db_column_text(&q, 2);
642
+ const char *zUser = db_column_text(&q, 1);
643
+ @ Manifest of version
644
+ hyperlink_to_uuid(zUuid);
645
+ @ %s(zCom) by %s(zUser) on %s(zDate).
646
+ cnt++;
647
+ }
648
+ db_finalize(&q);
649
+ }
565650
if( cnt==0 ){
566651
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
567652
@ Control file %s(zUuid).
568653
}else if( linkToView ){
569654
@ <a href="%s(g.zBaseURL)/fview/%d(rid)">[view]</a>
@@ -619,14 +704,20 @@
619704
Blob content;
620705
621706
rid = name_to_rid(g.zExtra);
622707
login_check_credentials();
623708
if( !g.okHistory ){ login_needed(); return; }
624
- if( g.zPath[0]=='i' &&
625
- db_exists("SELECT 1 FROM plink WHERE cid=%d", rid) ){
626
- vinfo_page();
627
- return;
709
+ if( g.zPath[0]=='i' ){
710
+ if( db_exists("SELECT 1 FROM tagxref JOIN tag USING(tagid)"
711
+ " WHERE rid=%d AND tagname LIKE 'wiki-%%'", rid) ){
712
+ winfo_page();
713
+ return;
714
+ }
715
+ if( db_exists("SELECT 1 FROM plink WHERE cid=%d", rid) ){
716
+ vinfo_page();
717
+ return;
718
+ }
628719
}
629720
style_header("File Content");
630721
@ <h2>Content Of:</h2>
631722
@ <blockquote>
632723
object_description(rid, 0);
633724
--- src/info.c
+++ src/info.c
@@ -373,10 +373,70 @@
373 showDescendents(rid, 2, "Descendents");
374 showLeaves();
375 showAncestors(rid, 2, "Ancestors");
376 style_footer();
377 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
379 /*
380 ** WEBPAGE: finfo
381 **
382 ** Show the complete change history for a single file. The name
@@ -515,10 +575,11 @@
515 ** * Comment & user
516 */
517 static void object_description(int rid, int linkToView){
518 Stmt q;
519 int cnt = 0;
 
520 db_prepare(&q,
521 "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
522 " coalesce(event.comment,event.ecomment),"
523 " coalesce(event.euser,event.user),"
524 " b.uuid"
@@ -542,28 +603,52 @@
542 hyperlink_to_uuid(zVers);
543 @ %s(zCom) by %s(zUser) on %s(zDate).
544 cnt++;
545 }
546 db_finalize(&q);
547 db_prepare(&q,
548 "SELECT datetime(mtime), user, comment, uuid"
549 " FROM event, blob"
550 " WHERE event.objid=%d"
551 " AND blob.rid=%d",
552 rid, rid
 
 
 
 
553 );
554 while( db_step(&q)==SQLITE_ROW ){
555 const char *zDate = db_column_text(&q, 0);
 
 
556 const char *zUuid = db_column_text(&q, 3);
557 const char *zCom = db_column_text(&q, 2);
558 const char *zUser = db_column_text(&q, 1);
559 @ Manifest of version
560 hyperlink_to_uuid(zUuid);
561 @ %s(zCom) by %s(zUser) on %s(zDate).
562 cnt++;
563 }
564 db_finalize(&q);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565 if( cnt==0 ){
566 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
567 @ Control file %s(zUuid).
568 }else if( linkToView ){
569 @ <a href="%s(g.zBaseURL)/fview/%d(rid)">[view]</a>
@@ -619,14 +704,20 @@
619 Blob content;
620
621 rid = name_to_rid(g.zExtra);
622 login_check_credentials();
623 if( !g.okHistory ){ login_needed(); return; }
624 if( g.zPath[0]=='i' &&
625 db_exists("SELECT 1 FROM plink WHERE cid=%d", rid) ){
626 vinfo_page();
627 return;
 
 
 
 
 
 
628 }
629 style_header("File Content");
630 @ <h2>Content Of:</h2>
631 @ <blockquote>
632 object_description(rid, 0);
633
--- src/info.c
+++ src/info.c
@@ -373,10 +373,70 @@
373 showDescendents(rid, 2, "Descendents");
374 showLeaves();
375 showAncestors(rid, 2, "Ancestors");
376 style_footer();
377 }
378
379 /*
380 ** WEBPAGE: winfo
381 **
382 ** Return information about a wiki page. The version number is contained
383 ** in g.zExtra.
384 */
385 void winfo_page(void){
386 Stmt q;
387 int rid;
388
389 login_check_credentials();
390 if( !g.okHistory ){ login_needed(); return; }
391 rid = name_to_rid(g.zExtra);
392 if( rid==0 ){
393 style_header("Wiki Page Information Error");
394 @ No such object: %h(g.argv[2])
395 style_footer();
396 return;
397 }
398 db_prepare(&q,
399 "SELECT substr(tagname, 6, 1000), uuid,"
400 " datetime(event.mtime, 'localtime'), user"
401 " FROM tagxref, tag, blob, event"
402 " WHERE tagxref.rid=%d"
403 " AND tag.tagid=tagxref.tagid"
404 " AND tag.tagname LIKE 'wiki-%%'"
405 " AND blob.rid=%d"
406 " AND event.objid=%d",
407 rid, rid, rid
408 );
409 if( db_step(&q)==SQLITE_ROW ){
410 const char *zName = db_column_text(&q, 0);
411 const char *zUuid = db_column_text(&q, 1);
412 char *zTitle = mprintf("Wiki Page %s", zName);
413 style_header(zTitle);
414 free(zTitle);
415 @ <div class="section-title">Overview</div>
416 @ <p><table class="label-value">
417 @ <tr><th>Version:</th><td>%s(zUuid)</td></tr>
418 @ <tr><th>Date:</th><td>%s(db_column_text(&q, 2))</td></tr>
419 if( g.okSetup ){
420 @ <tr><th>Record ID:</th><td>%d(rid)</td></tr>
421 }
422 @ <tr><th>Original&nbsp;User:</th><td>%s(db_column_text(&q, 3))</td></tr>
423 @ <tr><th>Commands:</th>
424 @ <td>
425 /* @ <a href="%s(g.zBaseURL)/wdiff/%d(rid)">diff</a> | */
426 @ <a href="%s(g.zBaseURL)/wlist/%t(zName)">history</a>
427 @ | <a href="%s(g.zBaseURL)/fview/%d(rid)">raw-text</a>
428 @ </td>
429 @ </tr>
430 @ </table></p>
431 }else{
432 style_header("Wiki Information");
433 }
434 db_finalize(&q);
435 showTags(rid);
436 style_footer();
437 }
438
439 /*
440 ** WEBPAGE: finfo
441 **
442 ** Show the complete change history for a single file. The name
@@ -515,10 +575,11 @@
575 ** * Comment & user
576 */
577 static void object_description(int rid, int linkToView){
578 Stmt q;
579 int cnt = 0;
580 int nWiki = 0;
581 db_prepare(&q,
582 "SELECT filename.name, datetime(event.mtime), substr(a.uuid,1,10),"
583 " coalesce(event.comment,event.ecomment),"
584 " coalesce(event.euser,event.user),"
585 " b.uuid"
@@ -542,28 +603,52 @@
603 hyperlink_to_uuid(zVers);
604 @ %s(zCom) by %s(zUser) on %s(zDate).
605 cnt++;
606 }
607 db_finalize(&q);
608 db_prepare(&q,
609 "SELECT substr(tagname, 6, 10000), datetime(event.mtime),"
610 " coalesce(event.euser, event.user), uuid"
611 " FROM tagxref, tag, event, blob"
612 " WHERE tagxref.rid=%d"
613 " AND tag.tagid=tagxref.tagid"
614 " AND tag.tagname LIKE 'wiki-%%'"
615 " AND event.objid=tagxref.rid"
616 " AND blob.rid=tagxref.rid",
617 rid
618 );
619 while( db_step(&q)==SQLITE_ROW ){
620 const char *zPagename = db_column_text(&q, 0);
621 const char *zDate = db_column_text(&q, 1);
622 const char *zUser = db_column_text(&q, 2);
623 const char *zUuid = db_column_text(&q, 3);
624 @ Wiki page [<a href="%s(g.zBaseURL)/wiki/%t(zPagename)">%h(zPagename)</a>]
625 @ uuid %s(zUuid) by %h(zUser) on %s(zDate)
626 nWiki++;
 
 
627 cnt++;
628 }
629 db_finalize(&q);
630 if( nWiki==0 ){
631 db_prepare(&q,
632 "SELECT datetime(mtime), user, comment, uuid"
633 " FROM event, blob"
634 " WHERE event.objid=%d"
635 " AND blob.rid=%d",
636 rid, rid
637 );
638 while( db_step(&q)==SQLITE_ROW ){
639 const char *zDate = db_column_text(&q, 0);
640 const char *zUuid = db_column_text(&q, 3);
641 const char *zCom = db_column_text(&q, 2);
642 const char *zUser = db_column_text(&q, 1);
643 @ Manifest of version
644 hyperlink_to_uuid(zUuid);
645 @ %s(zCom) by %s(zUser) on %s(zDate).
646 cnt++;
647 }
648 db_finalize(&q);
649 }
650 if( cnt==0 ){
651 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
652 @ Control file %s(zUuid).
653 }else if( linkToView ){
654 @ <a href="%s(g.zBaseURL)/fview/%d(rid)">[view]</a>
@@ -619,14 +704,20 @@
704 Blob content;
705
706 rid = name_to_rid(g.zExtra);
707 login_check_credentials();
708 if( !g.okHistory ){ login_needed(); return; }
709 if( g.zPath[0]=='i' ){
710 if( db_exists("SELECT 1 FROM tagxref JOIN tag USING(tagid)"
711 " WHERE rid=%d AND tagname LIKE 'wiki-%%'", rid) ){
712 winfo_page();
713 return;
714 }
715 if( db_exists("SELECT 1 FROM plink WHERE cid=%d", rid) ){
716 vinfo_page();
717 return;
718 }
719 }
720 style_header("File Content");
721 @ <h2>Content Of:</h2>
722 @ <blockquote>
723 object_description(rid, 0);
724
+47 -12
--- src/timeline.c
+++ src/timeline.c
@@ -86,10 +86,11 @@
8686
** 4. User
8787
** 5. Number of non-merge children
8888
** 6. Number of parents
8989
** 7. True if is a leaf
9090
** 8. background color
91
+** 9. type ("ci", "w")
9192
*/
9293
void www_print_timeline(
9394
Stmt *pQuery,
9495
int *pFirstEvent,
9596
int *pLastEvent,
@@ -113,10 +114,12 @@
113114
int nPChild = db_column_int(pQuery, 5);
114115
int nParent = db_column_int(pQuery, 6);
115116
int isLeaf = db_column_int(pQuery, 7);
116117
const char *zBgClr = db_column_text(pQuery, 8);
117118
const char *zDate = db_column_text(pQuery, 2);
119
+ const char *zType = db_column_text(pQuery, 9);
120
+ const char *zUser = db_column_text(pQuery, 4);
118121
if( cnt==0 && pFirstEvent ){
119122
*pFirstEvent = rid;
120123
}
121124
if( pLastEvent ){
122125
*pLastEvent = rid;
@@ -143,24 +146,28 @@
143146
if( zBgClr && zBgClr[0] ){
144147
@ <td valign="top" align="left" bgcolor="%h(zBgClr)">
145148
}else{
146149
@ <td valign="top" align="left">
147150
}
148
- hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
149
- if( nParent>1 ){
150
- @ <b>Merge</b>
151
- }
152
- if( nPChild>1 ){
153
- @ <b>Fork</b>
154
- }
155
- if( isLeaf ){
156
- @ <b>Leaf</b>
151
+ if( zType[0]=='c' ){
152
+ hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
153
+ if( nParent>1 ){
154
+ @ <b>Merge</b>
155
+ }
156
+ if( nPChild>1 ){
157
+ @ <b>Fork</b>
158
+ }
159
+ if( isLeaf ){
160
+ @ <b>Leaf</b>
161
+ }
162
+ }else{
163
+ hyperlink_to_uuid(zUuid);
157164
}
158165
db_column_blob(pQuery, 3, &comment);
159166
wiki_convert(&comment, 0);
160167
blob_reset(&comment);
161
- @ (by %h(db_column_text(pQuery,4)))</td></tr>
168
+ @ (by %h(zUser))</td></tr>
162169
}
163170
@ </table>
164171
}
165172
166173
/*
@@ -207,11 +214,12 @@
207214
@ coalesce(ecomment, comment),
208215
@ coalesce(euser, user),
209216
@ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
210217
@ (SELECT count(*) FROM plink WHERE cid=blob.rid),
211218
@ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
212
- @ coalesce(bgcolor, brbgcolor)
219
+ @ coalesce(bgcolor, brbgcolor),
220
+ @ event.type
213221
@ FROM event JOIN blob
214222
@ WHERE blob.rid=event.objid
215223
;
216224
return zBaseSql;
217225
}
@@ -381,10 +389,38 @@
381389
@ <input type="submit" value="Previous %d(nEntry) Rows">
382390
@ </form>
383391
style_footer();
384392
}
385393
394
+
395
+/*
396
+** WEBPAGE: wlist
397
+**
398
+** Show the complete change history for a single wiki page. The name
399
+** of the wiki is in g.zExtra
400
+*/
401
+void wlist_page(void){
402
+ Stmt q;
403
+ char *zTitle;
404
+ char *zSQL;
405
+ login_check_credentials();
406
+ if( !g.okHistory ){ login_needed(); return; }
407
+ zTitle = mprintf("History Of %h", g.zExtra);
408
+ style_header(zTitle);
409
+ free(zTitle);
410
+
411
+ zSQL = mprintf("%s AND event.objid IN "
412
+ " (SELECT rid FROM tagxref WHERE tagid="
413
+ "(SELECT tagid FROM tag WHERE tagname='wiki-%q'))",
414
+ timeline_query_for_www(), g.zExtra);
415
+ db_prepare(&q, zSQL);
416
+ free(zSQL);
417
+ www_print_timeline(&q, 0, 0, 0, 0);
418
+ db_finalize(&q);
419
+ style_footer();
420
+}
421
+
386422
/*
387423
** The input query q selects various records. Print a human-readable
388424
** summary of those records.
389425
**
390426
** Limit the number of entries printed to nLine.
@@ -469,11 +505,10 @@
469505
@ FROM event, blob
470506
@ WHERE blob.rid=event.objid
471507
;
472508
return zBaseSql;
473509
}
474
-
475510
476511
/*
477512
** COMMAND: timeline
478513
**
479514
** Usage: %fossil timeline ?WHEN? ?UUID|DATETIME? ?-n|--count N?
480515
--- src/timeline.c
+++ src/timeline.c
@@ -86,10 +86,11 @@
86 ** 4. User
87 ** 5. Number of non-merge children
88 ** 6. Number of parents
89 ** 7. True if is a leaf
90 ** 8. background color
 
91 */
92 void www_print_timeline(
93 Stmt *pQuery,
94 int *pFirstEvent,
95 int *pLastEvent,
@@ -113,10 +114,12 @@
113 int nPChild = db_column_int(pQuery, 5);
114 int nParent = db_column_int(pQuery, 6);
115 int isLeaf = db_column_int(pQuery, 7);
116 const char *zBgClr = db_column_text(pQuery, 8);
117 const char *zDate = db_column_text(pQuery, 2);
 
 
118 if( cnt==0 && pFirstEvent ){
119 *pFirstEvent = rid;
120 }
121 if( pLastEvent ){
122 *pLastEvent = rid;
@@ -143,24 +146,28 @@
143 if( zBgClr && zBgClr[0] ){
144 @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
145 }else{
146 @ <td valign="top" align="left">
147 }
148 hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
149 if( nParent>1 ){
150 @ <b>Merge</b>
151 }
152 if( nPChild>1 ){
153 @ <b>Fork</b>
154 }
155 if( isLeaf ){
156 @ <b>Leaf</b>
 
 
 
 
157 }
158 db_column_blob(pQuery, 3, &comment);
159 wiki_convert(&comment, 0);
160 blob_reset(&comment);
161 @ (by %h(db_column_text(pQuery,4)))</td></tr>
162 }
163 @ </table>
164 }
165
166 /*
@@ -207,11 +214,12 @@
207 @ coalesce(ecomment, comment),
208 @ coalesce(euser, user),
209 @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
210 @ (SELECT count(*) FROM plink WHERE cid=blob.rid),
211 @ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
212 @ coalesce(bgcolor, brbgcolor)
 
213 @ FROM event JOIN blob
214 @ WHERE blob.rid=event.objid
215 ;
216 return zBaseSql;
217 }
@@ -381,10 +389,38 @@
381 @ <input type="submit" value="Previous %d(nEntry) Rows">
382 @ </form>
383 style_footer();
384 }
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386 /*
387 ** The input query q selects various records. Print a human-readable
388 ** summary of those records.
389 **
390 ** Limit the number of entries printed to nLine.
@@ -469,11 +505,10 @@
469 @ FROM event, blob
470 @ WHERE blob.rid=event.objid
471 ;
472 return zBaseSql;
473 }
474
475
476 /*
477 ** COMMAND: timeline
478 **
479 ** Usage: %fossil timeline ?WHEN? ?UUID|DATETIME? ?-n|--count N?
480
--- src/timeline.c
+++ src/timeline.c
@@ -86,10 +86,11 @@
86 ** 4. User
87 ** 5. Number of non-merge children
88 ** 6. Number of parents
89 ** 7. True if is a leaf
90 ** 8. background color
91 ** 9. type ("ci", "w")
92 */
93 void www_print_timeline(
94 Stmt *pQuery,
95 int *pFirstEvent,
96 int *pLastEvent,
@@ -113,10 +114,12 @@
114 int nPChild = db_column_int(pQuery, 5);
115 int nParent = db_column_int(pQuery, 6);
116 int isLeaf = db_column_int(pQuery, 7);
117 const char *zBgClr = db_column_text(pQuery, 8);
118 const char *zDate = db_column_text(pQuery, 2);
119 const char *zType = db_column_text(pQuery, 9);
120 const char *zUser = db_column_text(pQuery, 4);
121 if( cnt==0 && pFirstEvent ){
122 *pFirstEvent = rid;
123 }
124 if( pLastEvent ){
125 *pLastEvent = rid;
@@ -143,24 +146,28 @@
146 if( zBgClr && zBgClr[0] ){
147 @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
148 }else{
149 @ <td valign="top" align="left">
150 }
151 if( zType[0]=='c' ){
152 hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);
153 if( nParent>1 ){
154 @ <b>Merge</b>
155 }
156 if( nPChild>1 ){
157 @ <b>Fork</b>
158 }
159 if( isLeaf ){
160 @ <b>Leaf</b>
161 }
162 }else{
163 hyperlink_to_uuid(zUuid);
164 }
165 db_column_blob(pQuery, 3, &comment);
166 wiki_convert(&comment, 0);
167 blob_reset(&comment);
168 @ (by %h(zUser))</td></tr>
169 }
170 @ </table>
171 }
172
173 /*
@@ -207,11 +214,12 @@
214 @ coalesce(ecomment, comment),
215 @ coalesce(euser, user),
216 @ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
217 @ (SELECT count(*) FROM plink WHERE cid=blob.rid),
218 @ NOT EXISTS (SELECT 1 FROM plink WHERE pid=blob.rid),
219 @ coalesce(bgcolor, brbgcolor),
220 @ event.type
221 @ FROM event JOIN blob
222 @ WHERE blob.rid=event.objid
223 ;
224 return zBaseSql;
225 }
@@ -381,10 +389,38 @@
389 @ <input type="submit" value="Previous %d(nEntry) Rows">
390 @ </form>
391 style_footer();
392 }
393
394
395 /*
396 ** WEBPAGE: wlist
397 **
398 ** Show the complete change history for a single wiki page. The name
399 ** of the wiki is in g.zExtra
400 */
401 void wlist_page(void){
402 Stmt q;
403 char *zTitle;
404 char *zSQL;
405 login_check_credentials();
406 if( !g.okHistory ){ login_needed(); return; }
407 zTitle = mprintf("History Of %h", g.zExtra);
408 style_header(zTitle);
409 free(zTitle);
410
411 zSQL = mprintf("%s AND event.objid IN "
412 " (SELECT rid FROM tagxref WHERE tagid="
413 "(SELECT tagid FROM tag WHERE tagname='wiki-%q'))",
414 timeline_query_for_www(), g.zExtra);
415 db_prepare(&q, zSQL);
416 free(zSQL);
417 www_print_timeline(&q, 0, 0, 0, 0);
418 db_finalize(&q);
419 style_footer();
420 }
421
422 /*
423 ** The input query q selects various records. Print a human-readable
424 ** summary of those records.
425 **
426 ** Limit the number of entries printed to nLine.
@@ -469,11 +505,10 @@
505 @ FROM event, blob
506 @ WHERE blob.rid=event.objid
507 ;
508 return zBaseSql;
509 }
 
510
511 /*
512 ** COMMAND: timeline
513 **
514 ** Usage: %fossil timeline ?WHEN? ?UUID|DATETIME? ?-n|--count N?
515

Keyboard Shortcuts

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