Fossil

Check-in [628fc32d]
Login

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

Overview
Comment:Improved handling of timewarps in the graph layout.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 628fc32dd3f594ac6669499a55c73193abbe740afc495d39842f5b34714d22e3
User & Date: drh 2019-06-08 18:29:12
Context
2019-06-10
01:32
Copy button comes before the hyperlink in tooltips. check-in: 9a5169f5 user: drh tags: trunk
2019-06-08
18:29
Improved handling of timewarps in the graph layout. check-in: 628fc32d user: drh tags: trunk
16:11
Fix to the graph layout for complex time-warp cases. Add tooltips to timewarp arrows. check-in: 5399c5da user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.c.

430
431
432
433
434
435
436

437
438
439
440
441
442
443
...
522
523
524
525
526
527
528

529
530
531
532
533
534
535
...
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
  GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
  int i, j;
  u64 mask;
  int hasDup = 0;      /* True if one or more isDup entries */
  const char *zTrunk;
  u8 *aMap;            /* Copy of p->aiRailMap */
  int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;


  /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
  ** coming up from the bottom of the graph from off-screen check-in Y
  ** where Y is the RID.  There is no riser on rail X if mergeRiserFrom[X]==0.
  */
  int mergeRiserFrom[GR_MAX_RAIL];

................................................................................
    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 ){
................................................................................
  find_max_rail(p);

  /*
  ** Compute the rail mapping.
  */
  aMap = p->aiRailMap;
  for(i=0; i<=p->mxRail; i++) aMap[i] = i;
  if( zLeftBranch ){
    char *zLeft = persistBranchName(p, zLeftBranch);
    j = 0;
    for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
      if( pRow->zBranch==zLeft && aMap[pRow->iRail]>=j ){
        for(i=0; i<=p->mxRail; i++){
          if( aMap[i]>=j && aMap[i]<=pRow->iRail ) aMap[i]++;
        }







>







 







>







 







|







430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
...
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
...
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
  GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
  int i, j;
  u64 mask;
  int hasDup = 0;      /* True if one or more isDup entries */
  const char *zTrunk;
  u8 *aMap;            /* Copy of p->aiRailMap */
  int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
  int nTimewarp = 0;

  /* If mergeRiserFrom[X]==Y that means rail X holds a merge riser
  ** coming up from the bottom of the graph from off-screen check-in Y
  ** where Y is the RID.  There is no riser on rail X if mergeRiserFrom[X]==0.
  */
  int mergeRiserFrom[GR_MAX_RAIL];

................................................................................
    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;
      nTimewarp++;
    }else if( pRow->idxTop < pParent->idxTop ){
      pParent->pChild = pRow;
      pParent->idxTop = pRow->idxTop;
    }
  }

  if( tmFlags & TIMELINE_FILLGAPS ){
................................................................................
  find_max_rail(p);

  /*
  ** Compute the rail mapping.
  */
  aMap = p->aiRailMap;
  for(i=0; i<=p->mxRail; i++) aMap[i] = i;
  if( zLeftBranch && nTimewarp==0 ){
    char *zLeft = persistBranchName(p, zLeftBranch);
    j = 0;
    for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
      if( pRow->zBranch==zLeft && aMap[pRow->iRail]>=j ){
        for(i=0; i<=p->mxRail; i++){
          if( aMap[i]>=j && aMap[i]<=pRow->iRail ) aMap[i]++;
        }