Fossil

Check-in [8b1e14df]
Login

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

Overview
Comment:When displaying the graph for a branch such that the rail for that branch is on the left margin, try to draw merge lines coming into that branch on rails just to the right of the branch itself.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8b1e14df0b02c73c4c60d5d40332fad87c59ab7c9e4664ca98666952f4ad8b64
User & Date: drh 2022-03-07 20:00:30
Context
2022-03-07
21:01
Fix very minor comment typos. ... (check-in: 680837fa user: drh tags: trunk)
20:00
When displaying the graph for a branch such that the rail for that branch is on the left margin, try to draw merge lines coming into that branch on rails just to the right of the branch itself. ... (check-in: 8b1e14df user: drh tags: trunk)
19:01
Update to the latest SQLite 3.39.0 alpha with its performance enhancements and bug fixes. ... (check-in: 14da62ee user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/graph.c.

838
839
840
841
842
843
844
845



846
847
848
849
850


851
852

853
854




855
856
857
858
859










860
861
862
863
864
865
866

  /*
  ** 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 && 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]++;
        }
        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;
}







|
>
>
>





>
>


>
|

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







838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886

  /*
  ** Find the maximum rail number.
  */
  find_max_rail(p);

  /*
  ** Compute the rail mapping that tries to put the branch named
  ** zLeftBranch at the left margin.
  **
  ** aMap[X]=Y means that the X-th rail is drawn as the Y-th rail.
  */
  aMap = p->aiRailMap;
  for(i=0; i<=p->mxRail; i++) aMap[i] = i;
  if( zLeftBranch && nTimewarp==0 ){
    char *zLeft = persistBranchName(p, zLeftBranch);
    u64 pureMergeRail = (BIT(p->mxRail)-1)<<1|1;
    u64 toLeft = 0;
    j = 0;
    for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
      pureMergeRail &= ~BIT(pRow->iRail);
      if( pRow->zBranch==zLeft ){
        for(i=0; i<=p->mxRail; i++){
          if( pRow->mergeIn[i] ) toLeft |= BIT(i);
        }
        if( 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++;
        }
      }
    }
    toLeft &= pureMergeRail;
    for(i=j; i<=p->mxRail; i++){
      int k;
      if( (BIT(i) & toLeft)==0 ) continue;
      for(k=0; k<=p->mxRail; k++){
        if( aMap[k]>=j && aMap[k]<=i ) aMap[k]++;
      }
      aMap[i] = j;
    }    
    cgi_printf("<!-- aiRailMap =");
    for(i=0; i<=p->mxRail; i++) cgi_printf(" %d", aMap[i]);
    cgi_printf(" -->\n");
  }

  p->nErr = 0;
}