Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Use long UUID's in more hyperlinks, without affecting UI display. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
b0d9468bff8fbfca8dbb883622915840 |
| User & Date: | jan.nijtmans 2014-03-31 10:30:11.514 |
Context
|
2014-03-31
| ||
| 12:59 | Add missing db_finalize() statements. check-in: 07e93f3854 user: drh tags: trunk | |
| 10:30 | Use long UUID's in more hyperlinks, without affecting UI display. check-in: b0d9468bff user: jan.nijtmans tags: trunk | |
|
2014-03-29
| ||
| 09:03 | s/free()/fossil_free()/, for consistency. check-in: c94df7244a user: stephan tags: trunk | |
Changes
Changes to src/finfo.c.
| ︙ | ︙ | |||
372 373 374 375 376 377 378 |
if( P("showsql")!=0 ){
@ <p>SQL: %h(blob_str(&sql))</p>
}
blob_reset(&sql);
blob_zero(&title);
if( baseCheckin ){
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
| | | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
if( P("showsql")!=0 ){
@ <p>SQL: %h(blob_str(&sql))</p>
}
blob_reset(&sql);
blob_zero(&title);
if( baseCheckin ){
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin);
char *zLink = href("%R/info/%s", zUuid);
blob_appendf(&title, "Ancestors of file ");
hyperlinked_path(zFilename, &title, zUuid, "tree", "");
blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid);
fossil_free(zUuid);
}else{
blob_appendf(&title, "History of files named ");
hyperlinked_path(zFilename, &title, 0, "tree", "");
|
| ︙ | ︙ | |||
402 403 404 405 406 407 408 |
const char *zCkin = db_column_text(&q,7);
const char *zBgClr = db_column_text(&q, 8);
const char *zBr = db_column_text(&q, 9);
int fmid = db_column_int(&q, 10);
int pfnid = db_column_int(&q, 11);
int gidx;
char zTime[10];
| < < | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
const char *zCkin = db_column_text(&q,7);
const char *zBgClr = db_column_text(&q, 8);
const char *zBr = db_column_text(&q, 9);
int fmid = db_column_int(&q, 10);
int pfnid = db_column_int(&q, 11);
int gidx;
char zTime[10];
if( zBr==0 ) zBr = "trunk";
if( uBg ){
zBgClr = hash_color(zUser);
}else if( brBg || zBgClr==0 || zBgClr[0]==0 ){
zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr);
}
gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr,
|
| ︙ | ︙ | |||
428 429 430 431 432 433 434 |
@ %z(href("%R/timeline?c=%t",zDate))%s(zTime)</a></td>
@ <td class="timelineGraph"><div id="m%d(gidx)"></div></td>
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell">
}
| < < | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
@ %z(href("%R/timeline?c=%t",zDate))%s(zTime)</a></td>
@ <td class="timelineGraph"><div id="m%d(gidx)"></div></td>
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell">
}
if( zUuid ){
if( fpid==0 ){
@ <b>Added</b>
}else if( pfnid ){
char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d",
pfnid);
@ <b>Renamed</b> from
|
| ︙ | ︙ | |||
456 457 458 459 460 461 462 |
@ <b>Renamed</b> to
@ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in
fossil_free(zNewName);
}else{
@ <b>Deleted</b> by check-in
}
}
| | | | | | | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
@ <b>Renamed</b> to
@ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in
fossil_free(zNewName);
}else{
@ <b>Deleted</b> by check-in
}
}
hyperlink_to_uuid(zCkin);
@ %w(zCom) (user:
hyperlink_to_user(zUser, zDate, "");
@ branch: %h(zBr))
if( g.perm.Hyperlink && zUuid ){
const char *z = zFilename;
@ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
@ [annotate]</a>
@ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
@ [blame]</a>
@ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins using]</a>
if( fpid ){
@ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a>
}
}
if( fDebug & FINFO_DEBUG_MLINK ){
int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid);
int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid);
@ <br>fid=%d(frid) pid=%d(fpid) mid=%d(fmid) sz=%d(sz)
if( srcid ){
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
397 398 399 400 401 402 403 |
@ <p>Added %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
@ version %z(href("%R/artifact/%s",zNew))[%S(zNew)]</a>
}
if( diffFlags ){
append_diff(zOld, zNew, diffFlags, pRe);
}else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
@
| | | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
@ <p>Added %z(href("%R/finfo?name=%T",zName))%h(zName)</a>
@ version %z(href("%R/artifact/%s",zNew))[%S(zNew)]</a>
}
if( diffFlags ){
append_diff(zOld, zNew, diffFlags, pRe);
}else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
@
@ %z(href("%R/fdiff?v1=%s&v2=%s&sbs=1",zOld,zNew))[diff]</a>
}
}
}
/*
** Generate javascript to enhance HTML diffs.
*/
|
| ︙ | ︙ | |||
610 611 612 613 614 615 616 |
zPJ = blob_str(&projName);
for(jj=0; zPJ[jj]; jj++){
if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
zPJ[jj] = '_';
}
}
@ <tr><th>Timelines:</th><td>
| | | | | | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 |
zPJ = blob_str(&projName);
for(jj=0; zPJ[jj]; jj++){
if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
zPJ[jj] = '_';
}
}
@ <tr><th>Timelines:</th><td>
@ %z(href("%R/timeline?f=%s&unhide",zUuid))family</a>
if( zParent ){
@ | %z(href("%R/timeline?p=%s&unhide",zUuid))ancestors</a>
}
if( !isLeaf ){
@ | %z(href("%R/timeline?d=%s&unhide",zUuid))descendants</a>
}
if( zParent && !isLeaf ){
@ | %z(href("%R/timeline?dp=%s&unhide",zUuid))both</a>
}
db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
" WHERE rid=%d AND tagtype>0 "
" AND tag.tagid=tagxref.tagid "
" AND +tag.tagname GLOB 'sym-*'", rid);
while( db_step(&q2)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q2, 0);
|
| ︙ | ︙ | |||
645 646 647 648 649 650 651 |
@ | %z(href("%R/zip/%t-%S.zip?uuid=%s",zPJ,zUuid,zUuid))
@ ZIP archive</a>
fossil_free(zUrl);
}
@ </td></tr>
@ <tr><th>Other Links:</th>
@ <td>
| | | | | | | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 |
@ | %z(href("%R/zip/%t-%S.zip?uuid=%s",zPJ,zUuid,zUuid))
@ ZIP archive</a>
fossil_free(zUrl);
}
@ </td></tr>
@ <tr><th>Other Links:</th>
@ <td>
@ %z(href("%R/tree?ci=%s",zUuid))files</a>
@ | %z(href("%R/fileage?name=%s",zUuid))file ages</a>
@ | %z(href("%R/tree?ci=%s&nofiles",zUuid))folders</a>
@ | %z(href("%R/artifact/%s",zUuid))manifest</a>
if( g.perm.Write ){
@ | %z(href("%R/ci_edit?r=%s",zUuid))edit</a>
}
@ </td>
@ </tr>
blob_reset(&projName);
}
@ </table>
}else{
|
| ︙ | ︙ | |||
697 698 699 700 701 702 703 |
}else{
@ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
@ Show Unified Diffs</a>
@ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
@ Show Side-by-Side Diffs</a>
}
if( zParent ){
| | | 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 |
}else{
@ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
@ Show Unified Diffs</a>
@ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
@ Show Side-by-Side Diffs</a>
}
if( zParent ){
@ %z(xhref("class='button'","%R/vpatch?from=%s&to=%s",zParent,zUuid))
@ Patch</a>
}
@</div>
if( pRe ){
@ <p><b>Only differences that match regular expression "%h(zRe)"
@ are shown.</b></p>
}
|
| ︙ | ︙ | |||
768 769 770 771 772 773 774 |
if( strcmp(zModAction,"approve")==0 ){
moderation_approve(rid);
}
}
style_header("Update of \"%h\"", pWiki->zWikiTitle);
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate);
| | | 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 |
if( strcmp(zModAction,"approve")==0 ){
moderation_approve(rid);
}
}
style_header("Update of \"%h\"", pWiki->zWikiTitle);
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate);
style_submenu_element("Raw", "Raw", "artifact/%s", zUuid);
style_submenu_element("History", "History", "whistory?name=%t",
pWiki->zWikiTitle);
style_submenu_element("Page", "Page", "wiki?name=%t",
pWiki->zWikiTitle);
login_anonymous_available();
@ <div class="section">Overview</div>
@ <p><table class="label-value">
|
| ︙ | ︙ | |||
796 797 798 799 800 801 802 |
@ <tr><th>Original User:</th><td>
hyperlink_to_user(pWiki->zUser, zDate, "</td></tr>");
if( pWiki->nParent>0 ){
int i;
@ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td>
for(i=0; i<pWiki->nParent; i++){
char *zParent = pWiki->azParent[i];
| | | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
@ <tr><th>Original User:</th><td>
hyperlink_to_user(pWiki->zUser, zDate, "</td></tr>");
if( pWiki->nParent>0 ){
int i;
@ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td>
for(i=0; i<pWiki->nParent; i++){
char *zParent = pWiki->azParent[i];
@ %z(href("info/%s",zParent))%s(zParent)</a>
}
@ </td></tr>
}
@ </table>
if( g.perm.ModWiki && modPending ){
@ <div class="section">Moderation</div>
|
| ︙ | ︙ | |||
1186 1187 1188 1189 1190 1191 1192 |
hyperlink_to_uuid(zVers);
if( zBr && zBr[0] ){
@ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
}
@ - %!w(zCom) (user:
hyperlink_to_user(zUser,zDate,")");
if( g.perm.Hyperlink ){
| | | | | 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 |
hyperlink_to_uuid(zVers);
if( zBr && zBr[0] ){
@ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
}
@ - %!w(zCom) (user:
hyperlink_to_user(zUser,zDate,")");
if( g.perm.Hyperlink ){
@ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
@ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
@ [annotate]</a>
@ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
@ [blame]</a>
}
cnt++;
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_append(pDownloadName, zName, -1);
}
}
|
| ︙ | ︙ | |||
1300 1301 1302 1303 1304 1305 1306 |
@ Also attachment "%h(zFilename)" to
}else{
@ Attachment "%h(zFilename)" to
}
objType |= OBJTYPE_ATTACHMENT;
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
if( g.perm.Hyperlink && g.perm.RdTkt ){
| | | 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 |
@ Also attachment "%h(zFilename)" to
}else{
@ Attachment "%h(zFilename)" to
}
objType |= OBJTYPE_ATTACHMENT;
if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
if( g.perm.Hyperlink && g.perm.RdTkt ){
@ ticket [%z(href("%R/tktview?name=%s",zTarget))%S(zTarget)</a>]
}else{
@ ticket [%S(zTarget)]
}
}else{
if( g.perm.Hyperlink && g.perm.RdWiki ){
@ wiki page [%z(href("%R/wiki?name=%t",zTarget))%h(zTarget)</a>]
}else{
|
| ︙ | ︙ | |||
1326 1327 1328 1329 1330 1331 1332 |
db_finalize(&q);
if( cnt==0 ){
@ Control artifact.
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
}
}else if( linkToView && g.perm.Hyperlink ){
| | | 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
db_finalize(&q);
if( cnt==0 ){
@ Control artifact.
if( pDownloadName && blob_size(pDownloadName)==0 ){
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
}
}else if( linkToView && g.perm.Hyperlink ){
@ %z(href("%R/artifact/%s",zUuid))[view]</a>
}
return objType;
}
/*
** WEBPAGE: fdiff
|
| ︙ | ︙ | |||
1402 1403 1404 1405 1406 1407 1408 |
style_submenu_element("Unified Diff", "udiff",
"%s/fdiff?v1=%T&v2=%T&sbs=0%s",
g.zTop, P("v1"), P("v2"), zW);
}
if( P("smhdr")!=0 ){
@ <h2>Differences From Artifact
| | | | | | 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 |
style_submenu_element("Unified Diff", "udiff",
"%s/fdiff?v1=%T&v2=%T&sbs=0%s",
g.zTop, P("v1"), P("v2"), zW);
}
if( P("smhdr")!=0 ){
@ <h2>Differences From Artifact
@ %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a> To
@ %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>.</h2>
}else{
@ <h2>Differences From
@ Artifact %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a>:</h2>
object_description(v1, 0, 0);
@ <h2>To Artifact %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>:</h2>
object_description(v2, 0, 0);
}
if( pRe ){
@ <b>Only differences that match regular expression "%h(zRe)"
@ are shown.</b>
}
@ <hr />
|
| ︙ | ︙ | |||
1759 1760 1761 1762 1763 1764 1765 |
output_text_with_line_numbers(z, zLn);
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
| | | | 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 |
output_text_with_line_numbers(z, zLn);
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
@ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" />
style_submenu_element("Image", "Image",
"%R/raw/%s?m=%s", zUuid, zMime);
}else{
@ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
}
@ </blockquote>
}
style_footer();
}
|
| ︙ | ︙ | |||
1817 1818 1819 1820 1821 1822 1823 |
moderation_approve(rid);
}
}
zTktTitle = db_table_has_column( "ticket", "title" )
? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
: 0;
style_header("Ticket Change Details");
| | | | | 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 |
moderation_approve(rid);
}
}
zTktTitle = db_table_has_column( "ticket", "title" )
? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
: 0;
style_header("Ticket Change Details");
style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid);
style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName);
style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName);
style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName);
if( P("plaintext") ){
style_submenu_element("Formatted", "Formatted", "%R/info/%s", zUuid);
}else{
style_submenu_element("Plaintext", "Plaintext",
"%R/info/%s?plaintext", zUuid);
}
@ <div class="section">Overview</div>
@ <p><table class="label-value">
@ <tr><th>Artifact ID:</th>
@ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a>
if( g.perm.Setup ){
|
| ︙ | ︙ | |||
2339 2340 2341 2342 2343 2344 2345 |
@ <hr />
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
@ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
form_begin(0, "%R/ci_edit");
login_insert_csrf_secret();
| | | 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 |
@ <hr />
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
@ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p>
form_begin(0, "%R/ci_edit");
login_insert_csrf_secret();
@ <div><input type="hidden" name="r" value="%s(zUuid)" />
@ <table border="0" cellspacing="10">
@ <tr><th align="right" valign="top">User:</th>
@ <td valign="top">
@ <input type="text" name="u" size="20" value="%h(zNewUser)" />
@ </td></tr>
|
| ︙ | ︙ |