Fossil SCM
Try to keep graph nodes from the same branch on the same rail of the graph.
Commit
fcc9f6642ede764b177a7d065ea7aebd8674839d
Parent
c1c50ced228c63c…
1 file changed
+21
+21
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -378,10 +378,31 @@ | ||
| 378 | 378 | i--; |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | + | |
| 384 | + /* If the primary parent is in a different branch, but there are | |
| 385 | + ** other parents in the same branch, reorder the parents to make | |
| 386 | + ** the parent from the same branch the primary parent. | |
| 387 | + */ | |
| 388 | + for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ | |
| 389 | + if( pRow->isDup ) continue; | |
| 390 | + if( pRow->nParent<2 ) continue; /* Not a fork */ | |
| 391 | + pParent = hashFind(p, pRow->aParent[0]); | |
| 392 | + if( pParent==0 ) continue; /* Parent off-screen */ | |
| 393 | + if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ | |
| 394 | + for(i=1; i<pRow->nParent; i++){ | |
| 395 | + pParent = hashFind(p, pRow->aParent[i]); | |
| 396 | + if( pParent->zBranch==pRow->zBranch ){ | |
| 397 | + int t = pRow->aParent[0]; | |
| 398 | + pRow->aParent[0] = pRow->aParent[i]; | |
| 399 | + pRow->aParent[i] = t; | |
| 400 | + break; | |
| 401 | + } | |
| 402 | + } | |
| 403 | + } | |
| 383 | 404 | |
| 384 | 405 | |
| 385 | 406 | /* Find the pChild pointer for each node. |
| 386 | 407 | ** |
| 387 | 408 | ** The pChild points to the node directly above on the same rail. |
| 388 | 409 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -378,10 +378,31 @@ | |
| 378 | i--; |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | |
| 385 | /* Find the pChild pointer for each node. |
| 386 | ** |
| 387 | ** The pChild points to the node directly above on the same rail. |
| 388 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -378,10 +378,31 @@ | |
| 378 | i--; |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | /* If the primary parent is in a different branch, but there are |
| 385 | ** other parents in the same branch, reorder the parents to make |
| 386 | ** the parent from the same branch the primary parent. |
| 387 | */ |
| 388 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 389 | if( pRow->isDup ) continue; |
| 390 | if( pRow->nParent<2 ) continue; /* Not a fork */ |
| 391 | pParent = hashFind(p, pRow->aParent[0]); |
| 392 | if( pParent==0 ) continue; /* Parent off-screen */ |
| 393 | if( pParent->zBranch==pRow->zBranch ) continue; /* Same branch */ |
| 394 | for(i=1; i<pRow->nParent; i++){ |
| 395 | pParent = hashFind(p, pRow->aParent[i]); |
| 396 | if( pParent->zBranch==pRow->zBranch ){ |
| 397 | int t = pRow->aParent[0]; |
| 398 | pRow->aParent[0] = pRow->aParent[i]; |
| 399 | pRow->aParent[i] = t; |
| 400 | break; |
| 401 | } |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | |
| 406 | /* Find the pChild pointer for each node. |
| 407 | ** |
| 408 | ** The pChild points to the node directly above on the same rail. |
| 409 |