Fossil SCM

Further improvements to the web display of annotations and file history.

drh 2013-05-27 02:18 trunk
Commit ef26e7624e1e81ed16ebb9c1d40ff6e11a7f3de9
2 files changed +10 -4 +3 -3
+10 -4
--- src/diff.c
+++ src/diff.c
@@ -2398,10 +2398,11 @@
23982398
int i;
23992399
int iLimit; /* Depth limit */
24002400
int annFlags = ANN_FILE_ANCEST;
24012401
int showLog = 0; /* True to display the log */
24022402
const char *zFilename; /* Name of file to annotate */
2403
+ const char *zCI; /* The check-in containing zFilename */
24032404
char zFormat[10]; /* Format string for line numbers */
24042405
Annotator ann;
24052406
HQuery url;
24062407
struct AnnVers *p;
24072408
unsigned clr1, clr2, clr;
@@ -2421,10 +2422,11 @@
24212422
}
24222423
24232424
/* compute the annotation */
24242425
compute_direct_ancestors(mid, 10000000);
24252426
annotate_file(&ann, fnid, mid, iLimit, annFlags);
2427
+ zCI = ann.aVers[0].zMUuid;
24262428
24272429
/* generate the web page */
24282430
style_header("Annotation For %h", zFilename);
24292431
url_initialize(&url, "annotate");
24302432
url_add_parameter(&url, "checkin", P("checkin"));
@@ -2463,11 +2465,12 @@
24632465
clr = gradient_color(clr1, clr2, ann.nVers-1, i);
24642466
ann.aVers[i].zBgColor = mprintf("#%06x", clr);
24652467
}
24662468
24672469
if( showLog ){
2468
- @ <h2>Ancestors of %h(zFilename) analyzed:</h2>
2470
+ char *zLink = href("%R/finfo?name=%t&ci=%S",zFilename,zCI);
2471
+ @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2>
24692472
@ <ol>
24702473
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
24712474
@ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
24722475
@ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
24732476
@ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
@@ -2489,15 +2492,18 @@
24892492
}
24902493
@ </ol>
24912494
@ <hr>
24922495
}
24932496
if( !ann.bLimit ){
2494
- @ <h2>Origin for each line in %h(zFilename):</h2>
2497
+ @ <h2>Origin for each line in
2498
+ @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2499
+ @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
24952500
iLimit = ann.nVers+10;
24962501
}else{
2497
- @ <h2>Lines added by the %d(iLimit) most recent
2498
- @ ancestors of %h(zFilename):</h2>
2502
+ @ <h2>Lines added by the %d(iLimit) most recent ancestors of
2503
+ @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2504
+ @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
24992505
}
25002506
@ <pre>
25012507
for(i=0; i<ann.nOrig; i++){
25022508
int iVers = ann.aOrig[i].iVers;
25032509
char *z = (char*)ann.aOrig[i].z;
25042510
--- src/diff.c
+++ src/diff.c
@@ -2398,10 +2398,11 @@
2398 int i;
2399 int iLimit; /* Depth limit */
2400 int annFlags = ANN_FILE_ANCEST;
2401 int showLog = 0; /* True to display the log */
2402 const char *zFilename; /* Name of file to annotate */
 
2403 char zFormat[10]; /* Format string for line numbers */
2404 Annotator ann;
2405 HQuery url;
2406 struct AnnVers *p;
2407 unsigned clr1, clr2, clr;
@@ -2421,10 +2422,11 @@
2421 }
2422
2423 /* compute the annotation */
2424 compute_direct_ancestors(mid, 10000000);
2425 annotate_file(&ann, fnid, mid, iLimit, annFlags);
 
2426
2427 /* generate the web page */
2428 style_header("Annotation For %h", zFilename);
2429 url_initialize(&url, "annotate");
2430 url_add_parameter(&url, "checkin", P("checkin"));
@@ -2463,11 +2465,12 @@
2463 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2464 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2465 }
2466
2467 if( showLog ){
2468 @ <h2>Ancestors of %h(zFilename) analyzed:</h2>
 
2469 @ <ol>
2470 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2471 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2472 @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2473 @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
@@ -2489,15 +2492,18 @@
2489 }
2490 @ </ol>
2491 @ <hr>
2492 }
2493 if( !ann.bLimit ){
2494 @ <h2>Origin for each line in %h(zFilename):</h2>
 
 
2495 iLimit = ann.nVers+10;
2496 }else{
2497 @ <h2>Lines added by the %d(iLimit) most recent
2498 @ ancestors of %h(zFilename):</h2>
 
2499 }
2500 @ <pre>
2501 for(i=0; i<ann.nOrig; i++){
2502 int iVers = ann.aOrig[i].iVers;
2503 char *z = (char*)ann.aOrig[i].z;
2504
--- src/diff.c
+++ src/diff.c
@@ -2398,10 +2398,11 @@
2398 int i;
2399 int iLimit; /* Depth limit */
2400 int annFlags = ANN_FILE_ANCEST;
2401 int showLog = 0; /* True to display the log */
2402 const char *zFilename; /* Name of file to annotate */
2403 const char *zCI; /* The check-in containing zFilename */
2404 char zFormat[10]; /* Format string for line numbers */
2405 Annotator ann;
2406 HQuery url;
2407 struct AnnVers *p;
2408 unsigned clr1, clr2, clr;
@@ -2421,10 +2422,11 @@
2422 }
2423
2424 /* compute the annotation */
2425 compute_direct_ancestors(mid, 10000000);
2426 annotate_file(&ann, fnid, mid, iLimit, annFlags);
2427 zCI = ann.aVers[0].zMUuid;
2428
2429 /* generate the web page */
2430 style_header("Annotation For %h", zFilename);
2431 url_initialize(&url, "annotate");
2432 url_add_parameter(&url, "checkin", P("checkin"));
@@ -2463,11 +2465,12 @@
2465 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2466 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2467 }
2468
2469 if( showLog ){
2470 char *zLink = href("%R/finfo?name=%t&ci=%S",zFilename,zCI);
2471 @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2>
2472 @ <ol>
2473 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2474 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2475 @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2476 @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
@@ -2489,15 +2492,18 @@
2492 }
2493 @ </ol>
2494 @ <hr>
2495 }
2496 if( !ann.bLimit ){
2497 @ <h2>Origin for each line in
2498 @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2499 @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2500 iLimit = ann.nVers+10;
2501 }else{
2502 @ <h2>Lines added by the %d(iLimit) most recent ancestors of
2503 @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2504 @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2505 }
2506 @ <pre>
2507 for(i=0; i<ann.nOrig; i++){
2508 int iVers = ann.aOrig[i].iVers;
2509 char *z = (char*)ann.aOrig[i].z;
2510
+3 -3
--- src/finfo.c
+++ src/finfo.c
@@ -366,16 +366,16 @@
366366
blob_reset(&sql);
367367
blob_zero(&title);
368368
if( baseCheckin ){
369369
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
370370
char *zLink = href("%R/info/%S", zUuid);
371
- blob_appendf(&title, "Ancestry of ");
372
- hyperlinked_path(zFilename, &title, 0);
371
+ blob_appendf(&title, "Ancestors of file ");
372
+ hyperlinked_path(zFilename, &title, zUuid);
373373
blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
374374
fossil_free(zUuid);
375375
}else{
376
- blob_appendf(&title, "History of ");
376
+ blob_appendf(&title, "History of files named ");
377377
hyperlinked_path(zFilename, &title, 0);
378378
}
379379
@ <h2>%b(&title)</h2>
380380
blob_reset(&title);
381381
pGraph = graph_init();
382382
--- src/finfo.c
+++ src/finfo.c
@@ -366,16 +366,16 @@
366 blob_reset(&sql);
367 blob_zero(&title);
368 if( baseCheckin ){
369 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
370 char *zLink = href("%R/info/%S", zUuid);
371 blob_appendf(&title, "Ancestry of ");
372 hyperlinked_path(zFilename, &title, 0);
373 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
374 fossil_free(zUuid);
375 }else{
376 blob_appendf(&title, "History of ");
377 hyperlinked_path(zFilename, &title, 0);
378 }
379 @ <h2>%b(&title)</h2>
380 blob_reset(&title);
381 pGraph = graph_init();
382
--- src/finfo.c
+++ src/finfo.c
@@ -366,16 +366,16 @@
366 blob_reset(&sql);
367 blob_zero(&title);
368 if( baseCheckin ){
369 char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
370 char *zLink = href("%R/info/%S", zUuid);
371 blob_appendf(&title, "Ancestors of file ");
372 hyperlinked_path(zFilename, &title, zUuid);
373 blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
374 fossil_free(zUuid);
375 }else{
376 blob_appendf(&title, "History of files named ");
377 hyperlinked_path(zFilename, &title, 0);
378 }
379 @ <h2>%b(&title)</h2>
380 blob_reset(&title);
381 pGraph = graph_init();
382

Keyboard Shortcuts

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