Fossil: Check-in [d19df6161f]

Fossil SCM

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

Overview
Comment:Improved computation of the rail mapper for timelines on a branch. If the branch is across two or more rails, then all rails of that branch are moved to the left as far as practical.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d19df6161f01cea674a035eef4c9428c9ebc26aa08d5cfc88458803c83d68a3f
User & Date: drh 2019-05-21 19:04:50
Context
2019-05-23
06:44
Since libressl abuses OPENSSL_VERSION_NUMBER, don't let fossil being confused by that. check-in: 5c40d6b0d4 user: jan.nijtmans tags: trunk
2019-05-21
19:07
Merge graph layout enhancements from trunk. check-in: 980adfa6bd user: drh tags: tooltip-experiments
19:04
Improved computation of the rail mapper for timelines on a branch. If the branch is across two or more rails, then all rails of that branch are moved to the left as far as practical. check-in: d19df6161f user: drh tags: trunk
18:35
Improved layout for merge arrows. check-in: e008e051cd user: drh tags: trunk
Changes

Changes to src/graph.c.

426
427
428
429
430
431
432

433
434
435
436
437
438
439
...
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742

743
744
745
746
*/
void graph_finish(GraphContext *p, const char *zLeftBranch, u32 tmFlags){
  GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent;
  int i, j;
  u64 mask;
  int hasDup = 0;      /* True if one or more isDup entries */
  const char *zTrunk;

  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];
................................................................................
  ** Find the maximum rail number.
  */
  find_max_rail(p);

  /*
  ** Compute the rail mapping.
  */
  for(i=0; i<=p->mxRail; i++) p->aiRailMap[i] = i;
  if( zLeftBranch ){
    char *zLeft = persistBranchName(p, zLeftBranch);
    for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
      if( pRow->zBranch==zLeft ){
        int iLeftRail = pRow->iRail;
        p->aiRailMap[iLeftRail] = 0;
        for(i=0, j=1; i<=p->mxRail; i++){
          if( i==iLeftRail ) continue;
          p->aiRailMap[i] = j++;
        }
        assert( j==p->mxRail+1 );
        break;
      }
    }

  }

  p->nErr = 0;
}







>







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>




426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
...
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
*/
void graph_finish(GraphContext *p, const char *zLeftBranch, u32 tmFlags){
  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];
................................................................................
  ** Find the maximum rail number.
  */
  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]++;
        }
        aMap[pRow->iRail] = j++;
      }
    }
    cgi_printf("<!-- aiRailMap =");
    for(i=0; i<=p->mxRail; i++) cgi_printf(" %d", aMap[i]);
    cgi_printf(" -->\n");
  }

  p->nErr = 0;
}