Fossil SCM

Add a new TIMELINE flag to control the dotted vertical lines that indicate omitted nodes. Only enable the dotted verticals where they make sense.

drh 2019-05-14 14:47 trunk
Commit fff033fe6f92fc98314a5736537d3cfa4b749df0ffbbe41b7c8c46a4e314497e
+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, 1);
650
+ graph_finish(pGraph, 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, 1);
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, TIMELINE_DISJOINT);
651 if( pGraph->nErr ){
652 graph_free(pGraph);
653 pGraph = 0;
654 }else{
655 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
656
+26 -17
--- src/graph.c
+++ src/graph.c
@@ -372,17 +372,24 @@
372372
**
373373
** When primary or merge parents are off-screen, normally a line is drawn
374374
** from the node down to the bottom of the graph. This line is called a
375375
** "descender". But if the omitDescenders flag is true, then lines down
376376
** to the bottom of the screen are omitted.
377
+**
378
+** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379
+** Only the following are honored:
380
+**
381
+** TIMELINE_DISJOINT: Omit descenders
382
+** TIMELINE_FILLGAPS: Use step-children
377383
*/
378
-void graph_finish(GraphContext *p, int omitDescenders){
384
+void graph_finish(GraphContext *p, u32 tmFlags){
379385
GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
380386
int i, j;
381387
u64 mask;
382388
int hasDup = 0; /* True if one or more isDup entries */
383389
const char *zTrunk;
390
+ int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
384391
385392
/* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
386393
** coming up from the bottom of the graph from off-screen check-in Y
387394
** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
388395
*/
@@ -479,26 +486,28 @@
479486
pParent->pChild = pRow;
480487
pParent->idxTop = pRow->idxTop;
481488
}
482489
}
483490
484
- /* If a node has no pChild, and there is a later node (a node higher
485
- ** up on the graph) in the same branch that has no parent, then make
486
- ** the lower node a step-child of the upper node.
487
- */
488
- for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
489
- if( pRow->pChild ) continue;
490
- for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
491
- if( pLoop->nParent>0
492
- && pLoop->zBranch==pRow->zBranch
493
- && hashFind(p,pLoop->aParent[0])==0
494
- ){
495
- pRow->pChild = pLoop;
496
- pRow->idxTop = pLoop->idxTop;
497
- pRow->isStepParent = 1;
498
- pLoop->aParent[0] = pRow->rid;
499
- break;
491
+ if( tmFlags & TIMELINE_FILLGAPS ){
492
+ /* If a node has no pChild, and there is a later node (a node higher
493
+ ** up on the graph) in the same branch that has no parent, then make
494
+ ** the lower node a step-child of the upper node.
495
+ */
496
+ for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
497
+ if( pRow->pChild ) continue;
498
+ for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
499
+ if( pLoop->nParent>0
500
+ && pLoop->zBranch==pRow->zBranch
501
+ && hashFind(p,pLoop->aParent[0])==0
502
+ ){
503
+ pRow->pChild = pLoop;
504
+ pRow->idxTop = pLoop->idxTop;
505
+ pRow->isStepParent = 1;
506
+ pLoop->aParent[0] = pRow->rid;
507
+ break;
508
+ }
500509
}
501510
}
502511
}
503512
504513
/* Identify rows where the primary parent is off screen. Assign
505514
--- src/graph.c
+++ src/graph.c
@@ -372,17 +372,24 @@
372 **
373 ** When primary or merge parents are off-screen, normally a line is drawn
374 ** from the node down to the bottom of the graph. This line is called a
375 ** "descender". But if the omitDescenders flag is true, then lines down
376 ** to the bottom of the screen are omitted.
 
 
 
 
 
 
377 */
378 void graph_finish(GraphContext *p, int omitDescenders){
379 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
380 int i, j;
381 u64 mask;
382 int hasDup = 0; /* True if one or more isDup entries */
383 const char *zTrunk;
 
384
385 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
386 ** coming up from the bottom of the graph from off-screen check-in Y
387 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
388 */
@@ -479,26 +486,28 @@
479 pParent->pChild = pRow;
480 pParent->idxTop = pRow->idxTop;
481 }
482 }
483
484 /* If a node has no pChild, and there is a later node (a node higher
485 ** up on the graph) in the same branch that has no parent, then make
486 ** the lower node a step-child of the upper node.
487 */
488 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
489 if( pRow->pChild ) continue;
490 for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
491 if( pLoop->nParent>0
492 && pLoop->zBranch==pRow->zBranch
493 && hashFind(p,pLoop->aParent[0])==0
494 ){
495 pRow->pChild = pLoop;
496 pRow->idxTop = pLoop->idxTop;
497 pRow->isStepParent = 1;
498 pLoop->aParent[0] = pRow->rid;
499 break;
 
 
500 }
501 }
502 }
503
504 /* Identify rows where the primary parent is off screen. Assign
505
--- src/graph.c
+++ src/graph.c
@@ -372,17 +372,24 @@
372 **
373 ** When primary or merge parents are off-screen, normally a line is drawn
374 ** from the node down to the bottom of the graph. This line is called a
375 ** "descender". But if the omitDescenders flag is true, then lines down
376 ** to the bottom of the screen are omitted.
377 **
378 ** The tmFlags parameter is zero or more of the TIMELINE_* constants.
379 ** Only the following are honored:
380 **
381 ** TIMELINE_DISJOINT: Omit descenders
382 ** TIMELINE_FILLGAPS: Use step-children
383 */
384 void graph_finish(GraphContext *p, u32 tmFlags){
385 GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
386 int i, j;
387 u64 mask;
388 int hasDup = 0; /* True if one or more isDup entries */
389 const char *zTrunk;
390 int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
391
392 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
393 ** coming up from the bottom of the graph from off-screen check-in Y
394 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
395 */
@@ -479,26 +486,28 @@
486 pParent->pChild = pRow;
487 pParent->idxTop = pRow->idxTop;
488 }
489 }
490
491 if( tmFlags & TIMELINE_FILLGAPS ){
492 /* If a node has no pChild, and there is a later node (a node higher
493 ** up on the graph) in the same branch that has no parent, then make
494 ** the lower node a step-child of the upper node.
495 */
496 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
497 if( pRow->pChild ) continue;
498 for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
499 if( pLoop->nParent>0
500 && pLoop->zBranch==pRow->zBranch
501 && hashFind(p,pLoop->aParent[0])==0
502 ){
503 pRow->pChild = pLoop;
504 pRow->idxTop = pLoop->idxTop;
505 pRow->isStepParent = 1;
506 pLoop->aParent[0] = pRow->rid;
507 break;
508 }
509 }
510 }
511 }
512
513 /* Identify rows where the primary parent is off screen. Assign
514
+1
--- src/info.c
+++ src/info.c
@@ -282,10 +282,11 @@
282282
}
283283
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
284284
db_prepare(&q, "%s", blob_sql_text(&sql));
285285
www_print_timeline(&q,
286286
TIMELINE_GRAPH
287
+ |TIMELINE_FILLGAPS
287288
|TIMELINE_NOSCROLL
288289
|TIMELINE_CHPICK,
289290
0, 0, rid, 0);
290291
db_finalize(&q);
291292
}
292293
--- src/info.c
+++ src/info.c
@@ -282,10 +282,11 @@
282 }
283 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
284 db_prepare(&q, "%s", blob_sql_text(&sql));
285 www_print_timeline(&q,
286 TIMELINE_GRAPH
 
287 |TIMELINE_NOSCROLL
288 |TIMELINE_CHPICK,
289 0, 0, rid, 0);
290 db_finalize(&q);
291 }
292
--- src/info.c
+++ src/info.c
@@ -282,10 +282,11 @@
282 }
283 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
284 db_prepare(&q, "%s", blob_sql_text(&sql));
285 www_print_timeline(&q,
286 TIMELINE_GRAPH
287 |TIMELINE_FILLGAPS
288 |TIMELINE_NOSCROLL
289 |TIMELINE_CHPICK,
290 0, 0, rid, 0);
291 db_finalize(&q);
292 }
293
+4 -3
--- src/timeline.c
+++ src/timeline.c
@@ -112,10 +112,11 @@
112112
#define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113113
#define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114114
#define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115115
#define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
116116
#define TIMELINE_CHPICK 0x400000 /* Show cherrypick merges */
117
+#define TIMELINE_FILLGAPS 0x800000 /* Dotted lines for missing nodes */
117118
#endif
118119
119120
/*
120121
** Hash a string and use the hash to determine a background color.
121122
*/
@@ -757,11 +758,11 @@
757758
}
758759
if( pendingEndTr ){
759760
@ </td></tr>
760761
}
761762
if( pGraph ){
762
- graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
763
+ graph_finish(pGraph, tmFlags);
763764
if( pGraph->nErr ){
764765
graph_free(pGraph);
765766
pGraph = 0;
766767
}else{
767768
@ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -1751,19 +1752,19 @@
17511752
&& db_open_local(0)
17521753
){
17531754
int iCurrent = db_lget_int("checkout",0);
17541755
char *zPerm = bisect_permalink();
17551756
bisect_create_bilog_table(iCurrent, 0);
1756
- tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1757
+ tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS;
17571758
zType = "ci";
17581759
disableY = 1;
17591760
style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm);
17601761
}else{
17611762
bisectLocal = 0;
17621763
}
17631764
if( zBisect!=0 && bisect_create_bilog_table(0, zBisect) ){
1764
- tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1765
+ tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS;
17651766
zType = "ci";
17661767
disableY = 1;
17671768
}else{
17681769
zBisect = 0;
17691770
}
17701771
--- src/timeline.c
+++ src/timeline.c
@@ -112,10 +112,11 @@
112 #define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113 #define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114 #define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x400000 /* Show cherrypick merges */
 
117 #endif
118
119 /*
120 ** Hash a string and use the hash to determine a background color.
121 */
@@ -757,11 +758,11 @@
757 }
758 if( pendingEndTr ){
759 @ </td></tr>
760 }
761 if( pGraph ){
762 graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
763 if( pGraph->nErr ){
764 graph_free(pGraph);
765 pGraph = 0;
766 }else{
767 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -1751,19 +1752,19 @@
1751 && db_open_local(0)
1752 ){
1753 int iCurrent = db_lget_int("checkout",0);
1754 char *zPerm = bisect_permalink();
1755 bisect_create_bilog_table(iCurrent, 0);
1756 tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1757 zType = "ci";
1758 disableY = 1;
1759 style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm);
1760 }else{
1761 bisectLocal = 0;
1762 }
1763 if( zBisect!=0 && bisect_create_bilog_table(0, zBisect) ){
1764 tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT;
1765 zType = "ci";
1766 disableY = 1;
1767 }else{
1768 zBisect = 0;
1769 }
1770
--- src/timeline.c
+++ src/timeline.c
@@ -112,10 +112,11 @@
112 #define TIMELINE_CLASSIC 0x010000 /* Use the "classic" view style */
113 #define TIMELINE_VIEWS 0x01f000 /* Mask for all of the view styles */
114 #define TIMELINE_NOSCROLL 0x100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x800000 /* Dotted lines for missing nodes */
118 #endif
119
120 /*
121 ** Hash a string and use the hash to determine a background color.
122 */
@@ -757,11 +758,11 @@
758 }
759 if( pendingEndTr ){
760 @ </td></tr>
761 }
762 if( pGraph ){
763 graph_finish(pGraph, tmFlags);
764 if( pGraph->nErr ){
765 graph_free(pGraph);
766 pGraph = 0;
767 }else{
768 @ <tr class="timelineBottom" id="btm-%d(iTableId)">\
@@ -1751,19 +1752,19 @@
1752 && db_open_local(0)
1753 ){
1754 int iCurrent = db_lget_int("checkout",0);
1755 char *zPerm = bisect_permalink();
1756 bisect_create_bilog_table(iCurrent, 0);
1757 tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS;
1758 zType = "ci";
1759 disableY = 1;
1760 style_submenu_element("Permalink", "%R/timeline?bid=%z", zPerm);
1761 }else{
1762 bisectLocal = 0;
1763 }
1764 if( zBisect!=0 && bisect_create_bilog_table(0, zBisect) ){
1765 tmFlags |= TIMELINE_UNHIDE | TIMELINE_BISECT | TIMELINE_FILLGAPS;
1766 zType = "ci";
1767 disableY = 1;
1768 }else{
1769 zBisect = 0;
1770 }
1771

Keyboard Shortcuts

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