Fossil SCM

Futher improments to the display of individual file timeline graphs.

drh 2011-05-12 00:40 trunk
Commit 64aa186ae4bc41c03e1a92c89fbe2ff5a93b2dec
2 files changed +5 -4 +12 -7
+5 -4
--- src/finfo.c
+++ src/finfo.c
@@ -268,11 +268,11 @@
268268
int gidx;
269269
char zTime[10];
270270
char zShort[20];
271271
char zShortCkin[20];
272272
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);
274274
if( memcmp(zDate, zPrevDate, 10) ){
275275
sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
276276
@ <tr><td>
277277
@ <div class="divider">%s(zPrevDate)</div>
278278
@ </td></tr>
@@ -313,18 +313,19 @@
313313
}
314314
@ </td></tr>
315315
}
316316
db_finalize(&q);
317317
if( pGraph ){
318
- graph_finish(pGraph, 1);
318
+ graph_finish(pGraph, 0);
319319
if( pGraph->nErr ){
320320
graph_free(pGraph);
321321
pGraph = 0;
322322
}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>
324325
@ </td></tr>
325326
}
326327
}
327328
@ </table>
328
- timeline_output_graph_javascript(pGraph, 1);
329
+ timeline_output_graph_javascript(pGraph, 0);
329330
style_footer();
330331
}
331332
--- 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 @@
6969
int nRow; /* Number of rows */
7070
int nHash; /* Number of slots in apHash[] */
7171
GraphRow **apHash; /* Hash table of GraphRow objects. Key: rid */
7272
};
7373
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
-
7974
#endif
8075
8176
/*
8277
** Malloc for zeroed space. Panic if unable to provide the
8378
** requested space.
@@ -410,10 +405,11 @@
410405
** Strive to put the "trunk" branch on far left.
411406
*/
412407
zTrunk = persistBranchName(p, "trunk");
413408
for(i=0; i<2; i++){
414409
for(pRow=p->pLast; pRow; pRow=pRow->pPrev){
410
+ if( pRow->isDup ) continue;
415411
if( i==0 ){
416412
if( pRow->zBranch!=zTrunk ) continue;
417413
}else {
418414
if( pRow->iRail>=0 ) continue;
419415
}
@@ -533,24 +529,33 @@
533529
/*
534530
** Insert merge rails from primaries to duplicates.
535531
*/
536532
if( hasDup ){
537533
int dupRail;
534
+ int mxRail;
538535
find_max_rail(p);
539
- dupRail = ++p->mxRail;
536
+ mxRail = p->mxRail;
537
+ dupRail = mxRail+1;
540538
if( p->mxRail>=GR_MAX_RAIL ) return;
541539
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
542540
if( !pRow->isDup ) continue;
543541
pRow->iRail = dupRail;
544542
pDesc = hashFind(p, pRow->rid);
545543
assert( pDesc!=0 && pDesc!=pRow );
546544
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
+ }
547552
}
548
- if( p->mxRail>=GR_MAX_RAIL ) return;
553
+ if( mxRail>=GR_MAX_RAIL ) return;
549554
}
550555
551556
/*
552557
** Find the maximum rail number.
553558
*/
554559
find_max_rail(p);
555560
p->nErr = 0;
556561
}
557562
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button