Fossil SCM
Further improvements to the web display of annotations and file history.
Commit
ef26e7624e1e81ed16ebb9c1d40ff6e11a7f3de9
Parent
71a916ee9507d6f…
2 files changed
+10
-4
+3
-3
+10
-4
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2398,10 +2398,11 @@ | ||
| 2398 | 2398 | int i; |
| 2399 | 2399 | int iLimit; /* Depth limit */ |
| 2400 | 2400 | int annFlags = ANN_FILE_ANCEST; |
| 2401 | 2401 | int showLog = 0; /* True to display the log */ |
| 2402 | 2402 | const char *zFilename; /* Name of file to annotate */ |
| 2403 | + const char *zCI; /* The check-in containing zFilename */ | |
| 2403 | 2404 | char zFormat[10]; /* Format string for line numbers */ |
| 2404 | 2405 | Annotator ann; |
| 2405 | 2406 | HQuery url; |
| 2406 | 2407 | struct AnnVers *p; |
| 2407 | 2408 | unsigned clr1, clr2, clr; |
| @@ -2421,10 +2422,11 @@ | ||
| 2421 | 2422 | } |
| 2422 | 2423 | |
| 2423 | 2424 | /* compute the annotation */ |
| 2424 | 2425 | compute_direct_ancestors(mid, 10000000); |
| 2425 | 2426 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2427 | + zCI = ann.aVers[0].zMUuid; | |
| 2426 | 2428 | |
| 2427 | 2429 | /* generate the web page */ |
| 2428 | 2430 | style_header("Annotation For %h", zFilename); |
| 2429 | 2431 | url_initialize(&url, "annotate"); |
| 2430 | 2432 | url_add_parameter(&url, "checkin", P("checkin")); |
| @@ -2463,11 +2465,12 @@ | ||
| 2463 | 2465 | clr = gradient_color(clr1, clr2, ann.nVers-1, i); |
| 2464 | 2466 | ann.aVers[i].zBgColor = mprintf("#%06x", clr); |
| 2465 | 2467 | } |
| 2466 | 2468 | |
| 2467 | 2469 | 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> | |
| 2469 | 2472 | @ <ol> |
| 2470 | 2473 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2471 | 2474 | @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate) |
| 2472 | 2475 | @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a> |
| 2473 | 2476 | @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a> |
| @@ -2489,15 +2492,18 @@ | ||
| 2489 | 2492 | } |
| 2490 | 2493 | @ </ol> |
| 2491 | 2494 | @ <hr> |
| 2492 | 2495 | } |
| 2493 | 2496 | 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> | |
| 2495 | 2500 | iLimit = ann.nVers+10; |
| 2496 | 2501 | }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> | |
| 2499 | 2505 | } |
| 2500 | 2506 | @ <pre> |
| 2501 | 2507 | for(i=0; i<ann.nOrig; i++){ |
| 2502 | 2508 | int iVers = ann.aOrig[i].iVers; |
| 2503 | 2509 | char *z = (char*)ann.aOrig[i].z; |
| 2504 | 2510 |
| --- 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 @@ | ||
| 366 | 366 | blob_reset(&sql); |
| 367 | 367 | blob_zero(&title); |
| 368 | 368 | if( baseCheckin ){ |
| 369 | 369 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 370 | 370 | 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); | |
| 373 | 373 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 374 | 374 | fossil_free(zUuid); |
| 375 | 375 | }else{ |
| 376 | - blob_appendf(&title, "History of "); | |
| 376 | + blob_appendf(&title, "History of files named "); | |
| 377 | 377 | hyperlinked_path(zFilename, &title, 0); |
| 378 | 378 | } |
| 379 | 379 | @ <h2>%b(&title)</h2> |
| 380 | 380 | blob_reset(&title); |
| 381 | 381 | pGraph = graph_init(); |
| 382 | 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, "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 |