Fossil SCM

Improved handling of timewarps in the graph layout.

drh 2019-06-08 18:29 trunk
Commit 628fc32dd3f594ac6669499a55c73193abbe740afc495d39842f5b34714d22e3
1 file changed +3 -1
+3 -1
--- src/graph.c
+++ src/graph.c
@@ -432,10 +432,11 @@
432432
u64 mask;
433433
int hasDup = 0; /* True if one or more isDup entries */
434434
const char *zTrunk;
435435
u8 *aMap; /* Copy of p->aiRailMap */
436436
int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
437
+ int nTimewarp = 0;
437438
438439
/* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
439440
** coming up from the bottom of the graph from off-screen check-in Y
440441
** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
441442
*/
@@ -524,10 +525,11 @@
524525
pParent = hashFind(p, pRow->aParent[0]);
525526
if( pParent==0 ) continue; /* Parent off-screen */
526527
if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
527528
if( pParent->idx <= pRow->idx ){
528529
pParent->timeWarp = 1;
530
+ nTimewarp++;
529531
}else if( pRow->idxTop < pParent->idxTop ){
530532
pParent->pChild = pRow;
531533
pParent->idxTop = pRow->idxTop;
532534
}
533535
}
@@ -736,11 +738,11 @@
736738
/*
737739
** Compute the rail mapping.
738740
*/
739741
aMap = p->aiRailMap;
740742
for(i=0; i<=p->mxRail; i++) aMap[i] = i;
741
- if( zLeftBranch ){
743
+ if( zLeftBranch && nTimewarp==0 ){
742744
char *zLeft = persistBranchName(p, zLeftBranch);
743745
j = 0;
744746
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
745747
if( pRow->zBranch==zLeft && aMap[pRow->iRail]>=j ){
746748
for(i=0; i<=p->mxRail; i++){
747749
--- src/graph.c
+++ src/graph.c
@@ -432,10 +432,11 @@
432 u64 mask;
433 int hasDup = 0; /* True if one or more isDup entries */
434 const char *zTrunk;
435 u8 *aMap; /* Copy of p->aiRailMap */
436 int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
 
437
438 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
439 ** coming up from the bottom of the graph from off-screen check-in Y
440 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
441 */
@@ -524,10 +525,11 @@
524 pParent = hashFind(p, pRow->aParent[0]);
525 if( pParent==0 ) continue; /* Parent off-screen */
526 if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
527 if( pParent->idx <= pRow->idx ){
528 pParent->timeWarp = 1;
 
529 }else if( pRow->idxTop < pParent->idxTop ){
530 pParent->pChild = pRow;
531 pParent->idxTop = pRow->idxTop;
532 }
533 }
@@ -736,11 +738,11 @@
736 /*
737 ** Compute the rail mapping.
738 */
739 aMap = p->aiRailMap;
740 for(i=0; i<=p->mxRail; i++) aMap[i] = i;
741 if( zLeftBranch ){
742 char *zLeft = persistBranchName(p, zLeftBranch);
743 j = 0;
744 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
745 if( pRow->zBranch==zLeft && aMap[pRow->iRail]>=j ){
746 for(i=0; i<=p->mxRail; i++){
747
--- src/graph.c
+++ src/graph.c
@@ -432,10 +432,11 @@
432 u64 mask;
433 int hasDup = 0; /* True if one or more isDup entries */
434 const char *zTrunk;
435 u8 *aMap; /* Copy of p->aiRailMap */
436 int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
437 int nTimewarp = 0;
438
439 /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
440 ** coming up from the bottom of the graph from off-screen check-in Y
441 ** where Y is the RID. There is no riser on rail X if mergeRiserFrom[X]==0.
442 */
@@ -524,10 +525,11 @@
525 pParent = hashFind(p, pRow->aParent[0]);
526 if( pParent==0 ) continue; /* Parent off-screen */
527 if( pParent->zBranch!=pRow->zBranch ) continue; /* Different branch */
528 if( pParent->idx <= pRow->idx ){
529 pParent->timeWarp = 1;
530 nTimewarp++;
531 }else if( pRow->idxTop < pParent->idxTop ){
532 pParent->pChild = pRow;
533 pParent->idxTop = pRow->idxTop;
534 }
535 }
@@ -736,11 +738,11 @@
738 /*
739 ** Compute the rail mapping.
740 */
741 aMap = p->aiRailMap;
742 for(i=0; i<=p->mxRail; i++) aMap[i] = i;
743 if( zLeftBranch && nTimewarp==0 ){
744 char *zLeft = persistBranchName(p, zLeftBranch);
745 j = 0;
746 for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
747 if( pRow->zBranch==zLeft && aMap[pRow->iRail]>=j ){
748 for(i=0; i<=p->mxRail; i++){
749

Keyboard Shortcuts

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