Fossil SCM

On the web-based annotate screen, do not show the annotations on lines that are older than the analysis.

drh 2013-05-24 17:02 trunk
Commit e46935e962278d7833e650766ffd963b4064a29e
1 file changed +18 -6
+18 -6
--- src/diff.c
+++ src/diff.c
@@ -2383,11 +2383,11 @@
23832383
}
23842384
p->nVers++;
23852385
p->azVers = fossil_realloc(p->azVers, p->nVers*sizeof(p->azVers[0]) );
23862386
p->azVers[p->nVers-1] = zLabel;
23872387
content_get(rid, &step);
2388
- annotation_step(p, &step, zLabel);
2388
+ annotation_step(p, &step, cnt==iLimit-1 ? "" : zLabel);
23892389
db_bind_int(&ins, ":rid", rid);
23902390
db_step(&ins);
23912391
db_reset(&ins);
23922392
blob_reset(&step);
23932393
db_reset(&q);
@@ -2489,19 +2489,25 @@
24892489
}else{
24902490
@ <h2>Annotation of %d(iLimit) most recent ancestors:</h2>
24912491
}
24922492
if( showLn ){
24932493
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));
24952495
}else{
24962496
zLn[0] = 0;
24972497
}
24982498
@ <pre>
24992499
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
+ }
25002506
((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
25012507
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)
25032509
}
25042510
@ </pre>
25052511
style_footer();
25062512
}
25072513
@@ -2557,11 +2563,11 @@
25572563
cid = db_lget_int("checkout", 0);
25582564
if( cid == 0 ){
25592565
fossil_fatal("Not in a checkout");
25602566
}
25612567
if( iLimit<=0 ) iLimit = 1000000000;
2562
- compute_direct_ancestors(cid, iLimit);
2568
+ compute_direct_ancestors(cid, 1000000);
25632569
mid = db_int(0, "SELECT mlink.mid FROM mlink, ancestor "
25642570
" WHERE mlink.fid=%d AND mlink.fnid=%d AND mlink.mid=ancestor.rid"
25652571
" ORDER BY ancestor.generation ASC LIMIT 1",
25662572
fid, fnid);
25672573
if( mid==0 ){
@@ -2575,12 +2581,18 @@
25752581
printf("version %3d: %s\n", i+1, ann.azVers[i]);
25762582
}
25772583
printf("---------------------------------------------------\n");
25782584
}
25792585
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);
25822594
}
25832595
}
25842596
25852597
/*
25862598
** COMMAND: test-looks-like-utf
25872599
--- 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

Keyboard Shortcuts

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