Fossil SCM

The "ng" (no-graph) query parameter still shows a node circle and colors the check-ins by branch name, but does not show lines connecting the node circles. The /brtimeline page always appears in Columnar mode.

drh 2025-10-16 17:26 timeline-enhance-2025
Commit ddd12b85970f06cdbf82db3a6393f0794252b37869e59ac9e6c22e692a284e58
2 files changed +10 -22 +25 -25
+10 -22
--- src/branch.c
+++ src/branch.c
@@ -1038,30 +1038,23 @@
10381038
" AND tag.tagname GLOB 'sym-*'",
10391039
rid
10401040
);
10411041
while( db_step(&q)==SQLITE_ROW ){
10421042
const char *zTagName = db_column_text(&q, 0);
1043
- const char *zBrName = branch_of_rid(rid);
1044
- @ branch:&nbsp;<b>%h(zBrName)</b>
1043
+ char *zBrName = branch_of_rid(rid);
1044
+ @ <strong>%h(zBrName)</strong><br>\
10451045
@ %z(href("%R/timeline?r=%T",zTagName))<button>timeline</button></a>
10461046
fossil_free(zBrName);
10471047
}
10481048
db_finalize(&q);
10491049
}
10501050
10511051
/*
10521052
** WEBPAGE: brtimeline
10531053
**
1054
-** Show a timeline of all branches
1055
-**
1056
-** Query parameters:
1057
-**
1058
-** ng No graph
1059
-** nohidden Hide check-ins with "hidden" tag
1060
-** onlyhidden Show only check-ins with "hidden" tag
1061
-** brbg Background color by branch name
1062
-** ubg Background color by user name
1054
+** List the first check of every branch, starting with the most recent
1055
+** and going backwards in time.
10631056
*/
10641057
void brtimeline_page(void){
10651058
Blob sql = empty_blob;
10661059
Stmt q;
10671060
int tmFlags; /* Timeline display flags */
@@ -1071,15 +1064,16 @@
10711064
login_check_credentials();
10721065
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
10731066
10741067
style_set_current_feature("branch");
10751068
style_header("Branches");
1076
- style_submenu_element("List", "brlist");
1069
+ style_submenu_element("Branch List", "brlist");
10771070
login_anonymous_available();
1078
- timeline_ss_submenu();
1071
+ /* timeline_ss_submenu(); */
10791072
cgi_check_for_malice();
1080
- @ <h2>The initial check-in for each branch:</h2>
1073
+ @ <h2>First check-in for every branch, starting with the most recent
1074
+ @ and going backwards in time.</h2>
10811075
blob_append(&sql, timeline_query_for_www(), -1);
10821076
blob_append_sql(&sql,
10831077
"AND blob.rid IN (SELECT rid FROM tagxref"
10841078
" WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
10851079
if( fNoHidden || fOnlyHidden ){
@@ -1091,18 +1085,12 @@
10911085
}
10921086
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
10931087
blob_reset(&sql);
10941088
/* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
10951089
** many descenders to (off-screen) parents. */
1096
- tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
1097
-#if 1
1098
- if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
1099
- if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
1100
- if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
1101
-#else
1102
- tmFlags |= TIMELINE_BRCOLOR | TIMELINE_GRAPH;
1103
-#endif
1090
+ tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
1091
+ | TIMELINE_BRCOLOR;
11041092
www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
11051093
db_finalize(&q);
11061094
style_finish_page();
11071095
}
11081096
11091097
--- src/branch.c
+++ src/branch.c
@@ -1038,30 +1038,23 @@
1038 " AND tag.tagname GLOB 'sym-*'",
1039 rid
1040 );
1041 while( db_step(&q)==SQLITE_ROW ){
1042 const char *zTagName = db_column_text(&q, 0);
1043 const char *zBrName = branch_of_rid(rid);
1044 @ branch:&nbsp;<b>%h(zBrName)</b>
1045 @ %z(href("%R/timeline?r=%T",zTagName))<button>timeline</button></a>
1046 fossil_free(zBrName);
1047 }
1048 db_finalize(&q);
1049 }
1050
1051 /*
1052 ** WEBPAGE: brtimeline
1053 **
1054 ** Show a timeline of all branches
1055 **
1056 ** Query parameters:
1057 **
1058 ** ng No graph
1059 ** nohidden Hide check-ins with "hidden" tag
1060 ** onlyhidden Show only check-ins with "hidden" tag
1061 ** brbg Background color by branch name
1062 ** ubg Background color by user name
1063 */
1064 void brtimeline_page(void){
1065 Blob sql = empty_blob;
1066 Stmt q;
1067 int tmFlags; /* Timeline display flags */
@@ -1071,15 +1064,16 @@
1071 login_check_credentials();
1072 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1073
1074 style_set_current_feature("branch");
1075 style_header("Branches");
1076 style_submenu_element("List", "brlist");
1077 login_anonymous_available();
1078 timeline_ss_submenu();
1079 cgi_check_for_malice();
1080 @ <h2>The initial check-in for each branch:</h2>
 
1081 blob_append(&sql, timeline_query_for_www(), -1);
1082 blob_append_sql(&sql,
1083 "AND blob.rid IN (SELECT rid FROM tagxref"
1084 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
1085 if( fNoHidden || fOnlyHidden ){
@@ -1091,18 +1085,12 @@
1091 }
1092 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
1093 blob_reset(&sql);
1094 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
1095 ** many descenders to (off-screen) parents. */
1096 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
1097 #if 1
1098 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
1099 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
1100 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
1101 #else
1102 tmFlags |= TIMELINE_BRCOLOR | TIMELINE_GRAPH;
1103 #endif
1104 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
1105 db_finalize(&q);
1106 style_finish_page();
1107 }
1108
1109
--- src/branch.c
+++ src/branch.c
@@ -1038,30 +1038,23 @@
1038 " AND tag.tagname GLOB 'sym-*'",
1039 rid
1040 );
1041 while( db_step(&q)==SQLITE_ROW ){
1042 const char *zTagName = db_column_text(&q, 0);
1043 char *zBrName = branch_of_rid(rid);
1044 @ <strong>%h(zBrName)</strong><br>\
1045 @ %z(href("%R/timeline?r=%T",zTagName))<button>timeline</button></a>
1046 fossil_free(zBrName);
1047 }
1048 db_finalize(&q);
1049 }
1050
1051 /*
1052 ** WEBPAGE: brtimeline
1053 **
1054 ** List the first check of every branch, starting with the most recent
1055 ** and going backwards in time.
 
 
 
 
 
 
 
1056 */
1057 void brtimeline_page(void){
1058 Blob sql = empty_blob;
1059 Stmt q;
1060 int tmFlags; /* Timeline display flags */
@@ -1071,15 +1064,16 @@
1064 login_check_credentials();
1065 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
1066
1067 style_set_current_feature("branch");
1068 style_header("Branches");
1069 style_submenu_element("Branch List", "brlist");
1070 login_anonymous_available();
1071 /* timeline_ss_submenu(); */
1072 cgi_check_for_malice();
1073 @ <h2>First check-in for every branch, starting with the most recent
1074 @ and going backwards in time.</h2>
1075 blob_append(&sql, timeline_query_for_www(), -1);
1076 blob_append_sql(&sql,
1077 "AND blob.rid IN (SELECT rid FROM tagxref"
1078 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
1079 if( fNoHidden || fOnlyHidden ){
@@ -1091,18 +1085,12 @@
1085 }
1086 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
1087 blob_reset(&sql);
1088 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
1089 ** many descenders to (off-screen) parents. */
1090 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL | TIMELINE_COLUMNAR
1091 | TIMELINE_BRCOLOR;
 
 
 
 
 
 
1092 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
1093 db_finalize(&q);
1094 style_finish_page();
1095 }
1096
1097
+25 -25
--- src/timeline.c
+++ src/timeline.c
@@ -377,13 +377,11 @@
377377
}else{
378378
zStyle = "Modern";
379379
}
380380
zDateFmt = P("datefmt");
381381
if( zDateFmt ) dateFormat = atoi(zDateFmt);
382
- if( tmFlags & TIMELINE_GRAPH ){
383
- pGraph = graph_init();
384
- }
382
+ pGraph = graph_init();
385383
if( (tmFlags & TIMELINE_CHPICK)!=0
386384
&& !db_table_exists("repository","cherrypick")
387385
){
388386
tmFlags &= ~TIMELINE_CHPICK;
389387
}
@@ -565,32 +563,34 @@
565563
if( zType[0]=='c' && pGraph ){
566564
int nParent = 0;
567565
int nCherrypick = 0;
568566
GraphRowId aParent[GR_MAX_RAIL];
569567
static Stmt qparent;
570
- db_static_prepare(&qparent,
571
- "SELECT pid FROM plink"
572
- " WHERE cid=:rid AND pid NOT IN phantom"
573
- " ORDER BY isprim DESC /*sort*/"
574
- );
575
- db_bind_int(&qparent, ":rid", rid);
576
- while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
577
- aParent[nParent++] = db_column_int(&qparent, 0);
578
- }
579
- db_reset(&qparent);
580
- if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
581
- static Stmt qcherrypick;
582
- db_static_prepare(&qcherrypick,
583
- "SELECT parentid FROM cherrypick"
584
- " WHERE childid=:rid AND parentid NOT IN phantom"
585
- );
586
- db_bind_int(&qcherrypick, ":rid", rid);
587
- while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
588
- aParent[nParent++] = db_column_int(&qcherrypick, 0);
589
- nCherrypick++;
590
- }
591
- db_reset(&qcherrypick);
568
+ if( tmFlags & TIMELINE_GRAPH ){
569
+ db_static_prepare(&qparent,
570
+ "SELECT pid FROM plink"
571
+ " WHERE cid=:rid AND pid NOT IN phantom"
572
+ " ORDER BY isprim DESC /*sort*/"
573
+ );
574
+ db_bind_int(&qparent, ":rid", rid);
575
+ while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
576
+ aParent[nParent++] = db_column_int(&qparent, 0);
577
+ }
578
+ db_reset(&qparent);
579
+ if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
580
+ static Stmt qcherrypick;
581
+ db_static_prepare(&qcherrypick,
582
+ "SELECT parentid FROM cherrypick"
583
+ " WHERE childid=:rid AND parentid NOT IN phantom"
584
+ );
585
+ db_bind_int(&qcherrypick, ":rid", rid);
586
+ while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
587
+ aParent[nParent++] = db_column_int(&qcherrypick, 0);
588
+ nCherrypick++;
589
+ }
590
+ db_reset(&qcherrypick);
591
+ }
592592
}
593593
gidx = graph_add_row(pGraph, rid, nParent, nCherrypick, aParent,
594594
zBr, zBgClr, zUuid,
595595
isLeaf ? isLeaf + 2 * has_closed_tag(rid) : 0);
596596
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
597597
--- src/timeline.c
+++ src/timeline.c
@@ -377,13 +377,11 @@
377 }else{
378 zStyle = "Modern";
379 }
380 zDateFmt = P("datefmt");
381 if( zDateFmt ) dateFormat = atoi(zDateFmt);
382 if( tmFlags & TIMELINE_GRAPH ){
383 pGraph = graph_init();
384 }
385 if( (tmFlags & TIMELINE_CHPICK)!=0
386 && !db_table_exists("repository","cherrypick")
387 ){
388 tmFlags &= ~TIMELINE_CHPICK;
389 }
@@ -565,32 +563,34 @@
565 if( zType[0]=='c' && pGraph ){
566 int nParent = 0;
567 int nCherrypick = 0;
568 GraphRowId aParent[GR_MAX_RAIL];
569 static Stmt qparent;
570 db_static_prepare(&qparent,
571 "SELECT pid FROM plink"
572 " WHERE cid=:rid AND pid NOT IN phantom"
573 " ORDER BY isprim DESC /*sort*/"
574 );
575 db_bind_int(&qparent, ":rid", rid);
576 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
577 aParent[nParent++] = db_column_int(&qparent, 0);
578 }
579 db_reset(&qparent);
580 if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
581 static Stmt qcherrypick;
582 db_static_prepare(&qcherrypick,
583 "SELECT parentid FROM cherrypick"
584 " WHERE childid=:rid AND parentid NOT IN phantom"
585 );
586 db_bind_int(&qcherrypick, ":rid", rid);
587 while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
588 aParent[nParent++] = db_column_int(&qcherrypick, 0);
589 nCherrypick++;
590 }
591 db_reset(&qcherrypick);
 
 
592 }
593 gidx = graph_add_row(pGraph, rid, nParent, nCherrypick, aParent,
594 zBr, zBgClr, zUuid,
595 isLeaf ? isLeaf + 2 * has_closed_tag(rid) : 0);
596 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
597
--- src/timeline.c
+++ src/timeline.c
@@ -377,13 +377,11 @@
377 }else{
378 zStyle = "Modern";
379 }
380 zDateFmt = P("datefmt");
381 if( zDateFmt ) dateFormat = atoi(zDateFmt);
382 pGraph = graph_init();
 
 
383 if( (tmFlags & TIMELINE_CHPICK)!=0
384 && !db_table_exists("repository","cherrypick")
385 ){
386 tmFlags &= ~TIMELINE_CHPICK;
387 }
@@ -565,32 +563,34 @@
563 if( zType[0]=='c' && pGraph ){
564 int nParent = 0;
565 int nCherrypick = 0;
566 GraphRowId aParent[GR_MAX_RAIL];
567 static Stmt qparent;
568 if( tmFlags & TIMELINE_GRAPH ){
569 db_static_prepare(&qparent,
570 "SELECT pid FROM plink"
571 " WHERE cid=:rid AND pid NOT IN phantom"
572 " ORDER BY isprim DESC /*sort*/"
573 );
574 db_bind_int(&qparent, ":rid", rid);
575 while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){
576 aParent[nParent++] = db_column_int(&qparent, 0);
577 }
578 db_reset(&qparent);
579 if( (tmFlags & TIMELINE_CHPICK)!=0 && nParent>0 ){
580 static Stmt qcherrypick;
581 db_static_prepare(&qcherrypick,
582 "SELECT parentid FROM cherrypick"
583 " WHERE childid=:rid AND parentid NOT IN phantom"
584 );
585 db_bind_int(&qcherrypick, ":rid", rid);
586 while( db_step(&qcherrypick)==SQLITE_ROW && nParent<count(aParent) ){
587 aParent[nParent++] = db_column_int(&qcherrypick, 0);
588 nCherrypick++;
589 }
590 db_reset(&qcherrypick);
591 }
592 }
593 gidx = graph_add_row(pGraph, rid, nParent, nCherrypick, aParent,
594 zBr, zBgClr, zUuid,
595 isLeaf ? isLeaf + 2 * has_closed_tag(rid) : 0);
596 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
597

Keyboard Shortcuts

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