Fossil SCM

For timelines with the r= query parameter for a particular branch, try to draw that branch on the far left.

drh 2019-05-21 17:59 trunk merge
Commit 51510bfcea809c5a063dfd979441701f574fed9b3f369a1fd8178cb90b3a5f63
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -657,9 +657,9 @@
657657
** many descenders to (off-screen) parents. */
658658
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
659659
if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
660660
if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
661661
if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
662
- www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
662
+ www_print_timeline(&q, tmFlags, 0, 0, 0, 0, brtimeline_extra);
663663
db_finalize(&q);
664664
style_footer();
665665
}
666666
--- src/branch.c
+++ src/branch.c
@@ -657,9 +657,9 @@
657 ** many descenders to (off-screen) parents. */
658 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
659 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
660 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
661 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
662 www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
663 db_finalize(&q);
664 style_footer();
665 }
666
--- src/branch.c
+++ src/branch.c
@@ -657,9 +657,9 @@
657 ** many descenders to (off-screen) parents. */
658 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
659 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
660 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
661 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
662 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, brtimeline_extra);
663 db_finalize(&q);
664 style_footer();
665 }
666
--- src/descendants.c
+++ src/descendants.c
@@ -540,11 +540,11 @@
540540
** many descenders to (off-screen) parents. */
541541
tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542542
if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
543543
if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
544544
if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
545
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
545
+ www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0);
546546
db_finalize(&q);
547547
@ <br />
548548
style_footer();
549549
}
550550
551551
--- src/descendants.c
+++ src/descendants.c
@@ -540,11 +540,11 @@
540 ** many descenders to (off-screen) parents. */
541 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
543 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
544 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
545 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
546 db_finalize(&q);
547 @ <br />
548 style_footer();
549 }
550
551
--- src/descendants.c
+++ src/descendants.c
@@ -540,11 +540,11 @@
540 ** many descenders to (off-screen) parents. */
541 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542 if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
543 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
544 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
545 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0);
546 db_finalize(&q);
547 @ <br />
548 style_footer();
549 }
550
551
+1 -1
--- src/finfo.c
+++ src/finfo.c
@@ -645,11 +645,11 @@
645645
@ </td></tr>
646646
}
647647
db_finalize(&q);
648648
db_finalize(&qparent);
649649
if( pGraph ){
650
- graph_finish(pGraph, TIMELINE_DISJOINT);
650
+ graph_finish(pGraph, 0, TIMELINE_DISJOINT);
651651
if( pGraph->nErr ){
652652
graph_free(pGraph);
653653
pGraph = 0;
654654
}else{
655655
@ <tr class="timelineBottom" id="btm-%d(iTableId)">\
656656
--- src/finfo.c
+++ src/finfo.c
@@ -645,11 +645,11 @@
645 @ </td></tr>
646 }
647 db_finalize(&q);
648 db_finalize(&qparent);
649 if( pGraph ){
650 graph_finish(pGraph, TIMELINE_DISJOINT);
651 if( pGraph->nErr ){
652 graph_free(pGraph);
653 pGraph = 0;
654 }else{
655 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
656
--- src/finfo.c
+++ src/finfo.c
@@ -645,11 +645,11 @@
645 @ </td></tr>
646 }
647 db_finalize(&q);
648 db_finalize(&qparent);
649 if( pGraph ){
650 graph_finish(pGraph, 0, TIMELINE_DISJOINT);
651 if( pGraph->nErr ){
652 graph_free(pGraph);
653 pGraph = 0;
654 }else{
655 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
656
+23 -1
--- src/graph.c
+++ src/graph.c
@@ -96,10 +96,11 @@
9696
int nBranch; /* Number of distinct branches */
9797
char **azBranch; /* Names of the branches */
9898
int nRow; /* Number of rows */
9999
int nHash; /* Number of slots in apHash[] */
100100
GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
101
+ u8 aiRailMap[GR_MAX_RAIL]; /* Mapping of rails to actually columns */
101102
};
102103
103104
#endif
104105
105106
/* The N-th bit */
@@ -417,11 +418,11 @@
417418
**
418419
** TIMELINE_DISJOINT: Omit descenders
419420
** TIMELINE_FILLGAPS: Use step-children
420421
** TIMELINE_XMERGE: Omit off-graph merge lines
421422
*/
422
-void graph_finish(GraphContext *p, u32 tmFlags){
423
+void graph_finish(GraphContext *p, const char *zLeftBranch, u32 tmFlags){
423424
GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
424425
int i, j;
425426
u64 mask;
426427
int hasDup = 0; /* True if one or more isDup entries */
427428
const char *zTrunk;
@@ -714,7 +715,28 @@
714715
715716
/*
716717
** Find the maximum rail number.
717718
*/
718719
find_max_rail(p);
720
+
721
+ /*
722
+ ** Compute the rail mapping.
723
+ */
724
+ for(i=0; i<=p->mxRail; i++) p->aiRailMap[i] = i;
725
+ if( zLeftBranch ){
726
+ char *zLeft = persistBranchName(p, zLeftBranch);
727
+ for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
728
+ if( pRow->zBranch==zLeft ){
729
+ int iLeftRail = pRow->iRail;
730
+ p->aiRailMap[iLeftRail] = 0;
731
+ for(i=0, j=1; i<=p->mxRail; i++){
732
+ if( i==iLeftRail ) continue;
733
+ p->aiRailMap[i] = j++;
734
+ }
735
+ assert( j==p->mxRail+1 );
736
+ break;
737
+ }
738
+ }
739
+ }
740
+
719741
p->nErr = 0;
720742
}
721743
--- src/graph.c
+++ src/graph.c
@@ -96,10 +96,11 @@
96 int nBranch; /* Number of distinct branches */
97 char **azBranch; /* Names of the branches */
98 int nRow; /* Number of rows */
99 int nHash; /* Number of slots in apHash[] */
100 GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
 
101 };
102
103 #endif
104
105 /* The N-th bit */
@@ -417,11 +418,11 @@
417 **
418 ** TIMELINE_DISJOINT: Omit descenders
419 ** TIMELINE_FILLGAPS: Use step-children
420 ** TIMELINE_XMERGE: Omit off-graph merge lines
421 */
422 void graph_finish(GraphContext *p, u32 tmFlags){
423 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
424 int i, j;
425 u64 mask;
426 int hasDup = 0; /* True if one or more isDup entries */
427 const char *zTrunk;
@@ -714,7 +715,28 @@
714
715 /*
716 ** Find the maximum rail number.
717 */
718 find_max_rail(p);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719 p->nErr = 0;
720 }
721
--- src/graph.c
+++ src/graph.c
@@ -96,10 +96,11 @@
96 int nBranch; /* Number of distinct branches */
97 char **azBranch; /* Names of the branches */
98 int nRow; /* Number of rows */
99 int nHash; /* Number of slots in apHash[] */
100 GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
101 u8 aiRailMap[GR_MAX_RAIL]; /* Mapping of rails to actually columns */
102 };
103
104 #endif
105
106 /* The N-th bit */
@@ -417,11 +418,11 @@
418 **
419 ** TIMELINE_DISJOINT: Omit descenders
420 ** TIMELINE_FILLGAPS: Use step-children
421 ** TIMELINE_XMERGE: Omit off-graph merge lines
422 */
423 void graph_finish(GraphContext *p, const char *zLeftBranch, u32 tmFlags){
424 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
425 int i, j;
426 u64 mask;
427 int hasDup = 0; /* True if one or more isDup entries */
428 const char *zTrunk;
@@ -714,7 +715,28 @@
715
716 /*
717 ** Find the maximum rail number.
718 */
719 find_max_rail(p);
720
721 /*
722 ** Compute the rail mapping.
723 */
724 for(i=0; i<=p->mxRail; i++) p->aiRailMap[i] = i;
725 if( zLeftBranch ){
726 char *zLeft = persistBranchName(p, zLeftBranch);
727 for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
728 if( pRow->zBranch==zLeft ){
729 int iLeftRail = pRow->iRail;
730 p->aiRailMap[iLeftRail] = 0;
731 for(i=0, j=1; i<=p->mxRail; i++){
732 if( i==iLeftRail ) continue;
733 p->aiRailMap[i] = j++;
734 }
735 assert( j==p->mxRail+1 );
736 break;
737 }
738 }
739 }
740
741 p->nErr = 0;
742 }
743
+4 -4
--- src/info.c
+++ src/info.c
@@ -286,11 +286,11 @@
286286
TIMELINE_GRAPH
287287
|TIMELINE_FILLGAPS
288288
|TIMELINE_NOSCROLL
289289
|TIMELINE_XMERGE
290290
|TIMELINE_CHPICK,
291
- 0, 0, rid, 0);
291
+ 0, 0, 0, rid, 0);
292292
db_finalize(&q);
293293
}
294294
295295
/*
296296
** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
@@ -317,11 +317,11 @@
317317
blob_zero(&sql);
318318
blob_append(&sql, timeline_query_for_www(), -1);
319319
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
320320
db_prepare(&q, "%s", blob_sql_text(&sql));
321321
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
322
- 0, 0, 0, 0);
322
+ 0, 0, 0, 0, 0);
323323
db_finalize(&q);
324324
}
325325
326326
/*
327327
** WEBPAGE: test-backlinks
@@ -350,11 +350,11 @@
350350
blob_zero(&sql);
351351
blob_append(&sql, timeline_query_for_www(), -1);
352352
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
353353
db_prepare(&q, "%s", blob_sql_text(&sql));
354354
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
355
- 0, 0, 0, 0);
355
+ 0, 0, 0, 0, 0);
356356
db_finalize(&q);
357357
style_footer();
358358
}
359359
360360
@@ -619,11 +619,11 @@
619619
blob_zero(&sql);
620620
blob_append(&sql, timeline_query_for_www(), -1);
621621
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
622622
db_prepare(&q, "%s", blob_sql_text(&sql));
623623
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
624
- 0, 0, rid, 0);
624
+ 0, 0, 0, rid, 0);
625625
db_finalize(&q);
626626
style_footer();
627627
}
628628
629629
/*
630630
--- src/info.c
+++ src/info.c
@@ -286,11 +286,11 @@
286 TIMELINE_GRAPH
287 |TIMELINE_FILLGAPS
288 |TIMELINE_NOSCROLL
289 |TIMELINE_XMERGE
290 |TIMELINE_CHPICK,
291 0, 0, rid, 0);
292 db_finalize(&q);
293 }
294
295 /*
296 ** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
@@ -317,11 +317,11 @@
317 blob_zero(&sql);
318 blob_append(&sql, timeline_query_for_www(), -1);
319 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
320 db_prepare(&q, "%s", blob_sql_text(&sql));
321 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
322 0, 0, 0, 0);
323 db_finalize(&q);
324 }
325
326 /*
327 ** WEBPAGE: test-backlinks
@@ -350,11 +350,11 @@
350 blob_zero(&sql);
351 blob_append(&sql, timeline_query_for_www(), -1);
352 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
353 db_prepare(&q, "%s", blob_sql_text(&sql));
354 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
355 0, 0, 0, 0);
356 db_finalize(&q);
357 style_footer();
358 }
359
360
@@ -619,11 +619,11 @@
619 blob_zero(&sql);
620 blob_append(&sql, timeline_query_for_www(), -1);
621 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
622 db_prepare(&q, "%s", blob_sql_text(&sql));
623 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
624 0, 0, rid, 0);
625 db_finalize(&q);
626 style_footer();
627 }
628
629 /*
630
--- src/info.c
+++ src/info.c
@@ -286,11 +286,11 @@
286 TIMELINE_GRAPH
287 |TIMELINE_FILLGAPS
288 |TIMELINE_NOSCROLL
289 |TIMELINE_XMERGE
290 |TIMELINE_CHPICK,
291 0, 0, 0, rid, 0);
292 db_finalize(&q);
293 }
294
295 /*
296 ** Show a graph all wiki, tickets, and check-ins that refer to object zUuid.
@@ -317,11 +317,11 @@
317 blob_zero(&sql);
318 blob_append(&sql, timeline_query_for_www(), -1);
319 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
320 db_prepare(&q, "%s", blob_sql_text(&sql));
321 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
322 0, 0, 0, 0, 0);
323 db_finalize(&q);
324 }
325
326 /*
327 ** WEBPAGE: test-backlinks
@@ -350,11 +350,11 @@
350 blob_zero(&sql);
351 blob_append(&sql, timeline_query_for_www(), -1);
352 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
353 db_prepare(&q, "%s", blob_sql_text(&sql));
354 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
355 0, 0, 0, 0, 0);
356 db_finalize(&q);
357 style_footer();
358 }
359
360
@@ -619,11 +619,11 @@
619 blob_zero(&sql);
620 blob_append(&sql, timeline_query_for_www(), -1);
621 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
622 db_prepare(&q, "%s", blob_sql_text(&sql));
623 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
624 0, 0, 0, rid, 0);
625 db_finalize(&q);
626 style_footer();
627 }
628
629 /*
630
+1 -1
--- src/moderate.c
+++ src/moderate.c
@@ -184,11 +184,11 @@
184184
blob_append_sql(&sql,
185185
" AND event.objid IN (SELECT objid FROM modreq)"
186186
" ORDER BY event.mtime DESC"
187187
);
188188
db_prepare(&q, "%s", blob_sql_text(&sql));
189
- www_print_timeline(&q, 0, 0, 0, 0, 0);
189
+ www_print_timeline(&q, 0, 0, 0, 0, 0, 0);
190190
db_finalize(&q);
191191
}
192192
style_footer();
193193
}
194194
195195
--- src/moderate.c
+++ src/moderate.c
@@ -184,11 +184,11 @@
184 blob_append_sql(&sql,
185 " AND event.objid IN (SELECT objid FROM modreq)"
186 " ORDER BY event.mtime DESC"
187 );
188 db_prepare(&q, "%s", blob_sql_text(&sql));
189 www_print_timeline(&q, 0, 0, 0, 0, 0);
190 db_finalize(&q);
191 }
192 style_footer();
193 }
194
195
--- src/moderate.c
+++ src/moderate.c
@@ -184,11 +184,11 @@
184 blob_append_sql(&sql,
185 " AND event.objid IN (SELECT objid FROM modreq)"
186 " ORDER BY event.mtime DESC"
187 );
188 db_prepare(&q, "%s", blob_sql_text(&sql));
189 www_print_timeline(&q, 0, 0, 0, 0, 0, 0);
190 db_finalize(&q);
191 }
192 style_footer();
193 }
194
195
+1 -1
--- src/tag.c
+++ src/tag.c
@@ -754,10 +754,10 @@
754754
** many descenders to (off-screen) parents. */
755755
tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
756756
if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
757757
if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
758758
if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
759
- www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
759
+ www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0);
760760
db_finalize(&q);
761761
@ <br />
762762
style_footer();
763763
}
764764
--- src/tag.c
+++ src/tag.c
@@ -754,10 +754,10 @@
754 ** many descenders to (off-screen) parents. */
755 tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
756 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
757 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
758 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
759 www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
760 db_finalize(&q);
761 @ <br />
762 style_footer();
763 }
764
--- src/tag.c
+++ src/tag.c
@@ -754,10 +754,10 @@
754 ** many descenders to (off-screen) parents. */
755 tmFlags = TIMELINE_XMERGE | TIMELINE_FILLGAPS | TIMELINE_NOSCROLL;
756 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
757 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
758 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
759 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0);
760 db_finalize(&q);
761 @ <br />
762 style_footer();
763 }
764
+18 -14
--- src/timeline.c
+++ src/timeline.c
@@ -238,16 +238,17 @@
238238
** 8. list of symbolic tags.
239239
** 9. tagid for ticket or wiki or event
240240
** 10. Short comment to user for repeated tickets and wiki
241241
*/
242242
void www_print_timeline(
243
- Stmt *pQuery, /* Query to implement the timeline */
244
- int tmFlags, /* Flags controlling display behavior */
245
- const char *zThisUser, /* Suppress links to this user */
246
- const char *zThisTag, /* Suppress links to this tag */
247
- int selectedRid, /* Highlight the line with this RID value */
248
- void (*xExtra)(int) /* Routine to call on each line of display */
243
+ Stmt *pQuery, /* Query to implement the timeline */
244
+ int tmFlags, /* Flags controlling display behavior */
245
+ const char *zThisUser, /* Suppress links to this user */
246
+ const char *zThisTag, /* Suppress links to this tag */
247
+ const char *zLeftBranch, /* Strive to put this branch on the left margin */
248
+ int selectedRid, /* Highlight the line with this RID value */
249
+ void (*xExtra)(int) /* Routine to call on each line of display */
249250
){
250251
int mxWikiLen;
251252
Blob comment;
252253
int prevTagid = 0;
253254
int suppressCnt = 0;
@@ -759,11 +760,11 @@
759760
}
760761
if( pendingEndTr ){
761762
@ </td></tr>
762763
}
763764
if( pGraph ){
764
- graph_finish(pGraph, tmFlags);
765
+ graph_finish(pGraph, zLeftBranch, tmFlags);
765766
if( pGraph->nErr ){
766767
graph_free(pGraph);
767768
pGraph = 0;
768769
}else{
769770
@ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -829,10 +830,11 @@
829830
int colorGraph; /* Use colors for graph lines */
830831
int iTopRow; /* Index of the top row of the graph */
831832
int fileDiff; /* True for file diff. False for check-in diff */
832833
int omitDescenders; /* True to omit descenders */
833834
int scrollToSelect; /* True to scroll to the selection */
835
+ u8 *aiMap; /* The rail map */
834836
835837
iRailPitch = atoi(PD("railpitch","0"));
836838
showArrowheads = skin_detail_boolean("timeline-arrowheads");
837839
circleNodes = skin_detail_boolean("timeline-circle-nodes");
838840
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
@@ -903,20 +905,21 @@
903905
** merges.
904906
** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
905907
** omitted if there are no cherrypick merges.
906908
** h: The artifact hash of the object being graphed
907909
*/
910
+ aiMap = pGraph->aiRailMap;
908911
for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
909912
int k = 0;
910913
cgi_printf("{\"id\":%d,", pRow->idx);
911914
cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
912
- cgi_printf("\"r\":%d,", pRow->iRail);
915
+ cgi_printf("\"r\":%d,", aiMap[pRow->iRail]);
913916
if( pRow->bDescender ){
914917
cgi_printf("\"d\":%d,", pRow->bDescender);
915918
}
916919
if( pRow->mergeOut>=0 ){
917
- cgi_printf("\"mo\":%d,", pRow->mergeOut);
920
+ cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]);
918921
if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
919922
cgi_printf("\"mu\":%d,", pRow->mergeUpto);
920923
if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<pRow->mergeUpto ){
921924
cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
922925
}
@@ -935,11 +938,11 @@
935938
if( k==0 ){
936939
cgi_printf("\"au\":");
937940
cSep = '[';
938941
}
939942
k++;
940
- cgi_printf("%c%d,%d", cSep, i, pRow->aiRiser[i]);
943
+ cgi_printf("%c%d,%d", cSep, aiMap[i], pRow->aiRiser[i]);
941944
cSep = ',';
942945
}
943946
}
944947
if( k ){
945948
cgi_printf("],");
@@ -948,11 +951,11 @@
948951
cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr));
949952
}
950953
/* mi */
951954
for(i=k=0; i<GR_MAX_RAIL; i++){
952955
if( pRow->mergeIn[i]==1 ){
953
- int mi = i;
956
+ int mi = aiMap[i];
954957
if( (pRow->mergeDown >> i) & 1 ) mi = -mi;
955958
if( k==0 ){
956959
cgi_printf("\"mi\":");
957960
cSep = '[';
958961
}
@@ -963,11 +966,11 @@
963966
}
964967
if( k ) cgi_printf("],");
965968
/* ci */
966969
for(i=k=0; i<GR_MAX_RAIL; i++){
967970
if( pRow->mergeIn[i]==2 ){
968
- int mi = i;
971
+ int mi = aiMap[i];
969972
if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi;
970973
if( k==0 ){
971974
cgi_printf("\"ci\":");
972975
cSep = '[';
973976
}
@@ -2379,11 +2382,12 @@
23792382
}
23802383
23812384
if( zNewerButton ){
23822385
@ %z(chref("button","%z",zNewerButton))More&nbsp;&uarr;</a>
23832386
}
2384
- www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
2387
+ www_print_timeline(&q, tmFlags, zThisUser, zThisTag, zBrName,
2388
+ selectedRid, 0);
23852389
db_finalize(&q);
23862390
if( zOlderButton ){
23872391
@ %z(chref("button","%z",zOlderButton))More&nbsp;&darr;</a>
23882392
}
23892393
style_footer();
@@ -2872,11 +2876,11 @@
28722876
zId = db_text(0, "SELECT timestamp FROM timeline"
28732877
" ORDER BY sortby DESC LIMIT 1");
28742878
@ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
28752879
@ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
28762880
@ </small></h2>
2877
- www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0);
2881
+ www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0);
28782882
}
28792883
db_finalize(&q);
28802884
style_footer();
28812885
}
28822886
28832887
--- src/timeline.c
+++ src/timeline.c
@@ -238,16 +238,17 @@
238 ** 8. list of symbolic tags.
239 ** 9. tagid for ticket or wiki or event
240 ** 10. Short comment to user for repeated tickets and wiki
241 */
242 void www_print_timeline(
243 Stmt *pQuery, /* Query to implement the timeline */
244 int tmFlags, /* Flags controlling display behavior */
245 const char *zThisUser, /* Suppress links to this user */
246 const char *zThisTag, /* Suppress links to this tag */
247 int selectedRid, /* Highlight the line with this RID value */
248 void (*xExtra)(int) /* Routine to call on each line of display */
 
249 ){
250 int mxWikiLen;
251 Blob comment;
252 int prevTagid = 0;
253 int suppressCnt = 0;
@@ -759,11 +760,11 @@
759 }
760 if( pendingEndTr ){
761 @ </td></tr>
762 }
763 if( pGraph ){
764 graph_finish(pGraph, tmFlags);
765 if( pGraph->nErr ){
766 graph_free(pGraph);
767 pGraph = 0;
768 }else{
769 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -829,10 +830,11 @@
829 int colorGraph; /* Use colors for graph lines */
830 int iTopRow; /* Index of the top row of the graph */
831 int fileDiff; /* True for file diff. False for check-in diff */
832 int omitDescenders; /* True to omit descenders */
833 int scrollToSelect; /* True to scroll to the selection */
 
834
835 iRailPitch = atoi(PD("railpitch","0"));
836 showArrowheads = skin_detail_boolean("timeline-arrowheads");
837 circleNodes = skin_detail_boolean("timeline-circle-nodes");
838 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
@@ -903,20 +905,21 @@
903 ** merges.
904 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
905 ** omitted if there are no cherrypick merges.
906 ** h: The artifact hash of the object being graphed
907 */
 
908 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
909 int k = 0;
910 cgi_printf("{\"id\":%d,", pRow->idx);
911 cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
912 cgi_printf("\"r\":%d,", pRow->iRail);
913 if( pRow->bDescender ){
914 cgi_printf("\"d\":%d,", pRow->bDescender);
915 }
916 if( pRow->mergeOut>=0 ){
917 cgi_printf("\"mo\":%d,", pRow->mergeOut);
918 if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
919 cgi_printf("\"mu\":%d,", pRow->mergeUpto);
920 if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<pRow->mergeUpto ){
921 cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
922 }
@@ -935,11 +938,11 @@
935 if( k==0 ){
936 cgi_printf("\"au\":");
937 cSep = '[';
938 }
939 k++;
940 cgi_printf("%c%d,%d", cSep, i, pRow->aiRiser[i]);
941 cSep = ',';
942 }
943 }
944 if( k ){
945 cgi_printf("],");
@@ -948,11 +951,11 @@
948 cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr));
949 }
950 /* mi */
951 for(i=k=0; i<GR_MAX_RAIL; i++){
952 if( pRow->mergeIn[i]==1 ){
953 int mi = i;
954 if( (pRow->mergeDown >> i) & 1 ) mi = -mi;
955 if( k==0 ){
956 cgi_printf("\"mi\":");
957 cSep = '[';
958 }
@@ -963,11 +966,11 @@
963 }
964 if( k ) cgi_printf("],");
965 /* ci */
966 for(i=k=0; i<GR_MAX_RAIL; i++){
967 if( pRow->mergeIn[i]==2 ){
968 int mi = i;
969 if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi;
970 if( k==0 ){
971 cgi_printf("\"ci\":");
972 cSep = '[';
973 }
@@ -2379,11 +2382,12 @@
2379 }
2380
2381 if( zNewerButton ){
2382 @ %z(chref("button","%z",zNewerButton))More&nbsp;&uarr;</a>
2383 }
2384 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
 
2385 db_finalize(&q);
2386 if( zOlderButton ){
2387 @ %z(chref("button","%z",zOlderButton))More&nbsp;&darr;</a>
2388 }
2389 style_footer();
@@ -2872,11 +2876,11 @@
2872 zId = db_text(0, "SELECT timestamp FROM timeline"
2873 " ORDER BY sortby DESC LIMIT 1");
2874 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
2875 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
2876 @ </small></h2>
2877 www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0);
2878 }
2879 db_finalize(&q);
2880 style_footer();
2881 }
2882
2883
--- src/timeline.c
+++ src/timeline.c
@@ -238,16 +238,17 @@
238 ** 8. list of symbolic tags.
239 ** 9. tagid for ticket or wiki or event
240 ** 10. Short comment to user for repeated tickets and wiki
241 */
242 void www_print_timeline(
243 Stmt *pQuery, /* Query to implement the timeline */
244 int tmFlags, /* Flags controlling display behavior */
245 const char *zThisUser, /* Suppress links to this user */
246 const char *zThisTag, /* Suppress links to this tag */
247 const char *zLeftBranch, /* Strive to put this branch on the left margin */
248 int selectedRid, /* Highlight the line with this RID value */
249 void (*xExtra)(int) /* Routine to call on each line of display */
250 ){
251 int mxWikiLen;
252 Blob comment;
253 int prevTagid = 0;
254 int suppressCnt = 0;
@@ -759,11 +760,11 @@
760 }
761 if( pendingEndTr ){
762 @ </td></tr>
763 }
764 if( pGraph ){
765 graph_finish(pGraph, zLeftBranch, tmFlags);
766 if( pGraph->nErr ){
767 graph_free(pGraph);
768 pGraph = 0;
769 }else{
770 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -829,10 +830,11 @@
830 int colorGraph; /* Use colors for graph lines */
831 int iTopRow; /* Index of the top row of the graph */
832 int fileDiff; /* True for file diff. False for check-in diff */
833 int omitDescenders; /* True to omit descenders */
834 int scrollToSelect; /* True to scroll to the selection */
835 u8 *aiMap; /* The rail map */
836
837 iRailPitch = atoi(PD("railpitch","0"));
838 showArrowheads = skin_detail_boolean("timeline-arrowheads");
839 circleNodes = skin_detail_boolean("timeline-circle-nodes");
840 colorGraph = skin_detail_boolean("timeline-color-graph-lines");
@@ -903,20 +905,21 @@
905 ** merges.
906 ** ci: "cherrypick-in". Like "mi" except for cherrypick merges.
907 ** omitted if there are no cherrypick merges.
908 ** h: The artifact hash of the object being graphed
909 */
910 aiMap = pGraph->aiRailMap;
911 for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
912 int k = 0;
913 cgi_printf("{\"id\":%d,", pRow->idx);
914 cgi_printf("\"bg\":\"%s\",", pRow->zBgClr);
915 cgi_printf("\"r\":%d,", aiMap[pRow->iRail]);
916 if( pRow->bDescender ){
917 cgi_printf("\"d\":%d,", pRow->bDescender);
918 }
919 if( pRow->mergeOut>=0 ){
920 cgi_printf("\"mo\":%d,", aiMap[pRow->mergeOut]);
921 if( pRow->mergeUpto==0 ) pRow->mergeUpto = pRow->idx;
922 cgi_printf("\"mu\":%d,", pRow->mergeUpto);
923 if( pRow->cherrypickUpto>0 && pRow->cherrypickUpto<pRow->mergeUpto ){
924 cgi_printf("\"cu\":%d,", pRow->cherrypickUpto);
925 }
@@ -935,11 +938,11 @@
938 if( k==0 ){
939 cgi_printf("\"au\":");
940 cSep = '[';
941 }
942 k++;
943 cgi_printf("%c%d,%d", cSep, aiMap[i], pRow->aiRiser[i]);
944 cSep = ',';
945 }
946 }
947 if( k ){
948 cgi_printf("],");
@@ -948,11 +951,11 @@
951 cgi_printf("\"fg\":\"%s\",", bg_to_fg(pRow->zBgClr));
952 }
953 /* mi */
954 for(i=k=0; i<GR_MAX_RAIL; i++){
955 if( pRow->mergeIn[i]==1 ){
956 int mi = aiMap[i];
957 if( (pRow->mergeDown >> i) & 1 ) mi = -mi;
958 if( k==0 ){
959 cgi_printf("\"mi\":");
960 cSep = '[';
961 }
@@ -963,11 +966,11 @@
966 }
967 if( k ) cgi_printf("],");
968 /* ci */
969 for(i=k=0; i<GR_MAX_RAIL; i++){
970 if( pRow->mergeIn[i]==2 ){
971 int mi = aiMap[i];
972 if( (pRow->cherrypickDown >> i) & 1 ) mi = -mi;
973 if( k==0 ){
974 cgi_printf("\"ci\":");
975 cSep = '[';
976 }
@@ -2379,11 +2382,12 @@
2382 }
2383
2384 if( zNewerButton ){
2385 @ %z(chref("button","%z",zNewerButton))More&nbsp;&uarr;</a>
2386 }
2387 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, zBrName,
2388 selectedRid, 0);
2389 db_finalize(&q);
2390 if( zOlderButton ){
2391 @ %z(chref("button","%z",zOlderButton))More&nbsp;&darr;</a>
2392 }
2393 style_footer();
@@ -2872,11 +2876,11 @@
2876 zId = db_text(0, "SELECT timestamp FROM timeline"
2877 " ORDER BY sortby DESC LIMIT 1");
2878 @ <h2>%d(iAgo) Year%s(iAgo>1?"s":"") Ago
2879 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
2880 @ </small></h2>
2881 www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0);
2882 }
2883 db_finalize(&q);
2884 style_footer();
2885 }
2886
2887
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,11 @@
896896
timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897897
);
898898
}
899899
db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900900
www_print_timeline(&q, TIMELINE_ARTID|TIMELINE_DISJOINT|TIMELINE_GRAPH,
901
- 0, 0, 0, 0);
901
+ 0, 0, 0, 0, 0);
902902
db_finalize(&q);
903903
style_footer();
904904
}
905905
906906
/*
907907
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,11 @@
896 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897 );
898 }
899 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900 www_print_timeline(&q, TIMELINE_ARTID|TIMELINE_DISJOINT|TIMELINE_GRAPH,
901 0, 0, 0, 0);
902 db_finalize(&q);
903 style_footer();
904 }
905
906 /*
907
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,11 @@
896 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897 );
898 }
899 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900 www_print_timeline(&q, TIMELINE_ARTID|TIMELINE_DISJOINT|TIMELINE_GRAPH,
901 0, 0, 0, 0, 0);
902 db_finalize(&q);
903 style_footer();
904 }
905
906 /*
907

Keyboard Shortcuts

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