Fossil SCM

Minor bug fixes in the new merge-riser coalescing logic of the graph generator.

drh 2020-06-08 18:13 trunk
Commit 7688673a8e0bd805bdb4e6a1ebcea7d7534d66415a6fae730d688f29e17f457f
2 files changed +9 -3 +1 -1
+9 -3
--- src/graph.c
+++ src/graph.c
@@ -728,12 +728,15 @@
728728
int iReuseRail = -1;
729729
int isCherrypick = 0;
730730
for(i=1; i<pRow->nParent; i++){
731731
int parentRid = pRow->aParent[i];
732732
if( i==pRow->nNonCherrypick ){
733
- iReuseIdx = -1;
734
- iReuseRail = -1;
733
+ /* Because full merges are laid out before cherrypicks,
734
+ ** it is ok to use a full-merge raise for a cherrypick.
735
+ ** See the graph on check-in 8ac66ef33b464d28 for example
736
+ ** iReuseIdx = -1;
737
+ ** iReuseRail = -1; */
735738
isCherrypick = 1;
736739
}
737740
pDesc = hashFind(p, parentRid);
738741
if( pDesc==0 ){
739742
/* Merge from a node that is off-screen */
@@ -780,11 +783,14 @@
780783
}
781784
}else{
782785
/* Create a new merge for an on-screen node */
783786
createMergeRiser(p, pDesc, pRow, isCherrypick);
784787
if( p->mxRail>=GR_MAX_RAIL ) return;
785
- if( iReuseIdx<0 && pDesc->nMergeChild==1 ){
788
+ if( iReuseIdx<0
789
+ && pDesc->nMergeChild==1
790
+ && (pDesc->iRail!=pDesc->mergeOut || pDesc->isLeaf)
791
+ ){
786792
iReuseIdx = pDesc->idx;
787793
iReuseRail = pDesc->mergeOut;
788794
}
789795
}
790796
}
791797
--- src/graph.c
+++ src/graph.c
@@ -728,12 +728,15 @@
728 int iReuseRail = -1;
729 int isCherrypick = 0;
730 for(i=1; i<pRow->nParent; i++){
731 int parentRid = pRow->aParent[i];
732 if( i==pRow->nNonCherrypick ){
733 iReuseIdx = -1;
734 iReuseRail = -1;
 
 
 
735 isCherrypick = 1;
736 }
737 pDesc = hashFind(p, parentRid);
738 if( pDesc==0 ){
739 /* Merge from a node that is off-screen */
@@ -780,11 +783,14 @@
780 }
781 }else{
782 /* Create a new merge for an on-screen node */
783 createMergeRiser(p, pDesc, pRow, isCherrypick);
784 if( p->mxRail>=GR_MAX_RAIL ) return;
785 if( iReuseIdx<0 && pDesc->nMergeChild==1 ){
 
 
 
786 iReuseIdx = pDesc->idx;
787 iReuseRail = pDesc->mergeOut;
788 }
789 }
790 }
791
--- src/graph.c
+++ src/graph.c
@@ -728,12 +728,15 @@
728 int iReuseRail = -1;
729 int isCherrypick = 0;
730 for(i=1; i<pRow->nParent; i++){
731 int parentRid = pRow->aParent[i];
732 if( i==pRow->nNonCherrypick ){
733 /* Because full merges are laid out before cherrypicks,
734 ** it is ok to use a full-merge raise for a cherrypick.
735 ** See the graph on check-in 8ac66ef33b464d28 for example
736 ** iReuseIdx = -1;
737 ** iReuseRail = -1; */
738 isCherrypick = 1;
739 }
740 pDesc = hashFind(p, parentRid);
741 if( pDesc==0 ){
742 /* Merge from a node that is off-screen */
@@ -780,11 +783,14 @@
783 }
784 }else{
785 /* Create a new merge for an on-screen node */
786 createMergeRiser(p, pDesc, pRow, isCherrypick);
787 if( p->mxRail>=GR_MAX_RAIL ) return;
788 if( iReuseIdx<0
789 && pDesc->nMergeChild==1
790 && (pDesc->iRail!=pDesc->mergeOut || pDesc->isLeaf)
791 ){
792 iReuseIdx = pDesc->idx;
793 iReuseRail = pDesc->mergeOut;
794 }
795 }
796 }
797
+1 -1
--- src/graph.js
+++ src/graph.js
@@ -442,11 +442,11 @@
442442
cls = "arrow cherrypick " + (x1<x0 ? "l" : "r");
443443
}else{
444444
drawMergeLine(x0,y0,x1+dx,null);
445445
cls = "arrow merge " + (x1<x0 ? "l" : "r");
446446
}
447
- if( p.mu==p.cu ){
447
+ if( !isCP || p.mu==p.cu ){
448448
dx = x1<x0 ? mLine.w : -(mArrow.w + mLine.w/2);
449449
drawBox(cls,null,x1+dx,y0+(mLine.w-mArrow.h)/2);
450450
}
451451
y1 = y0;
452452
}else{
453453
--- src/graph.js
+++ src/graph.js
@@ -442,11 +442,11 @@
442 cls = "arrow cherrypick " + (x1<x0 ? "l" : "r");
443 }else{
444 drawMergeLine(x0,y0,x1+dx,null);
445 cls = "arrow merge " + (x1<x0 ? "l" : "r");
446 }
447 if( p.mu==p.cu ){
448 dx = x1<x0 ? mLine.w : -(mArrow.w + mLine.w/2);
449 drawBox(cls,null,x1+dx,y0+(mLine.w-mArrow.h)/2);
450 }
451 y1 = y0;
452 }else{
453
--- src/graph.js
+++ src/graph.js
@@ -442,11 +442,11 @@
442 cls = "arrow cherrypick " + (x1<x0 ? "l" : "r");
443 }else{
444 drawMergeLine(x0,y0,x1+dx,null);
445 cls = "arrow merge " + (x1<x0 ? "l" : "r");
446 }
447 if( !isCP || p.mu==p.cu ){
448 dx = x1<x0 ? mLine.w : -(mArrow.w + mLine.w/2);
449 drawBox(cls,null,x1+dx,y0+(mLine.w-mArrow.h)/2);
450 }
451 y1 = y0;
452 }else{
453

Keyboard Shortcuts

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