Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add a new timeline format that puts the details in a separate table column from the check-in comment. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
dbb7447372c1ea60d6f0274d9a2719eb |
| User & Date: | drh 2017-11-24 20:30:13.472 |
Context
|
2017-11-24
| ||
| 20:46 | New class "timelineDetailCell" for all <td> elements that hold the separate detail column of a timeline. check-in: b39985508b user: drh tags: trunk | |
| 20:30 | Add a new timeline format that puts the details in a separate table column from the check-in comment. check-in: dbb7447372 user: drh tags: trunk | |
| 20:10 | Provide a configuration option that can move the hash in a timeline before the comment, after the comment, or into the details, and can omit the details span. check-in: 4102f60846 user: drh tags: trunk | |
Changes
Changes to src/finfo.c.
| ︙ | ︙ | |||
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
int fShowId = P("showid")!=0;
Stmt qparent;
int iTableId = timeline_tableid();
int bHashBeforeComment = 0; /* Show hash before the comment */
int bHashAfterComment = 0; /* Show hash after the comment */
int bHashInDetail = 0; /* Show the hash inside the detail section */
int bShowDetail; /* Show the detail section */
int eCommentFormat; /* value for timeline-comment-format */
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
style_header("File History");
login_anonymous_available();
url_initialize(&url, "finfo");
if( brBg ) url_add_parameter(&url, "brbg", 0);
if( uBg ) url_add_parameter(&url, "ubg", 0);
baseCheckin = name_to_rid_www("ci");
zPrevDate[0] = 0;
zFilename = PD("name","");
eCommentFormat = db_get_int("timeline-comment-format", 0);
bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
switch( (eCommentFormat>>1)&3 ){
case 1: bHashAfterComment = 1; break;
case 2: bHashInDetail = 1; break;
default: bHashBeforeComment = 1; break;
}
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
if( fnid==0 ){
| > > | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
int fShowId = P("showid")!=0;
Stmt qparent;
int iTableId = timeline_tableid();
int bHashBeforeComment = 0; /* Show hash before the comment */
int bHashAfterComment = 0; /* Show hash after the comment */
int bHashInDetail = 0; /* Show the hash inside the detail section */
int bShowDetail; /* Show the detail section */
int bSeparateDetail; /* Detail section in a separate column */
int eCommentFormat; /* value for timeline-comment-format */
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
style_header("File History");
login_anonymous_available();
url_initialize(&url, "finfo");
if( brBg ) url_add_parameter(&url, "brbg", 0);
if( uBg ) url_add_parameter(&url, "ubg", 0);
baseCheckin = name_to_rid_www("ci");
zPrevDate[0] = 0;
zFilename = PD("name","");
eCommentFormat = db_get_int("timeline-comment-format", 0);
bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
bSeparateDetail = (eCommentFormat & 8)!=0;
switch( (eCommentFormat>>1)&3 ){
case 1: bHashAfterComment = 1; break;
case 2: bHashInDetail = 1; break;
default: bHashBeforeComment = 1; break;
}
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
if( fnid==0 ){
|
| ︙ | ︙ | |||
520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
hyperlink_to_uuid(zUuid);
}
@ <span class="timelineComment timelineCheckinComment">%W(zCom)</span>
if( bHashAfterComment && zUuid ){
hyperlink_to_uuid(zUuid);
}
if( bShowDetail ){
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
if( zUuid && bHashInDetail ){
@ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
if( fShowId ){
int srcId = delta_source_rid(frid);
if( srcId>0 ){
@ id: %d(frid)←%d(srcId)
| > > > > > > > | 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
hyperlink_to_uuid(zUuid);
}
@ <span class="timelineComment timelineCheckinComment">%W(zCom)</span>
if( bHashAfterComment && zUuid ){
hyperlink_to_uuid(zUuid);
}
if( bShowDetail ){
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] ){
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell">
}
}
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
if( zUuid && bHashInDetail ){
@ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
if( fShowId ){
int srcId = delta_source_rid(frid);
if( srcId>0 ){
@ id: %d(frid)←%d(srcId)
|
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 |
static const char *const azCommentFormats[] = {
"0", "[hash] comment (details)",
"1", "[hash] comment",
"2", "comment [hash] (details)",
"3", "comment [hash]",
"4", "comment (details)",
"5", "comment-only",
};
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
| > | 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 |
static const char *const azCommentFormats[] = {
"0", "[hash] comment (details)",
"1", "[hash] comment",
"2", "comment [hash] (details)",
"3", "comment [hash]",
"4", "comment (details)",
"5", "comment-only",
"12","comment | details",
};
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
int vid = 0; /* Current checkout version */
int dateFormat = 0; /* 0: HH:MM (default) */
int bCommentGitStyle = 0; /* Only show comments through first blank line */
int bHashBeforeComment = 0; /* Show hash before the comment */
int bHashAfterComment = 0; /* Show hash after the comment */
int bHashInDetail = 0; /* Show the hash inside the detail section */
int bShowDetail; /* Show the detail section */
int eCommentFormat; /* value for timeline-comment-format */
const char *zDateFmt;
int iTableId = timeline_tableid();
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
vid = db_lget_int("checkout", 0);
}
zPrevDate[0] = 0;
mxWikiLen = db_get_int("timeline-max-comment", 0);
dateFormat = db_get_int("timeline-date-format", 0);
bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
eCommentFormat = db_get_int("timeline-comment-format", 0);
| > | > | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
int vid = 0; /* Current checkout version */
int dateFormat = 0; /* 0: HH:MM (default) */
int bCommentGitStyle = 0; /* Only show comments through first blank line */
int bHashBeforeComment = 0; /* Show hash before the comment */
int bHashAfterComment = 0; /* Show hash after the comment */
int bHashInDetail = 0; /* Show the hash inside the detail section */
int bShowDetail; /* Show the detail section */
int bSeparateDetail; /* Detail in a separate column */
int eCommentFormat; /* value for timeline-comment-format */
const char *zDateFmt;
int iTableId = timeline_tableid();
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
vid = db_lget_int("checkout", 0);
}
zPrevDate[0] = 0;
mxWikiLen = db_get_int("timeline-max-comment", 0);
dateFormat = db_get_int("timeline-date-format", 0);
bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
eCommentFormat = db_get_int("timeline-comment-format", 0);
bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
bSeparateDetail = (eCommentFormat & 8)!=0; /* Bit 3 turns on the detail column */
switch( (eCommentFormat>>1)&3 ){
case 1: bHashAfterComment = 1; break;
case 2: bHashInDetail = 1; break;
default: bHashBeforeComment = 1; break;
}
zDateFmt = P("datefmt");
if( zDateFmt ) dateFormat = atoi(zDateFmt);
|
| ︙ | ︙ | |||
534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
}
/* Generate extra information and hyperlinks to follow the comment.
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
*/
if( bShowDetail ){
if( zType[0]=='c' ){
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
}else{
cgi_printf("<span class='timelineDetail'>(");
}
if( bHashInDetail ){
| > > > > > > > | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
}
/* Generate extra information and hyperlinks to follow the comment.
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
*/
if( bShowDetail ){
if( bSeparateDetail ){
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
}else{
@ <td class="timelineTableCell">
}
}
if( zType[0]=='c' ){
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
}else{
cgi_printf("<span class='timelineDetail'>(");
}
if( bHashInDetail ){
|
| ︙ | ︙ |