Fossil SCM

Fix to the graph layout algorithm so that forks try to stay to the same rail, as they did in prior releases.

drh 2019-05-20 22:05 trunk
Commit 7193681a84017eaad1ab6138f8be3b5019663c43c28ea847b1a9e158b0563d67
2 files changed +5 -4 +10 -1
+5 -4
--- src/graph.c
+++ src/graph.c
@@ -516,19 +516,20 @@
516516
pParent = hashFind(p, pRow->aParent[0]);
517517
if( pParent==0 ) continue; /* Parent off-screen */
518518
if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
519519
if( pParent->idx <= pRow->idx ){
520520
pParent->timeWarp = 1;
521
- }else if( pRow->idx < pParent->idx ){
521
+ }else if( pRow->idxTop < pParent->idxTop ){
522522
pParent->pChild = pRow;
523
+ pParent->idxTop = pRow->idxTop;
523524
}
524525
}
525526
526527
if( tmFlags & TIMELINE_FILLGAPS ){
527
- /* If a node has no pChild but there is a node higher up in the graph
528
- ** that is in the same branch and that other node has no parent in
529
- ** the graph, the lower node a step-child of the upper node. This will
528
+ /* If a node has no pChild and there is a node higher up in the graph
529
+ ** that is in the same branch and has no in-graph parent, then
530
+ ** make the lower node a step-child of the upper node. This will
530531
** be represented on the graph by a thick dotted line without an arrowhead.
531532
*/
532533
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
533534
if( pRow->pChild ) continue;
534535
for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
535536
--- src/graph.c
+++ src/graph.c
@@ -516,19 +516,20 @@
516 pParent = hashFind(p, pRow->aParent[0]);
517 if( pParent==0 ) continue; /* Parent off-screen */
518 if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
519 if( pParent->idx <= pRow->idx ){
520 pParent->timeWarp = 1;
521 }else if( pRow->idx < pParent->idx ){
522 pParent->pChild = pRow;
 
523 }
524 }
525
526 if( tmFlags & TIMELINE_FILLGAPS ){
527 /* If a node has no pChild but there is a node higher up in the graph
528 ** that is in the same branch and that other node has no parent in
529 ** the graph, the lower node a step-child of the upper node. This will
530 ** be represented on the graph by a thick dotted line without an arrowhead.
531 */
532 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
533 if( pRow->pChild ) continue;
534 for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
535
--- src/graph.c
+++ src/graph.c
@@ -516,19 +516,20 @@
516 pParent = hashFind(p, pRow->aParent[0]);
517 if( pParent==0 ) continue; /* Parent off-screen */
518 if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
519 if( pParent->idx <= pRow->idx ){
520 pParent->timeWarp = 1;
521 }else if( pRow->idxTop < pParent->idxTop ){
522 pParent->pChild = pRow;
523 pParent->idxTop = pRow->idxTop;
524 }
525 }
526
527 if( tmFlags & TIMELINE_FILLGAPS ){
528 /* If a node has no pChild and there is a node higher up in the graph
529 ** that is in the same branch and has no in-graph parent, then
530 ** make the lower node a step-child of the upper node. This will
531 ** be represented on the graph by a thick dotted line without an arrowhead.
532 */
533 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
534 if( pRow->pChild ) continue;
535 for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
536
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -90,11 +90,17 @@
9090
Mixed merge arrow, partly fully and partly cherrypick</a>
9191
* <a href="../../../timeline?b=dc81ac70&n=13" target="testwindow">
9292
Mixed merge arrow to bottom of screen.</a>
9393
* <a href="../../../timeline?b=4471e93c&n=12" target="testwindow">
9494
A fork on trunk keeps the longest chain of child nodes directly
95
- above the fork and the shorter chain off to the side.
95
+ above the fork and the shorter chain off to the side.</a>
96
+ * <a href="../../../timeline?r=jan-manifest-tags&n=50" target="testwindow">
97
+ The "jan-manifest-tags" branch containing a non-trunk fork</a>
98
+ * <a href="../../../timeline?r=diff-eolws&n=50" target="testwindow">
99
+ The "diff-eolws" branch containing a non-trunk fork</a>
100
+ * <a href="../../../timeline?n=all&forks" target="testwindow">
101
+ All forks</a>
96102
97103
External:
98104
99105
* <a href="http://www.sqlite.org/src/timeline?c=2010-09-29&nd"
100106
target="testwindow">Timewarp due to a mis-configured system clock.</a>
@@ -105,5 +111,8 @@
105111
target='testwindow'>Merge arrows to the left and to the right</a>
106112
* <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=13'
107113
target='testwindow'>Previous, with a scrunched graph</a>
108114
* <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=11'
109115
target='testwindow'>Previous, with a severely scrunched graph</a>
116
+ * <a href="https://sqlite.org/src/timeline?r=wal&n=1000"
117
+ target='testwindow'>The "wal" branch SQLite repository, containing
118
+ multiple non-trunk forks.</a>
110119
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -90,11 +90,17 @@
90 Mixed merge arrow, partly fully and partly cherrypick</a>
91 * <a href="../../../timeline?b=dc81ac70&n=13" target="testwindow">
92 Mixed merge arrow to bottom of screen.</a>
93 * <a href="../../../timeline?b=4471e93c&n=12" target="testwindow">
94 A fork on trunk keeps the longest chain of child nodes directly
95 above the fork and the shorter chain off to the side.
 
 
 
 
 
 
96
97 External:
98
99 * <a href="http://www.sqlite.org/src/timeline?c=2010-09-29&nd"
100 target="testwindow">Timewarp due to a mis-configured system clock.</a>
@@ -105,5 +111,8 @@
105 target='testwindow'>Merge arrows to the left and to the right</a>
106 * <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=13'
107 target='testwindow'>Previous, with a scrunched graph</a>
108 * <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=11'
109 target='testwindow'>Previous, with a severely scrunched graph</a>
 
 
 
110
--- test/graph-test-1.wiki
+++ test/graph-test-1.wiki
@@ -90,11 +90,17 @@
90 Mixed merge arrow, partly fully and partly cherrypick</a>
91 * <a href="../../../timeline?b=dc81ac70&n=13" target="testwindow">
92 Mixed merge arrow to bottom of screen.</a>
93 * <a href="../../../timeline?b=4471e93c&n=12" target="testwindow">
94 A fork on trunk keeps the longest chain of child nodes directly
95 above the fork and the shorter chain off to the side.</a>
96 * <a href="../../../timeline?r=jan-manifest-tags&n=50" target="testwindow">
97 The "jan-manifest-tags" branch containing a non-trunk fork</a>
98 * <a href="../../../timeline?r=diff-eolws&n=50" target="testwindow">
99 The "diff-eolws" branch containing a non-trunk fork</a>
100 * <a href="../../../timeline?n=all&forks" target="testwindow">
101 All forks</a>
102
103 External:
104
105 * <a href="http://www.sqlite.org/src/timeline?c=2010-09-29&nd"
106 target="testwindow">Timewarp due to a mis-configured system clock.</a>
@@ -105,5 +111,8 @@
111 target='testwindow'>Merge arrows to the left and to the right</a>
112 * <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=13'
113 target='testwindow'>Previous, with a scrunched graph</a>
114 * <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=11'
115 target='testwindow'>Previous, with a severely scrunched graph</a>
116 * <a href="https://sqlite.org/src/timeline?r=wal&n=1000"
117 target='testwindow'>The "wal" branch SQLite repository, containing
118 multiple non-trunk forks.</a>
119

Keyboard Shortcuts

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