Fossil SCM
On the web-based annotate screen, do not show the annotations on lines that are older than the analysis.
Commit
e46935e962278d7833e650766ffd963b4064a29e
Parent
33c651cea5bbe00…
1 file changed
+18
-6
+18
-6
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2383,11 +2383,11 @@ | ||
| 2383 | 2383 | } |
| 2384 | 2384 | p->nVers++; |
| 2385 | 2385 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 2386 | 2386 | p->azVers[p->nVers-1] = zLabel; |
| 2387 | 2387 | content_get(rid, &step); |
| 2388 | - annotation_step(p, &step, zLabel); | |
| 2388 | + annotation_step(p, &step, cnt==iLimit-1 ? "" : zLabel); | |
| 2389 | 2389 | db_bind_int(&ins, ":rid", rid); |
| 2390 | 2390 | db_step(&ins); |
| 2391 | 2391 | db_reset(&ins); |
| 2392 | 2392 | blob_reset(&step); |
| 2393 | 2393 | db_reset(&q); |
| @@ -2489,19 +2489,25 @@ | ||
| 2489 | 2489 | }else{ |
| 2490 | 2490 | @ <h2>Annotation of %d(iLimit) most recent ancestors:</h2> |
| 2491 | 2491 | } |
| 2492 | 2492 | if( showLn ){ |
| 2493 | 2493 | sqlite3_snprintf(sizeof(zLn), zLn, "%d", ann.nOrig+1); |
| 2494 | - sqlite3_snprintf(sizeof(zFormat), zFormat, "%%%dd:", strlen(zLn)); | |
| 2494 | + sqlite3_snprintf(sizeof(zFormat), zFormat, "%%%dd: ", strlen(zLn)); | |
| 2495 | 2495 | }else{ |
| 2496 | 2496 | zLn[0] = 0; |
| 2497 | 2497 | } |
| 2498 | 2498 | @ <pre> |
| 2499 | 2499 | for(i=0; i<ann.nOrig; i++){ |
| 2500 | + const char *zSrc = ann.aOrig[i].zSrc; | |
| 2501 | + const char *zSep = ":"; | |
| 2502 | + if( zSrc[0]==0 ){ | |
| 2503 | + zSrc = " "; | |
| 2504 | + zSep = " "; | |
| 2505 | + } | |
| 2500 | 2506 | ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0; |
| 2501 | 2507 | if( showLn ) sqlite3_snprintf(sizeof(zLn), zLn, zFormat, i+1); |
| 2502 | - @ %s(ann.aOrig[i].zSrc):%s(zLn) %h(ann.aOrig[i].z) | |
| 2508 | + @ %s(zSrc)%s(zSep)%s(zLn) %h(ann.aOrig[i].z) | |
| 2503 | 2509 | } |
| 2504 | 2510 | @ </pre> |
| 2505 | 2511 | style_footer(); |
| 2506 | 2512 | } |
| 2507 | 2513 | |
| @@ -2557,11 +2563,11 @@ | ||
| 2557 | 2563 | cid = db_lget_int("checkout", 0); |
| 2558 | 2564 | if( cid == 0 ){ |
| 2559 | 2565 | fossil_fatal("Not in a checkout"); |
| 2560 | 2566 | } |
| 2561 | 2567 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2562 | - compute_direct_ancestors(cid, iLimit); | |
| 2568 | + compute_direct_ancestors(cid, 1000000); | |
| 2563 | 2569 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2564 | 2570 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2565 | 2571 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2566 | 2572 | fid, fnid); |
| 2567 | 2573 | if( mid==0 ){ |
| @@ -2575,12 +2581,18 @@ | ||
| 2575 | 2581 | printf("version %3d: %s\n", i+1, ann.azVers[i]); |
| 2576 | 2582 | } |
| 2577 | 2583 | printf("---------------------------------------------------\n"); |
| 2578 | 2584 | } |
| 2579 | 2585 | for(i=0; i<ann.nOrig; i++){ |
| 2580 | - fossil_print("%s: %.*s\n", | |
| 2581 | - ann.aOrig[i].zSrc, ann.aOrig[i].n, ann.aOrig[i].z); | |
| 2586 | + const char *zSrc = ann.aOrig[i].zSrc; | |
| 2587 | + const char *zSep = ":"; | |
| 2588 | + if( zSrc[0]==0 ){ | |
| 2589 | + zSrc = ""; | |
| 2590 | + zSep = " "; | |
| 2591 | + } | |
| 2592 | + fossil_print("%36s%s%.*s\n", | |
| 2593 | + zSrc, zSep, ann.aOrig[i].n, ann.aOrig[i].z); | |
| 2582 | 2594 | } |
| 2583 | 2595 | } |
| 2584 | 2596 | |
| 2585 | 2597 | /* |
| 2586 | 2598 | ** COMMAND: test-looks-like-utf |
| 2587 | 2599 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2383,11 +2383,11 @@ | |
| 2383 | } |
| 2384 | p->nVers++; |
| 2385 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 2386 | p->azVers[p->nVers-1] = zLabel; |
| 2387 | content_get(rid, &step); |
| 2388 | annotation_step(p, &step, zLabel); |
| 2389 | db_bind_int(&ins, ":rid", rid); |
| 2390 | db_step(&ins); |
| 2391 | db_reset(&ins); |
| 2392 | blob_reset(&step); |
| 2393 | db_reset(&q); |
| @@ -2489,19 +2489,25 @@ | |
| 2489 | }else{ |
| 2490 | @ <h2>Annotation of %d(iLimit) most recent ancestors:</h2> |
| 2491 | } |
| 2492 | if( showLn ){ |
| 2493 | sqlite3_snprintf(sizeof(zLn), zLn, "%d", ann.nOrig+1); |
| 2494 | sqlite3_snprintf(sizeof(zFormat), zFormat, "%%%dd:", strlen(zLn)); |
| 2495 | }else{ |
| 2496 | zLn[0] = 0; |
| 2497 | } |
| 2498 | @ <pre> |
| 2499 | for(i=0; i<ann.nOrig; i++){ |
| 2500 | ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0; |
| 2501 | if( showLn ) sqlite3_snprintf(sizeof(zLn), zLn, zFormat, i+1); |
| 2502 | @ %s(ann.aOrig[i].zSrc):%s(zLn) %h(ann.aOrig[i].z) |
| 2503 | } |
| 2504 | @ </pre> |
| 2505 | style_footer(); |
| 2506 | } |
| 2507 | |
| @@ -2557,11 +2563,11 @@ | |
| 2557 | cid = db_lget_int("checkout", 0); |
| 2558 | if( cid == 0 ){ |
| 2559 | fossil_fatal("Not in a checkout"); |
| 2560 | } |
| 2561 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2562 | compute_direct_ancestors(cid, iLimit); |
| 2563 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2564 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2565 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2566 | fid, fnid); |
| 2567 | if( mid==0 ){ |
| @@ -2575,12 +2581,18 @@ | |
| 2575 | printf("version %3d: %s\n", i+1, ann.azVers[i]); |
| 2576 | } |
| 2577 | printf("---------------------------------------------------\n"); |
| 2578 | } |
| 2579 | for(i=0; i<ann.nOrig; i++){ |
| 2580 | fossil_print("%s: %.*s\n", |
| 2581 | ann.aOrig[i].zSrc, ann.aOrig[i].n, ann.aOrig[i].z); |
| 2582 | } |
| 2583 | } |
| 2584 | |
| 2585 | /* |
| 2586 | ** COMMAND: test-looks-like-utf |
| 2587 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2383,11 +2383,11 @@ | |
| 2383 | } |
| 2384 | p->nVers++; |
| 2385 | p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) ); |
| 2386 | p->azVers[p->nVers-1] = zLabel; |
| 2387 | content_get(rid, &step); |
| 2388 | annotation_step(p, &step, cnt==iLimit-1 ? "" : zLabel); |
| 2389 | db_bind_int(&ins, ":rid", rid); |
| 2390 | db_step(&ins); |
| 2391 | db_reset(&ins); |
| 2392 | blob_reset(&step); |
| 2393 | db_reset(&q); |
| @@ -2489,19 +2489,25 @@ | |
| 2489 | }else{ |
| 2490 | @ <h2>Annotation of %d(iLimit) most recent ancestors:</h2> |
| 2491 | } |
| 2492 | if( showLn ){ |
| 2493 | sqlite3_snprintf(sizeof(zLn), zLn, "%d", ann.nOrig+1); |
| 2494 | sqlite3_snprintf(sizeof(zFormat), zFormat, "%%%dd: ", strlen(zLn)); |
| 2495 | }else{ |
| 2496 | zLn[0] = 0; |
| 2497 | } |
| 2498 | @ <pre> |
| 2499 | for(i=0; i<ann.nOrig; i++){ |
| 2500 | const char *zSrc = ann.aOrig[i].zSrc; |
| 2501 | const char *zSep = ":"; |
| 2502 | if( zSrc[0]==0 ){ |
| 2503 | zSrc = " "; |
| 2504 | zSep = " "; |
| 2505 | } |
| 2506 | ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0; |
| 2507 | if( showLn ) sqlite3_snprintf(sizeof(zLn), zLn, zFormat, i+1); |
| 2508 | @ %s(zSrc)%s(zSep)%s(zLn) %h(ann.aOrig[i].z) |
| 2509 | } |
| 2510 | @ </pre> |
| 2511 | style_footer(); |
| 2512 | } |
| 2513 | |
| @@ -2557,11 +2563,11 @@ | |
| 2563 | cid = db_lget_int("checkout", 0); |
| 2564 | if( cid == 0 ){ |
| 2565 | fossil_fatal("Not in a checkout"); |
| 2566 | } |
| 2567 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2568 | compute_direct_ancestors(cid, 1000000); |
| 2569 | mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor " |
| 2570 | " WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid" |
| 2571 | " ORDER BY ancestor.generation ASC LIMIT 1", |
| 2572 | fid, fnid); |
| 2573 | if( mid==0 ){ |
| @@ -2575,12 +2581,18 @@ | |
| 2581 | printf("version %3d: %s\n", i+1, ann.azVers[i]); |
| 2582 | } |
| 2583 | printf("---------------------------------------------------\n"); |
| 2584 | } |
| 2585 | for(i=0; i<ann.nOrig; i++){ |
| 2586 | const char *zSrc = ann.aOrig[i].zSrc; |
| 2587 | const char *zSep = ":"; |
| 2588 | if( zSrc[0]==0 ){ |
| 2589 | zSrc = ""; |
| 2590 | zSep = " "; |
| 2591 | } |
| 2592 | fossil_print("%36s%s%.*s\n", |
| 2593 | zSrc, zSep, ann.aOrig[i].n, ann.aOrig[i].z); |
| 2594 | } |
| 2595 | } |
| 2596 | |
| 2597 | /* |
| 2598 | ** COMMAND: test-looks-like-utf |
| 2599 |