Fossil SCM

Give greater emphasis to the check-in comment on timeline displays. Move the check-in hash into the details section at the end of each entry.

drh 2017-11-24 14:19 UTC trunk
Commit 4438e68de3d53c859a41cc33ddf6ff07846c6cad0ced09e1cd90bd056514941d
2 files changed +28 -25 +39 -45
+28 -25
--- src/finfo.c
+++ src/finfo.c
@@ -502,55 +502,58 @@
502502
if( zBgClr && zBgClr[0] ){
503503
@ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
504504
}else{
505505
@ <td class="timelineTableCell">
506506
}
507
+ @ <span class="timelineComment">%W(zCom)</span>
508
+ cgi_printf("<span class='timelineDetail'>(");
507509
if( zUuid ){
508
- if( origCheckin==0 ){
509
- if( nParent==0 ){
510
- @ <b>Added</b>
511
- }else if( pfnid ){
512
- char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
513
- pfnid);
514
- @ <b>Renamed</b> from
515
- @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
516
- }
517
- }
518
- @ %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
510
+ @ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
519511
if( fShowId ){
520512
int srcId = delta_source_rid(frid);
521513
if( srcId>0 ){
522
- @ (%d(frid)&larr;%d(srcId))
514
+ @ id: %d(frid)&larr;%d(srcId)
523515
}else{
524
- @ (%d(frid))
516
+ @ id: %d(frid)
525517
}
526518
}
527
- @ part of check-in
528
- }else{
519
+ }
520
+ @ check-in:
521
+ hyperlink_to_uuid(zCkin);
522
+ if( fShowId ){
523
+ @ (%d(fmid))
524
+ }
525
+ @ user:
526
+ hyperlink_to_user(zUser, zDate, ",");
527
+ @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
528
+ @ size: %d(szFile))</span>
529
+ if( zUuid && origCheckin==0 ){
530
+ if( nParent==0 ){
531
+ @ <b>Added</b>
532
+ }else if( pfnid ){
533
+ char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
534
+ pfnid);
535
+ @ <b>Renamed</b> from
536
+ @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
537
+ }
538
+ }
539
+ if( zUuid==0 ){
529540
char *zNewName;
530541
zNewName = db_text(0,
531542
"SELECT name FROM filename WHERE fnid = "
532543
" (SELECT fnid FROM mlink"
533544
" WHERE mid=%d"
534545
" AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
535546
fmid, zFilename);
536547
if( zNewName ){
537548
@ <b>Renamed</b> to
538
- @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in
549
+ @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
539550
fossil_free(zNewName);
540551
}else{
541
- @ <b>Deleted</b> by check-in
552
+ @ <b>Deleted</b>
542553
}
543554
}
544
- hyperlink_to_uuid(zCkin);
545
- if( fShowId ){
546
- @ (%d(fmid))
547
- }
548
- @ %W(zCom) (user:
549
- hyperlink_to_user(zUser, zDate, ",");
550
- @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
551
- @ size: %d(szFile))
552555
if( g.perm.Hyperlink && zUuid ){
553556
const char *z = zFilename;
554557
@ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
555558
@ [annotate]</a>
556559
@ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
557560
--- src/finfo.c
+++ src/finfo.c
@@ -502,55 +502,58 @@
502 if( zBgClr && zBgClr[0] ){
503 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
504 }else{
505 @ <td class="timelineTableCell">
506 }
 
 
507 if( zUuid ){
508 if( origCheckin==0 ){
509 if( nParent==0 ){
510 @ <b>Added</b>
511 }else if( pfnid ){
512 char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
513 pfnid);
514 @ <b>Renamed</b> from
515 @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
516 }
517 }
518 @ %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
519 if( fShowId ){
520 int srcId = delta_source_rid(frid);
521 if( srcId>0 ){
522 @ (%d(frid)&larr;%d(srcId))
523 }else{
524 @ (%d(frid))
525 }
526 }
527 @ part of check-in
528 }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529 char *zNewName;
530 zNewName = db_text(0,
531 "SELECT name FROM filename WHERE fnid = "
532 " (SELECT fnid FROM mlink"
533 " WHERE mid=%d"
534 " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
535 fmid, zFilename);
536 if( zNewName ){
537 @ <b>Renamed</b> to
538 @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a> by check-in
539 fossil_free(zNewName);
540 }else{
541 @ <b>Deleted</b> by check-in
542 }
543 }
544 hyperlink_to_uuid(zCkin);
545 if( fShowId ){
546 @ (%d(fmid))
547 }
548 @ %W(zCom) (user:
549 hyperlink_to_user(zUser, zDate, ",");
550 @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
551 @ size: %d(szFile))
552 if( g.perm.Hyperlink && zUuid ){
553 const char *z = zFilename;
554 @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
555 @ [annotate]</a>
556 @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
557
--- src/finfo.c
+++ src/finfo.c
@@ -502,55 +502,58 @@
502 if( zBgClr && zBgClr[0] ){
503 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
504 }else{
505 @ <td class="timelineTableCell">
506 }
507 @ <span class="timelineComment">%W(zCom)</span>
508 cgi_printf("<span class='timelineDetail'>(");
509 if( zUuid ){
510 @ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
 
 
 
 
 
 
 
 
 
 
511 if( fShowId ){
512 int srcId = delta_source_rid(frid);
513 if( srcId>0 ){
514 @ id: %d(frid)&larr;%d(srcId)
515 }else{
516 @ id: %d(frid)
517 }
518 }
519 }
520 @ check-in:
521 hyperlink_to_uuid(zCkin);
522 if( fShowId ){
523 @ (%d(fmid))
524 }
525 @ user:
526 hyperlink_to_user(zUser, zDate, ",");
527 @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
528 @ size: %d(szFile))</span>
529 if( zUuid && origCheckin==0 ){
530 if( nParent==0 ){
531 @ <b>Added</b>
532 }else if( pfnid ){
533 char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
534 pfnid);
535 @ <b>Renamed</b> from
536 @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
537 }
538 }
539 if( zUuid==0 ){
540 char *zNewName;
541 zNewName = db_text(0,
542 "SELECT name FROM filename WHERE fnid = "
543 " (SELECT fnid FROM mlink"
544 " WHERE mid=%d"
545 " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
546 fmid, zFilename);
547 if( zNewName ){
548 @ <b>Renamed</b> to
549 @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
550 fossil_free(zNewName);
551 }else{
552 @ <b>Deleted</b>
553 }
554 }
 
 
 
 
 
 
 
 
555 if( g.perm.Hyperlink && zUuid ){
556 const char *z = zFilename;
557 @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin))
558 @ [annotate]</a>
559 @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin))
560
+39 -45
--- src/timeline.c
+++ src/timeline.c
@@ -420,43 +420,19 @@
420420
@ &bull;
421421
}
422422
if( modPending ){
423423
@ <span class="modpending">(Awaiting Moderator Approval)</span>
424424
}
425
- if( zType[0]=='c' ){
426
- if( tmFlags & TIMELINE_BISECT ){
427
- static Stmt bisectQuery;
428
- db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
429
- db_bind_int(&bisectQuery, ":rid", rid);
430
- if( db_step(&bisectQuery)==SQLITE_ROW ){
431
- @ <b>%s(db_column_text(&bisectQuery,1))</b>
432
- @ (%d(db_column_int(&bisectQuery,0)))
433
- }
434
- db_reset(&bisectQuery);
435
- }
436
- hyperlink_to_uuid(zUuid);
437
- if( isLeaf ){
438
- if( db_exists("SELECT 1 FROM tagxref"
439
- " WHERE rid=%d AND tagid=%d AND tagtype>0",
440
- rid, TAG_CLOSED) ){
441
- @ <span class="timelineLeaf">Closed-Leaf:</span>
442
- }else{
443
- @ <span class="timelineLeaf">Leaf:</span>
444
- }
445
- }
446
- }else if( zType[0]=='e' && tagid ){
447
- hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
448
- }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
449
- hyperlink_to_uuid(zUuid);
450
- }
451
- if( tmFlags & TIMELINE_SHOWRID ){
452
- int srcId = delta_source_rid(rid);
453
- if( srcId ){
454
- @ (%d(rid)&larr;%d(srcId))
455
- }else{
456
- @ (%d(rid))
457
- }
425
+ if( (tmFlags & TIMELINE_BISECT)!=0 && zType[0]=='c' ){
426
+ static Stmt bisectQuery;
427
+ db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
428
+ db_bind_int(&bisectQuery, ":rid", rid);
429
+ if( db_step(&bisectQuery)==SQLITE_ROW ){
430
+ @ <b>%s(db_column_text(&bisectQuery,1))</b>
431
+ @ (%d(db_column_int(&bisectQuery,0)))
432
+ }
433
+ db_reset(&bisectQuery);
458434
}
459435
db_column_blob(pQuery, commentColumn, &comment);
460436
if( zType[0]!='c' ){
461437
/* Comments for anything other than a check-in are generated by
462438
** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -484,29 +460,36 @@
484460
}else{
485461
@ <span class="timelineComment">%W(blob_str(&comment))</span>
486462
}
487463
blob_reset(&comment);
488464
489
- /* Generate the "user: USERNAME" at the end of the comment, together
490
- ** with a hyperlink to another timeline for that user.
465
+ /* Generate extra information and hyperlinks to follow the comment.
466
+ ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
491467
*/
492
- if( zTagList && zTagList[0]==0 ) zTagList = 0;
468
+ cgi_printf("<span class='timelineDetail'>(");
469
+ if( zType[0]=='c' ){
470
+ cgi_printf("check-in: ");
471
+ hyperlink_to_uuid(zUuid);
472
+ }else if( zType[0]=='e' && tagid ){
473
+ cgi_printf("technote: ");
474
+ hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
475
+ }else{
476
+ cgi_printf("artifact: ");
477
+ hyperlink_to_uuid(zUuid);
478
+ }
479
+
493480
if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
494481
char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
495
- @ (user: %z(href("%z",zLink))%h(zDispUser)</a>%s(zTagList?",":"\051")
482
+ cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser);
496483
}else{
497
- @ (user: %h(zDispUser)%s(zTagList?",":"\051")
498
- }
499
-
500
- /* Generate a "detail" link for tags. */
501
- if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){
502
- @ [%z(href("%R/info/%!S",zUuid))details</a>]
484
+ cgi_printf("user: %h", zDispUser);
503485
}
504486
505487
/* Generate the "tags: TAGLIST" at the end of the comment, together
506488
** with hyperlinks to the tag list.
507489
*/
490
+ if( zTagList && zTagList[0]==0 ) zTagList = 0;
508491
if( zTagList ){
509492
if( g.perm.Hyperlink ){
510493
int i;
511494
const char *z = zTagList;
512495
Blob links;
@@ -522,16 +505,27 @@
522505
blob_appendf(&links, "%#h", i+2, z);
523506
}
524507
if( z[i]==0 ) break;
525508
z += i+2;
526509
}
527
- @ tags: %s(blob_str(&links)))
510
+ cgi_printf(" tags: %s", blob_str(&links));
528511
blob_reset(&links);
529512
}else{
530
- @ tags: %h(zTagList))
513
+ cgi_printf(" tags: %h", zTagList);
514
+ }
515
+ }
516
+
517
+ if( tmFlags & TIMELINE_SHOWRID ){
518
+ int srcId = delta_source_rid(rid);
519
+ if( srcId ){
520
+ cgi_printf(" id: %d&larr;%d", rid, srcId);
521
+ }else{
522
+ cgi_printf(" id: %d", rid);
531523
}
532524
}
525
+ cgi_printf(")</span>\n"); /* End of the details section */
526
+
533527
tag_private_status(rid);
534528
535529
/* Generate extra hyperlinks at the end of the comment */
536530
if( xExtra ){
537531
xExtra(rid);
538532
--- src/timeline.c
+++ src/timeline.c
@@ -420,43 +420,19 @@
420 @ &bull;
421 }
422 if( modPending ){
423 @ <span class="modpending">(Awaiting Moderator Approval)</span>
424 }
425 if( zType[0]=='c' ){
426 if( tmFlags & TIMELINE_BISECT ){
427 static Stmt bisectQuery;
428 db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
429 db_bind_int(&bisectQuery, ":rid", rid);
430 if( db_step(&bisectQuery)==SQLITE_ROW ){
431 @ <b>%s(db_column_text(&bisectQuery,1))</b>
432 @ (%d(db_column_int(&bisectQuery,0)))
433 }
434 db_reset(&bisectQuery);
435 }
436 hyperlink_to_uuid(zUuid);
437 if( isLeaf ){
438 if( db_exists("SELECT 1 FROM tagxref"
439 " WHERE rid=%d AND tagid=%d AND tagtype>0",
440 rid, TAG_CLOSED) ){
441 @ <span class="timelineLeaf">Closed-Leaf:</span>
442 }else{
443 @ <span class="timelineLeaf">Leaf:</span>
444 }
445 }
446 }else if( zType[0]=='e' && tagid ){
447 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
448 }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
449 hyperlink_to_uuid(zUuid);
450 }
451 if( tmFlags & TIMELINE_SHOWRID ){
452 int srcId = delta_source_rid(rid);
453 if( srcId ){
454 @ (%d(rid)&larr;%d(srcId))
455 }else{
456 @ (%d(rid))
457 }
458 }
459 db_column_blob(pQuery, commentColumn, &comment);
460 if( zType[0]!='c' ){
461 /* Comments for anything other than a check-in are generated by
462 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -484,29 +460,36 @@
484 }else{
485 @ <span class="timelineComment">%W(blob_str(&comment))</span>
486 }
487 blob_reset(&comment);
488
489 /* Generate the "user: USERNAME" at the end of the comment, together
490 ** with a hyperlink to another timeline for that user.
491 */
492 if( zTagList && zTagList[0]==0 ) zTagList = 0;
 
 
 
 
 
 
 
 
 
 
 
493 if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
494 char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
495 @ (user: %z(href("%z",zLink))%h(zDispUser)</a>%s(zTagList?",":"\051")
496 }else{
497 @ (user: %h(zDispUser)%s(zTagList?",":"\051")
498 }
499
500 /* Generate a "detail" link for tags. */
501 if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){
502 @ [%z(href("%R/info/%!S",zUuid))details</a>]
503 }
504
505 /* Generate the "tags: TAGLIST" at the end of the comment, together
506 ** with hyperlinks to the tag list.
507 */
 
508 if( zTagList ){
509 if( g.perm.Hyperlink ){
510 int i;
511 const char *z = zTagList;
512 Blob links;
@@ -522,16 +505,27 @@
522 blob_appendf(&links, "%#h", i+2, z);
523 }
524 if( z[i]==0 ) break;
525 z += i+2;
526 }
527 @ tags: %s(blob_str(&links)))
528 blob_reset(&links);
529 }else{
530 @ tags: %h(zTagList))
 
 
 
 
 
 
 
 
 
531 }
532 }
 
 
533 tag_private_status(rid);
534
535 /* Generate extra hyperlinks at the end of the comment */
536 if( xExtra ){
537 xExtra(rid);
538
--- src/timeline.c
+++ src/timeline.c
@@ -420,43 +420,19 @@
420 @ &bull;
421 }
422 if( modPending ){
423 @ <span class="modpending">(Awaiting Moderator Approval)</span>
424 }
425 if( (tmFlags & TIMELINE_BISECT)!=0 && zType[0]=='c' ){
426 static Stmt bisectQuery;
427 db_prepare(&bisectQuery, "SELECT seq, stat FROM bilog WHERE rid=:rid");
428 db_bind_int(&bisectQuery, ":rid", rid);
429 if( db_step(&bisectQuery)==SQLITE_ROW ){
430 @ <b>%s(db_column_text(&bisectQuery,1))</b>
431 @ (%d(db_column_int(&bisectQuery,0)))
432 }
433 db_reset(&bisectQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434 }
435 db_column_blob(pQuery, commentColumn, &comment);
436 if( zType[0]!='c' ){
437 /* Comments for anything other than a check-in are generated by
438 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -484,29 +460,36 @@
460 }else{
461 @ <span class="timelineComment">%W(blob_str(&comment))</span>
462 }
463 blob_reset(&comment);
464
465 /* Generate extra information and hyperlinks to follow the comment.
466 ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
467 */
468 cgi_printf("<span class='timelineDetail'>(");
469 if( zType[0]=='c' ){
470 cgi_printf("check-in: ");
471 hyperlink_to_uuid(zUuid);
472 }else if( zType[0]=='e' && tagid ){
473 cgi_printf("technote: ");
474 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
475 }else{
476 cgi_printf("artifact: ");
477 hyperlink_to_uuid(zUuid);
478 }
479
480 if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
481 char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
482 cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser);
483 }else{
484 cgi_printf("user: %h", zDispUser);
 
 
 
 
 
485 }
486
487 /* Generate the "tags: TAGLIST" at the end of the comment, together
488 ** with hyperlinks to the tag list.
489 */
490 if( zTagList && zTagList[0]==0 ) zTagList = 0;
491 if( zTagList ){
492 if( g.perm.Hyperlink ){
493 int i;
494 const char *z = zTagList;
495 Blob links;
@@ -522,16 +505,27 @@
505 blob_appendf(&links, "%#h", i+2, z);
506 }
507 if( z[i]==0 ) break;
508 z += i+2;
509 }
510 cgi_printf(" tags: %s", blob_str(&links));
511 blob_reset(&links);
512 }else{
513 cgi_printf(" tags: %h", zTagList);
514 }
515 }
516
517 if( tmFlags & TIMELINE_SHOWRID ){
518 int srcId = delta_source_rid(rid);
519 if( srcId ){
520 cgi_printf(" id: %d&larr;%d", rid, srcId);
521 }else{
522 cgi_printf(" id: %d", rid);
523 }
524 }
525 cgi_printf(")</span>\n"); /* End of the details section */
526
527 tag_private_status(rid);
528
529 /* Generate extra hyperlinks at the end of the comment */
530 if( xExtra ){
531 xExtra(rid);
532

Keyboard Shortcuts

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