Fossil SCM
Use the GR_MAX_RAIL macro to limit the number of parents for a node on a graph. On the /finfo page, ensure that a node is only marked "Added" if it has no parents.
Commit
c1c50ced228c63c547451469155e818dee0c7856
Parent
c33c574e43e384f…
2 files changed
+3
-3
+2
-2
+3
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -402,21 +402,21 @@ | ||
| 402 | 402 | int fmid = db_column_int(&q, 10); |
| 403 | 403 | int pfnid = db_column_int(&q, 11); |
| 404 | 404 | int gidx; |
| 405 | 405 | char zTime[10]; |
| 406 | 406 | int nParent = 0; |
| 407 | - int aParent[32]; | |
| 407 | + int aParent[GR_MAX_RAIL]; | |
| 408 | 408 | static Stmt qparent; |
| 409 | 409 | db_static_prepare(&qparent, |
| 410 | 410 | "SELECT DISTINCT pid FROM mlink" |
| 411 | 411 | " WHERE fid=:fid AND mid=:mid AND pid>0 AND fnid=:fnid" |
| 412 | 412 | " ORDER BY isaux /*sort*/" |
| 413 | 413 | ); |
| 414 | 414 | db_bind_int(&qparent, ":fid", frid); |
| 415 | 415 | db_bind_int(&qparent, ":mid", fmid); |
| 416 | 416 | db_bind_int(&qparent, ":fnid", fnid); |
| 417 | - while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ | |
| 417 | + while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 418 | 418 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 419 | 419 | } |
| 420 | 420 | db_reset(&qparent); |
| 421 | 421 | if( zBr==0 ) zBr = "trunk"; |
| 422 | 422 | if( uBg ){ |
| @@ -441,11 +441,11 @@ | ||
| 441 | 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 442 | 442 | }else{ |
| 443 | 443 | @ <td class="timelineTableCell"> |
| 444 | 444 | } |
| 445 | 445 | if( zUuid ){ |
| 446 | - if( fpid==0 ){ | |
| 446 | + if( nParent==0 ){ | |
| 447 | 447 | @ <b>Added</b> |
| 448 | 448 | }else if( pfnid ){ |
| 449 | 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 450 | 450 | pfnid); |
| 451 | 451 | @ <b>Renamed</b> from |
| 452 | 452 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -402,21 +402,21 @@ | |
| 402 | int fmid = db_column_int(&q, 10); |
| 403 | int pfnid = db_column_int(&q, 11); |
| 404 | int gidx; |
| 405 | char zTime[10]; |
| 406 | int nParent = 0; |
| 407 | int aParent[32]; |
| 408 | static Stmt qparent; |
| 409 | db_static_prepare(&qparent, |
| 410 | "SELECT DISTINCT pid FROM mlink" |
| 411 | " WHERE fid=:fid AND mid=:mid AND pid>0 AND fnid=:fnid" |
| 412 | " ORDER BY isaux /*sort*/" |
| 413 | ); |
| 414 | db_bind_int(&qparent, ":fid", frid); |
| 415 | db_bind_int(&qparent, ":mid", fmid); |
| 416 | db_bind_int(&qparent, ":fnid", fnid); |
| 417 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 418 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 419 | } |
| 420 | db_reset(&qparent); |
| 421 | if( zBr==0 ) zBr = "trunk"; |
| 422 | if( uBg ){ |
| @@ -441,11 +441,11 @@ | |
| 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 442 | }else{ |
| 443 | @ <td class="timelineTableCell"> |
| 444 | } |
| 445 | if( zUuid ){ |
| 446 | if( fpid==0 ){ |
| 447 | @ <b>Added</b> |
| 448 | }else if( pfnid ){ |
| 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 450 | pfnid); |
| 451 | @ <b>Renamed</b> from |
| 452 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -402,21 +402,21 @@ | |
| 402 | int fmid = db_column_int(&q, 10); |
| 403 | int pfnid = db_column_int(&q, 11); |
| 404 | int gidx; |
| 405 | char zTime[10]; |
| 406 | int nParent = 0; |
| 407 | int aParent[GR_MAX_RAIL]; |
| 408 | static Stmt qparent; |
| 409 | db_static_prepare(&qparent, |
| 410 | "SELECT DISTINCT pid FROM mlink" |
| 411 | " WHERE fid=:fid AND mid=:mid AND pid>0 AND fnid=:fnid" |
| 412 | " ORDER BY isaux /*sort*/" |
| 413 | ); |
| 414 | db_bind_int(&qparent, ":fid", frid); |
| 415 | db_bind_int(&qparent, ":mid", fmid); |
| 416 | db_bind_int(&qparent, ":fnid", fnid); |
| 417 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 418 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 419 | } |
| 420 | db_reset(&qparent); |
| 421 | if( zBr==0 ) zBr = "trunk"; |
| 422 | if( uBg ){ |
| @@ -441,11 +441,11 @@ | |
| 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 442 | }else{ |
| 443 | @ <td class="timelineTableCell"> |
| 444 | } |
| 445 | if( zUuid ){ |
| 446 | if( nParent==0 ){ |
| 447 | @ <b>Added</b> |
| 448 | }else if( pfnid ){ |
| 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| 450 | pfnid); |
| 451 | @ <b>Renamed</b> from |
| 452 |
+2
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -360,20 +360,20 @@ | ||
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | if( zType[0]=='c' && (pGraph || (tmFlags & TIMELINE_BRCOLOR)!=0) ){ |
| 364 | 364 | int nParent = 0; |
| 365 | - int aParent[32]; | |
| 365 | + int aParent[GR_MAX_RAIL]; | |
| 366 | 366 | int gidx; |
| 367 | 367 | static Stmt qparent; |
| 368 | 368 | db_static_prepare(&qparent, |
| 369 | 369 | "SELECT pid FROM plink" |
| 370 | 370 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 371 | 371 | " ORDER BY isprim DESC /*sort*/" |
| 372 | 372 | ); |
| 373 | 373 | db_bind_int(&qparent, ":rid", rid); |
| 374 | - while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ | |
| 374 | + while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 375 | 375 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 376 | 376 | } |
| 377 | 377 | db_reset(&qparent); |
| 378 | 378 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 379 | 379 | zUuid, isLeaf); |
| 380 | 380 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -360,20 +360,20 @@ | |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | if( zType[0]=='c' && (pGraph || (tmFlags & TIMELINE_BRCOLOR)!=0) ){ |
| 364 | int nParent = 0; |
| 365 | int aParent[32]; |
| 366 | int gidx; |
| 367 | static Stmt qparent; |
| 368 | db_static_prepare(&qparent, |
| 369 | "SELECT pid FROM plink" |
| 370 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 371 | " ORDER BY isprim DESC /*sort*/" |
| 372 | ); |
| 373 | db_bind_int(&qparent, ":rid", rid); |
| 374 | while( db_step(&qparent)==SQLITE_ROW && nParent<32 ){ |
| 375 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 376 | } |
| 377 | db_reset(&qparent); |
| 378 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 379 | zUuid, isLeaf); |
| 380 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -360,20 +360,20 @@ | |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | if( zType[0]=='c' && (pGraph || (tmFlags & TIMELINE_BRCOLOR)!=0) ){ |
| 364 | int nParent = 0; |
| 365 | int aParent[GR_MAX_RAIL]; |
| 366 | int gidx; |
| 367 | static Stmt qparent; |
| 368 | db_static_prepare(&qparent, |
| 369 | "SELECT pid FROM plink" |
| 370 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 371 | " ORDER BY isprim DESC /*sort*/" |
| 372 | ); |
| 373 | db_bind_int(&qparent, ":rid", rid); |
| 374 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 375 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 376 | } |
| 377 | db_reset(&qparent); |
| 378 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 379 | zUuid, isLeaf); |
| 380 |