Fossil SCM
On the timeline graph, strive to put the "trunk" to the far left.
Commit
4c931047ef0cea5b0e06f0e3a43f482a8db80d3a
Parent
b24b2e1bba681bc…
1 file changed
+24
-15
+24
-15
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -235,10 +235,11 @@ | ||
| 235 | 235 | GraphRow *pRow, *pDesc, *pDup, *pLoop; |
| 236 | 236 | int i; |
| 237 | 237 | u32 mask; |
| 238 | 238 | u32 inUse; |
| 239 | 239 | int hasDup = 0; /* True if one or more isDup entries */ |
| 240 | + const char *zTrunk; | |
| 240 | 241 | |
| 241 | 242 | if( p==0 || p->pFirst==0 || p->nErr ) return; |
| 242 | 243 | |
| 243 | 244 | /* Initialize all rows */ |
| 244 | 245 | p->nHash = p->nRow*2 + 1; |
| @@ -284,25 +285,33 @@ | ||
| 284 | 285 | } |
| 285 | 286 | |
| 286 | 287 | /* Identify rows where the primary parent is off screen. Assign |
| 287 | 288 | ** each to a rail and draw descenders to the bottom of the screen. |
| 288 | 289 | */ |
| 289 | - for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ | |
| 290 | - if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ | |
| 291 | - if( omitDescenders ){ | |
| 292 | - pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0, 0); | |
| 293 | - }else{ | |
| 294 | - pRow->iRail = ++p->mxRail; | |
| 295 | - } | |
| 296 | - mask = 1<<(pRow->iRail); | |
| 297 | - if( omitDescenders ){ | |
| 298 | - pRow->railInUse |= mask; | |
| 299 | - if( pRow->pNext ) pRow->pNext->railInUse |= mask; | |
| 300 | - }else{ | |
| 301 | - pRow->bDescender = pRow->nParent>0; | |
| 302 | - for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ | |
| 303 | - pDesc->railInUse |= mask; | |
| 290 | + zTrunk = persistBranchName(p, "trunk"); | |
| 291 | + for(i=0; i<2; i++){ | |
| 292 | + for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ | |
| 293 | + if( i==0 ){ | |
| 294 | + if( pRow->zBranch!=zTrunk ) continue; | |
| 295 | + }else { | |
| 296 | + if( pRow->iRail>=0 ) continue; | |
| 297 | + } | |
| 298 | + if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ | |
| 299 | + if( omitDescenders ){ | |
| 300 | + pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0, 0); | |
| 301 | + }else{ | |
| 302 | + pRow->iRail = ++p->mxRail; | |
| 303 | + } | |
| 304 | + mask = 1<<(pRow->iRail); | |
| 305 | + if( omitDescenders ){ | |
| 306 | + pRow->railInUse |= mask; | |
| 307 | + if( pRow->pNext ) pRow->pNext->railInUse |= mask; | |
| 308 | + }else{ | |
| 309 | + pRow->bDescender = pRow->nParent>0; | |
| 310 | + for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ | |
| 311 | + pDesc->railInUse |= mask; | |
| 312 | + } | |
| 304 | 313 | } |
| 305 | 314 | } |
| 306 | 315 | } |
| 307 | 316 | } |
| 308 | 317 | |
| 309 | 318 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -235,10 +235,11 @@ | |
| 235 | GraphRow *pRow, *pDesc, *pDup, *pLoop; |
| 236 | int i; |
| 237 | u32 mask; |
| 238 | u32 inUse; |
| 239 | int hasDup = 0; /* True if one or more isDup entries */ |
| 240 | |
| 241 | if( p==0 || p->pFirst==0 || p->nErr ) return; |
| 242 | |
| 243 | /* Initialize all rows */ |
| 244 | p->nHash = p->nRow*2 + 1; |
| @@ -284,25 +285,33 @@ | |
| 284 | } |
| 285 | |
| 286 | /* Identify rows where the primary parent is off screen. Assign |
| 287 | ** each to a rail and draw descenders to the bottom of the screen. |
| 288 | */ |
| 289 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 290 | if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ |
| 291 | if( omitDescenders ){ |
| 292 | pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0, 0); |
| 293 | }else{ |
| 294 | pRow->iRail = ++p->mxRail; |
| 295 | } |
| 296 | mask = 1<<(pRow->iRail); |
| 297 | if( omitDescenders ){ |
| 298 | pRow->railInUse |= mask; |
| 299 | if( pRow->pNext ) pRow->pNext->railInUse |= mask; |
| 300 | }else{ |
| 301 | pRow->bDescender = pRow->nParent>0; |
| 302 | for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ |
| 303 | pDesc->railInUse |= mask; |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -235,10 +235,11 @@ | |
| 235 | GraphRow *pRow, *pDesc, *pDup, *pLoop; |
| 236 | int i; |
| 237 | u32 mask; |
| 238 | u32 inUse; |
| 239 | int hasDup = 0; /* True if one or more isDup entries */ |
| 240 | const char *zTrunk; |
| 241 | |
| 242 | if( p==0 || p->pFirst==0 || p->nErr ) return; |
| 243 | |
| 244 | /* Initialize all rows */ |
| 245 | p->nHash = p->nRow*2 + 1; |
| @@ -284,25 +285,33 @@ | |
| 285 | } |
| 286 | |
| 287 | /* Identify rows where the primary parent is off screen. Assign |
| 288 | ** each to a rail and draw descenders to the bottom of the screen. |
| 289 | */ |
| 290 | zTrunk = persistBranchName(p, "trunk"); |
| 291 | for(i=0; i<2; i++){ |
| 292 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 293 | if( i==0 ){ |
| 294 | if( pRow->zBranch!=zTrunk ) continue; |
| 295 | }else { |
| 296 | if( pRow->iRail>=0 ) continue; |
| 297 | } |
| 298 | if( pRow->nParent==0 || hashFind(p,pRow->aParent[0])==0 ){ |
| 299 | if( omitDescenders ){ |
| 300 | pRow->iRail = findFreeRail(p, pRow->idx, pRow->idx, 0, 0); |
| 301 | }else{ |
| 302 | pRow->iRail = ++p->mxRail; |
| 303 | } |
| 304 | mask = 1<<(pRow->iRail); |
| 305 | if( omitDescenders ){ |
| 306 | pRow->railInUse |= mask; |
| 307 | if( pRow->pNext ) pRow->pNext->railInUse |= mask; |
| 308 | }else{ |
| 309 | pRow->bDescender = pRow->nParent>0; |
| 310 | for(pDesc=pRow; pDesc; pDesc=pDesc->pNext){ |
| 311 | pDesc->railInUse |= mask; |
| 312 | } |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 |