Fossil SCM
Futher improments to the display of individual file timeline graphs.
Commit
64aa186ae4bc41c03e1a92c89fbe2ff5a93b2dec
Parent
cbc84ad65cfcb8b…
2 files changed
+5
-4
+12
-7
+5
-4
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -268,11 +268,11 @@ | ||
| 268 | 268 | int gidx; |
| 269 | 269 | char zTime[10]; |
| 270 | 270 | char zShort[20]; |
| 271 | 271 | char zShortCkin[20]; |
| 272 | 272 | if( zBr==0 ) zBr = "trunk"; |
| 273 | - gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 1); | |
| 273 | + gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0); | |
| 274 | 274 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 275 | 275 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 276 | 276 | @ <tr><td> |
| 277 | 277 | @ <div class="divider">%s(zPrevDate)</div> |
| 278 | 278 | @ </td></tr> |
| @@ -313,18 +313,19 @@ | ||
| 313 | 313 | } |
| 314 | 314 | @ </td></tr> |
| 315 | 315 | } |
| 316 | 316 | db_finalize(&q); |
| 317 | 317 | if( pGraph ){ |
| 318 | - graph_finish(pGraph, 1); | |
| 318 | + graph_finish(pGraph, 0); | |
| 319 | 319 | if( pGraph->nErr ){ |
| 320 | 320 | graph_free(pGraph); |
| 321 | 321 | pGraph = 0; |
| 322 | 322 | }else{ |
| 323 | - @ <tr><td></td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div> | |
| 323 | + @ <tr><td></td><td> | |
| 324 | + @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> | |
| 324 | 325 | @ </td></tr> |
| 325 | 326 | } |
| 326 | 327 | } |
| 327 | 328 | @ </table> |
| 328 | - timeline_output_graph_javascript(pGraph, 1); | |
| 329 | + timeline_output_graph_javascript(pGraph, 0); | |
| 329 | 330 | style_footer(); |
| 330 | 331 | } |
| 331 | 332 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -268,11 +268,11 @@ | |
| 268 | int gidx; |
| 269 | char zTime[10]; |
| 270 | char zShort[20]; |
| 271 | char zShortCkin[20]; |
| 272 | if( zBr==0 ) zBr = "trunk"; |
| 273 | gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 1); |
| 274 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 275 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 276 | @ <tr><td> |
| 277 | @ <div class="divider">%s(zPrevDate)</div> |
| 278 | @ </td></tr> |
| @@ -313,18 +313,19 @@ | |
| 313 | } |
| 314 | @ </td></tr> |
| 315 | } |
| 316 | db_finalize(&q); |
| 317 | if( pGraph ){ |
| 318 | graph_finish(pGraph, 1); |
| 319 | if( pGraph->nErr ){ |
| 320 | graph_free(pGraph); |
| 321 | pGraph = 0; |
| 322 | }else{ |
| 323 | @ <tr><td></td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 324 | @ </td></tr> |
| 325 | } |
| 326 | } |
| 327 | @ </table> |
| 328 | timeline_output_graph_javascript(pGraph, 1); |
| 329 | style_footer(); |
| 330 | } |
| 331 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -268,11 +268,11 @@ | |
| 268 | int gidx; |
| 269 | char zTime[10]; |
| 270 | char zShort[20]; |
| 271 | char zShortCkin[20]; |
| 272 | if( zBr==0 ) zBr = "trunk"; |
| 273 | gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr, 0); |
| 274 | if( memcmp(zDate, zPrevDate, 10) ){ |
| 275 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 276 | @ <tr><td> |
| 277 | @ <div class="divider">%s(zPrevDate)</div> |
| 278 | @ </td></tr> |
| @@ -313,18 +313,19 @@ | |
| 313 | } |
| 314 | @ </td></tr> |
| 315 | } |
| 316 | db_finalize(&q); |
| 317 | if( pGraph ){ |
| 318 | graph_finish(pGraph, 0); |
| 319 | if( pGraph->nErr ){ |
| 320 | graph_free(pGraph); |
| 321 | pGraph = 0; |
| 322 | }else{ |
| 323 | @ <tr><td></td><td> |
| 324 | @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div> |
| 325 | @ </td></tr> |
| 326 | } |
| 327 | } |
| 328 | @ </table> |
| 329 | timeline_output_graph_javascript(pGraph, 0); |
| 330 | style_footer(); |
| 331 | } |
| 332 |
+12
-7
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -69,15 +69,10 @@ | ||
| 69 | 69 | int nRow; /* Number of rows */ |
| 70 | 70 | int nHash; /* Number of slots in apHash[] */ |
| 71 | 71 | GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */ |
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | -/* Options for graph_finish(): | |
| 75 | -*/ | |
| 76 | -#define GRAPH_DISJOINT 0x0001 /* All elements disjoint */ | |
| 77 | -#define GRAPH_ISOLATE_MERGEIN 0x0002 /* Merge-in nodes isolated */ | |
| 78 | - | |
| 79 | 74 | #endif |
| 80 | 75 | |
| 81 | 76 | /* |
| 82 | 77 | ** Malloc for zeroed space. Panic if unable to provide the |
| 83 | 78 | ** requested space. |
| @@ -410,10 +405,11 @@ | ||
| 410 | 405 | ** Strive to put the "trunk" branch on far left. |
| 411 | 406 | */ |
| 412 | 407 | zTrunk = persistBranchName(p, "trunk"); |
| 413 | 408 | for(i=0; i<2; i++){ |
| 414 | 409 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 410 | + if( pRow->isDup ) continue; | |
| 415 | 411 | if( i==0 ){ |
| 416 | 412 | if( pRow->zBranch!=zTrunk ) continue; |
| 417 | 413 | }else { |
| 418 | 414 | if( pRow->iRail>=0 ) continue; |
| 419 | 415 | } |
| @@ -533,24 +529,33 @@ | ||
| 533 | 529 | /* |
| 534 | 530 | ** Insert merge rails from primaries to duplicates. |
| 535 | 531 | */ |
| 536 | 532 | if( hasDup ){ |
| 537 | 533 | int dupRail; |
| 534 | + int mxRail; | |
| 538 | 535 | find_max_rail(p); |
| 539 | - dupRail = ++p->mxRail; | |
| 536 | + mxRail = p->mxRail; | |
| 537 | + dupRail = mxRail+1; | |
| 540 | 538 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 541 | 539 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 542 | 540 | if( !pRow->isDup ) continue; |
| 543 | 541 | pRow->iRail = dupRail; |
| 544 | 542 | pDesc = hashFind(p, pRow->rid); |
| 545 | 543 | assert( pDesc!=0 && pDesc!=pRow ); |
| 546 | 544 | createMergeRiser(p, pDesc, pRow); |
| 545 | + if( pDesc->mergeOut/4>mxRail ) mxRail = pDesc->mergeOut/4; | |
| 546 | + } | |
| 547 | + if( dupRail<=mxRail ){ | |
| 548 | + dupRail = mxRail+1; | |
| 549 | + for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ | |
| 550 | + if( pRow->isDup ) pRow->iRail = dupRail; | |
| 551 | + } | |
| 547 | 552 | } |
| 548 | - if( p->mxRail>=GR_MAX_RAIL ) return; | |
| 553 | + if( mxRail>=GR_MAX_RAIL ) return; | |
| 549 | 554 | } |
| 550 | 555 | |
| 551 | 556 | /* |
| 552 | 557 | ** Find the maximum rail number. |
| 553 | 558 | */ |
| 554 | 559 | find_max_rail(p); |
| 555 | 560 | p->nErr = 0; |
| 556 | 561 | } |
| 557 | 562 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -69,15 +69,10 @@ | |
| 69 | int nRow; /* Number of rows */ |
| 70 | int nHash; /* Number of slots in apHash[] */ |
| 71 | GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */ |
| 72 | }; |
| 73 | |
| 74 | /* Options for graph_finish(): |
| 75 | */ |
| 76 | #define GRAPH_DISJOINT 0x0001 /* All elements disjoint */ |
| 77 | #define GRAPH_ISOLATE_MERGEIN 0x0002 /* Merge-in nodes isolated */ |
| 78 | |
| 79 | #endif |
| 80 | |
| 81 | /* |
| 82 | ** Malloc for zeroed space. Panic if unable to provide the |
| 83 | ** requested space. |
| @@ -410,10 +405,11 @@ | |
| 410 | ** Strive to put the "trunk" branch on far left. |
| 411 | */ |
| 412 | zTrunk = persistBranchName(p, "trunk"); |
| 413 | for(i=0; i<2; i++){ |
| 414 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 415 | if( i==0 ){ |
| 416 | if( pRow->zBranch!=zTrunk ) continue; |
| 417 | }else { |
| 418 | if( pRow->iRail>=0 ) continue; |
| 419 | } |
| @@ -533,24 +529,33 @@ | |
| 533 | /* |
| 534 | ** Insert merge rails from primaries to duplicates. |
| 535 | */ |
| 536 | if( hasDup ){ |
| 537 | int dupRail; |
| 538 | find_max_rail(p); |
| 539 | dupRail = ++p->mxRail; |
| 540 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 541 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 542 | if( !pRow->isDup ) continue; |
| 543 | pRow->iRail = dupRail; |
| 544 | pDesc = hashFind(p, pRow->rid); |
| 545 | assert( pDesc!=0 && pDesc!=pRow ); |
| 546 | createMergeRiser(p, pDesc, pRow); |
| 547 | } |
| 548 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 549 | } |
| 550 | |
| 551 | /* |
| 552 | ** Find the maximum rail number. |
| 553 | */ |
| 554 | find_max_rail(p); |
| 555 | p->nErr = 0; |
| 556 | } |
| 557 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -69,15 +69,10 @@ | |
| 69 | int nRow; /* Number of rows */ |
| 70 | int nHash; /* Number of slots in apHash[] */ |
| 71 | GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */ |
| 72 | }; |
| 73 | |
| 74 | #endif |
| 75 | |
| 76 | /* |
| 77 | ** Malloc for zeroed space. Panic if unable to provide the |
| 78 | ** requested space. |
| @@ -410,10 +405,11 @@ | |
| 405 | ** Strive to put the "trunk" branch on far left. |
| 406 | */ |
| 407 | zTrunk = persistBranchName(p, "trunk"); |
| 408 | for(i=0; i<2; i++){ |
| 409 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 410 | if( pRow->isDup ) continue; |
| 411 | if( i==0 ){ |
| 412 | if( pRow->zBranch!=zTrunk ) continue; |
| 413 | }else { |
| 414 | if( pRow->iRail>=0 ) continue; |
| 415 | } |
| @@ -533,24 +529,33 @@ | |
| 529 | /* |
| 530 | ** Insert merge rails from primaries to duplicates. |
| 531 | */ |
| 532 | if( hasDup ){ |
| 533 | int dupRail; |
| 534 | int mxRail; |
| 535 | find_max_rail(p); |
| 536 | mxRail = p->mxRail; |
| 537 | dupRail = mxRail+1; |
| 538 | if( p->mxRail>=GR_MAX_RAIL ) return; |
| 539 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 540 | if( !pRow->isDup ) continue; |
| 541 | pRow->iRail = dupRail; |
| 542 | pDesc = hashFind(p, pRow->rid); |
| 543 | assert( pDesc!=0 && pDesc!=pRow ); |
| 544 | createMergeRiser(p, pDesc, pRow); |
| 545 | if( pDesc->mergeOut/4>mxRail ) mxRail = pDesc->mergeOut/4; |
| 546 | } |
| 547 | if( dupRail<=mxRail ){ |
| 548 | dupRail = mxRail+1; |
| 549 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 550 | if( pRow->isDup ) pRow->iRail = dupRail; |
| 551 | } |
| 552 | } |
| 553 | if( mxRail>=GR_MAX_RAIL ) return; |
| 554 | } |
| 555 | |
| 556 | /* |
| 557 | ** Find the maximum rail number. |
| 558 | */ |
| 559 | find_max_rail(p); |
| 560 | p->nErr = 0; |
| 561 | } |
| 562 |