Fossil

Check-in [7193681a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix to the graph layout algorithm so that forks try to stay to the same rail, as they did in prior releases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7193681a84017eaad1ab6138f8be3b5019663c43c28ea847b1a9e158b0563d67
User & Date: drh 2019-05-20 22:05:16
Context
2019-05-21
17:59
For timelines with the r= query parameter for a particular branch, try to draw that branch on the far left. check-in: 51510bfc user: drh tags: trunk
2019-05-20
22:47
For timelines of a particular branch, try to put the target branch on the left side of the graph, before "trunk". Trunk comes second. Closed-Leaf check-in: b39d8d69 user: drh tags: selected-branch-on-left
22:05
Fix to the graph layout algorithm so that forks try to stay to the same rail, as they did in prior releases. check-in: 7193681a user: drh tags: trunk
20:33
Add a new test case to the graph-test-1.wiki file that verifies that when a fork occurs, the longest chain of check-ins occurs directly above the fork. That test case is currently failing and needs to be fixed. check-in: cfadf71f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.c.

514
515
516
517
518
519
520
521
522

523
524
525
526
527
528
529
530
531
532
533
534
535
536
    if( pRow->isDup ) continue;
    if( pRow->nParent<=0 ) continue;                   /* Root node */
    pParent = hashFind(p, pRow->aParent[0]);
    if( pParent==0 ) continue;                         /* Parent off-screen */
    if( pParent->zBranch!=pRow->zBranch ) continue;    /* Different branch */
    if( pParent->idx <= pRow->idx ){
      pParent->timeWarp = 1;
    }else if( pRow->idx < pParent->idx ){
      pParent->pChild = pRow;

    }
  }

  if( tmFlags & TIMELINE_FILLGAPS ){
    /* If a node has no pChild but there is a node higher up in the graph
    ** that is in the same branch and that other node has no parent in
    ** the graph, the lower node a step-child of the upper node.  This will
    ** be represented on the graph by a thick dotted line without an arrowhead.
    */
    for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
      if( pRow->pChild ) continue;
      for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
        if( pLoop->nParent>0
         && pLoop->zBranch==pRow->zBranch







|

>




|
|
|







514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
    if( pRow->isDup ) continue;
    if( pRow->nParent<=0 ) continue;                   /* Root node */
    pParent = hashFind(p, pRow->aParent[0]);
    if( pParent==0 ) continue;                         /* Parent off-screen */
    if( pParent->zBranch!=pRow->zBranch ) continue;    /* Different branch */
    if( pParent->idx <= pRow->idx ){
      pParent->timeWarp = 1;
    }else if( pRow->idxTop < pParent->idxTop ){
      pParent->pChild = pRow;
      pParent->idxTop = pRow->idxTop;
    }
  }

  if( tmFlags & TIMELINE_FILLGAPS ){
    /* If a node has no pChild and there is a node higher up in the graph
    ** that is in the same branch and has no in-graph parent, then
    ** make the lower node a step-child of the upper node.  This will
    ** be represented on the graph by a thick dotted line without an arrowhead.
    */
    for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
      if( pRow->pChild ) continue;
      for(pLoop=pRow->pPrev; pLoop; pLoop=pLoop->pPrev){
        if( pLoop->nParent>0
         && pLoop->zBranch==pRow->zBranch

Changes to test/graph-test-1.wiki.

88
89
90
91
92
93
94
95






96
97
98
99
100
101
102
...
103
104
105
106
107
108
109



     Single check-in takes both a full merge and a cherrypick merge</a>
  *  <a href="../../../timeline?b=dc81ac70&n=14" target="testwindow">
     Mixed merge arrow, partly fully and partly cherrypick</a>
  *  <a href="../../../timeline?b=dc81ac70&n=13" target="testwindow">
     Mixed merge arrow to bottom of screen.</a>
  *  <a href="../../../timeline?b=4471e93c&n=12" target="testwindow">
     A fork on trunk keeps the longest chain of child nodes directly
     above the fork and the shorter chain off to the side.







External:

  *  <a href="http://www.sqlite.org/src/timeline?c=2010-09-29&nd"
     target="testwindow">Timewarp due to a mis-configured system clock.</a>
  *  <a href="http://core.tcl.tk/tk/finfo?name=tests/id.test"
     target="testwindow">Show all three separate deletions of "id.test".
................................................................................
     (Scroll down for the third deletion.)
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07'
     target='testwindow'>Merge arrows to the left and to the right</a>
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=13'
     target='testwindow'>Previous, with a scrunched graph</a>
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=11'
     target='testwindow'>Previous, with a severely scrunched graph</a>










|
>
>
>
>
>
>







 







>
>
>
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
109
110
111
112
113
114
115
116
117
118
     Single check-in takes both a full merge and a cherrypick merge</a>
  *  <a href="../../../timeline?b=dc81ac70&n=14" target="testwindow">
     Mixed merge arrow, partly fully and partly cherrypick</a>
  *  <a href="../../../timeline?b=dc81ac70&n=13" target="testwindow">
     Mixed merge arrow to bottom of screen.</a>
  *  <a href="../../../timeline?b=4471e93c&n=12" target="testwindow">
     A fork on trunk keeps the longest chain of child nodes directly
     above the fork and the shorter chain off to the side.</a>
  *  <a href="../../../timeline?r=jan-manifest-tags&n=50" target="testwindow">
     The "jan-manifest-tags" branch containing a non-trunk fork</a>
  *  <a href="../../../timeline?r=diff-eolws&n=50" target="testwindow">
     The "diff-eolws" branch containing a non-trunk fork</a>
  *  <a href="../../../timeline?n=all&forks" target="testwindow">
     All forks</a>

External:

  *  <a href="http://www.sqlite.org/src/timeline?c=2010-09-29&nd"
     target="testwindow">Timewarp due to a mis-configured system clock.</a>
  *  <a href="http://core.tcl.tk/tk/finfo?name=tests/id.test"
     target="testwindow">Show all three separate deletions of "id.test".
................................................................................
     (Scroll down for the third deletion.)
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07'
     target='testwindow'>Merge arrows to the left and to the right</a>
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=13'
     target='testwindow'>Previous, with a scrunched graph</a>
  *  <a href='http://core.tcl.tk/tk/timeline?y=ci&b=2015-03-07&railpitch=11'
     target='testwindow'>Previous, with a severely scrunched graph</a>
  *  <a href="https://sqlite.org/src/timeline?r=wal&n=1000"
     target='testwindow'>The "wal" branch SQLite repository, containing
     multiple non-trunk forks.</a>