Fossil SCM

Fix the /finfo page to do a better job of showing later deletions of files that are deleted more than once.

drh 2015-02-07 04:14 trunk
Commit bf8e4377a9cab88a2c3918f2a4207ef141b5be8d
1 file changed +12 -2
+12 -2
--- src/finfo.c
+++ src/finfo.c
@@ -358,12 +358,21 @@
358358
}
359359
if( (zB = P("b"))!=0 ){
360360
blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);
361361
url_add_parameter(&url, "b", zB);
362362
}
363
+ /* We only want each version of a file to appear on the graph once,
364
+ ** at its earliest appearance. All the other times that it gets merged
365
+ ** into this or that branch can be ignored. An exception is for when
366
+ ** files are deleted (when they have mlink.fid==0). If the same file
367
+ ** is deleted in multiple places, we want to show each deletion, so
368
+ ** use a "fake fid" which is derived from the parent-fid for grouping.
369
+ ** The same fake-fid must be used on the graph.
370
+ */
363371
blob_append_sql(&sql,
364
- " GROUP BY mlink.fid"
372
+ " GROUP BY"
373
+ " CASE WHEN mlink.fid>0 THEN mlink.fid ELSE mlink.pid+1000000000 END"
365374
" ORDER BY event.mtime DESC /*sort*/"
366375
);
367376
if( (n = atoi(PD("n","0")))>0 ){
368377
blob_append_sql(&sql, " LIMIT %d", n);
369378
url_add_parameter(&url, "n", P("n"));
@@ -432,11 +441,12 @@
432441
if( uBg ){
433442
zBgClr = hash_color(zUser);
434443
}else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
435444
zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
436445
}
437
- gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr,
446
+ gidx = graph_add_row(pGraph, frid>0 ? frid : fpid+1000000000,
447
+ nParent, aParent, zBr, zBgClr,
438448
zUuid, 0);
439449
if( strncmp(zDate, zPrevDate, 10) ){
440450
sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
441451
@ <tr><td>
442452
@ <div class="divider">%s(zPrevDate)</div>
443453
--- src/finfo.c
+++ src/finfo.c
@@ -358,12 +358,21 @@
358 }
359 if( (zB = P("b"))!=0 ){
360 blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);
361 url_add_parameter(&url, "b", zB);
362 }
 
 
 
 
 
 
 
 
363 blob_append_sql(&sql,
364 " GROUP BY mlink.fid"
 
365 " ORDER BY event.mtime DESC /*sort*/"
366 );
367 if( (n = atoi(PD("n","0")))>0 ){
368 blob_append_sql(&sql, " LIMIT %d", n);
369 url_add_parameter(&url, "n", P("n"));
@@ -432,11 +441,12 @@
432 if( uBg ){
433 zBgClr = hash_color(zUser);
434 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
435 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
436 }
437 gidx = graph_add_row(pGraph, frid, nParent, aParent, zBr, zBgClr,
 
438 zUuid, 0);
439 if( strncmp(zDate, zPrevDate, 10) ){
440 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
441 @ <tr><td>
442 @ <div class="divider">%s(zPrevDate)</div>
443
--- src/finfo.c
+++ src/finfo.c
@@ -358,12 +358,21 @@
358 }
359 if( (zB = P("b"))!=0 ){
360 blob_append_sql(&sql, " AND event.mtime<=julianday('%q')", zB);
361 url_add_parameter(&url, "b", zB);
362 }
363 /* We only want each version of a file to appear on the graph once,
364 ** at its earliest appearance. All the other times that it gets merged
365 ** into this or that branch can be ignored. An exception is for when
366 ** files are deleted (when they have mlink.fid==0). If the same file
367 ** is deleted in multiple places, we want to show each deletion, so
368 ** use a "fake fid" which is derived from the parent-fid for grouping.
369 ** The same fake-fid must be used on the graph.
370 */
371 blob_append_sql(&sql,
372 " GROUP BY"
373 " CASE WHEN mlink.fid>0 THEN mlink.fid ELSE mlink.pid+1000000000 END"
374 " ORDER BY event.mtime DESC /*sort*/"
375 );
376 if( (n = atoi(PD("n","0")))>0 ){
377 blob_append_sql(&sql, " LIMIT %d", n);
378 url_add_parameter(&url, "n", P("n"));
@@ -432,11 +441,12 @@
441 if( uBg ){
442 zBgClr = hash_color(zUser);
443 }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
444 zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
445 }
446 gidx = graph_add_row(pGraph, frid>0 ? frid : fpid+1000000000,
447 nParent, aParent, zBr, zBgClr,
448 zUuid, 0);
449 if( strncmp(zDate, zPrevDate, 10) ){
450 sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
451 @ <tr><td>
452 @ <div class="divider">%s(zPrevDate)</div>
453

Keyboard Shortcuts

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