Fossil SCM
Further refinements to the graph layout for file histories.
Commit
1f607de1db8a9a30bc7accab4c107b15410ff862
Parent
6ea10c5e990d2e6…
1 file changed
+3
-4
+3
-4
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -206,11 +206,10 @@ | ||
| 206 | 206 | } |
| 207 | 207 | for(i=0; i<32; i++){ |
| 208 | 208 | if( (inUseMask & (1<<i))==0 ){ |
| 209 | 209 | int dist; |
| 210 | 210 | if( iNearto<=0 ){ |
| 211 | - if( i>p->mxRail ) p->mxRail = i; | |
| 212 | 211 | return i; |
| 213 | 212 | } |
| 214 | 213 | dist = i - iNearto; |
| 215 | 214 | if( dist<0 ) dist = -dist; |
| 216 | 215 | if( dist<iBestDist ){ |
| @@ -218,11 +217,10 @@ | ||
| 218 | 217 | iBest = i; |
| 219 | 218 | } |
| 220 | 219 | } |
| 221 | 220 | } |
| 222 | 221 | if( iBestDist>1000 ) p->nErr++; |
| 223 | - if( iBest>p->mxRail ) p->mxRail = iBest; | |
| 224 | 222 | return iBest; |
| 225 | 223 | } |
| 226 | 224 | |
| 227 | 225 | /* |
| 228 | 226 | ** Compute the complete graph |
| @@ -261,18 +259,19 @@ | ||
| 261 | 259 | } |
| 262 | 260 | } |
| 263 | 261 | } |
| 264 | 262 | |
| 265 | 263 | /* Figure out which nodes have no direct children (children on |
| 266 | - ** the same rail). Mark such nodes is isLeaf. | |
| 264 | + ** the same rail). Mark such nodes as isLeaf. | |
| 267 | 265 | */ |
| 268 | 266 | memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash); |
| 269 | 267 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1; |
| 270 | 268 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 271 | 269 | GraphRow *pParent; |
| 272 | 270 | hashInsert(p, pRow, 0); |
| 273 | - if( pRow->nParent>0 | |
| 271 | + if( !pRow->isDup | |
| 272 | + && pRow->nParent>0 | |
| 274 | 273 | && (pParent = hashFind(p, pRow->aParent[0]))!=0 |
| 275 | 274 | && pRow->zBranch==pParent->zBranch |
| 276 | 275 | ){ |
| 277 | 276 | pParent->isLeaf = 0; |
| 278 | 277 | } |
| 279 | 278 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -206,11 +206,10 @@ | |
| 206 | } |
| 207 | for(i=0; i<32; i++){ |
| 208 | if( (inUseMask & (1<<i))==0 ){ |
| 209 | int dist; |
| 210 | if( iNearto<=0 ){ |
| 211 | if( i>p->mxRail ) p->mxRail = i; |
| 212 | return i; |
| 213 | } |
| 214 | dist = i - iNearto; |
| 215 | if( dist<0 ) dist = -dist; |
| 216 | if( dist<iBestDist ){ |
| @@ -218,11 +217,10 @@ | |
| 218 | iBest = i; |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | if( iBestDist>1000 ) p->nErr++; |
| 223 | if( iBest>p->mxRail ) p->mxRail = iBest; |
| 224 | return iBest; |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | ** Compute the complete graph |
| @@ -261,18 +259,19 @@ | |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | /* Figure out which nodes have no direct children (children on |
| 266 | ** the same rail). Mark such nodes is isLeaf. |
| 267 | */ |
| 268 | memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash); |
| 269 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1; |
| 270 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 271 | GraphRow *pParent; |
| 272 | hashInsert(p, pRow, 0); |
| 273 | if( pRow->nParent>0 |
| 274 | && (pParent = hashFind(p, pRow->aParent[0]))!=0 |
| 275 | && pRow->zBranch==pParent->zBranch |
| 276 | ){ |
| 277 | pParent->isLeaf = 0; |
| 278 | } |
| 279 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -206,11 +206,10 @@ | |
| 206 | } |
| 207 | for(i=0; i<32; i++){ |
| 208 | if( (inUseMask & (1<<i))==0 ){ |
| 209 | int dist; |
| 210 | if( iNearto<=0 ){ |
| 211 | return i; |
| 212 | } |
| 213 | dist = i - iNearto; |
| 214 | if( dist<0 ) dist = -dist; |
| 215 | if( dist<iBestDist ){ |
| @@ -218,11 +217,10 @@ | |
| 217 | iBest = i; |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | if( iBestDist>1000 ) p->nErr++; |
| 222 | return iBest; |
| 223 | } |
| 224 | |
| 225 | /* |
| 226 | ** Compute the complete graph |
| @@ -261,18 +259,19 @@ | |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /* Figure out which nodes have no direct children (children on |
| 264 | ** the same rail). Mark such nodes as isLeaf. |
| 265 | */ |
| 266 | memset(p->apHash, 0, sizeof(p->apHash[0])*p->nHash); |
| 267 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev) pRow->isLeaf = 1; |
| 268 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 269 | GraphRow *pParent; |
| 270 | hashInsert(p, pRow, 0); |
| 271 | if( !pRow->isDup |
| 272 | && pRow->nParent>0 |
| 273 | && (pParent = hashFind(p, pRow->aParent[0]))!=0 |
| 274 | && pRow->zBranch==pParent->zBranch |
| 275 | ){ |
| 276 | pParent->isLeaf = 0; |
| 277 | } |
| 278 |