Fossil SCM

Improved descriptions of the two check-ins being compared on the vdiff page.

drh 2012-09-06 20:31 trunk
Commit 6b22a464d7ff59a29a455792e948f06dba32470c
1 file changed +38 -7
+38 -7
--- src/info.c
+++ src/info.c
@@ -831,30 +831,61 @@
831831
}
832832
833833
/*
834834
** Output a description of a check-in
835835
*/
836
-void checkin_description(int rid){
836
+static void checkin_description(int rid){
837837
Stmt q;
838838
db_prepare(&q,
839839
"SELECT datetime(mtime), coalesce(euser,user),"
840
- " coalesce(ecomment,comment), uuid"
840
+ " coalesce(ecomment,comment), uuid,"
841
+ " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref"
842
+ " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid"
843
+ " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)"
841844
" FROM event, blob"
842845
" WHERE event.objid=%d AND type='ci'"
843846
" AND blob.rid=%d",
844847
rid, rid
845848
);
846849
while( db_step(&q)==SQLITE_ROW ){
847850
const char *zDate = db_column_text(&q, 0);
848851
const char *zUser = db_column_text(&q, 1);
849
- const char *zCom = db_column_text(&q, 2);
850852
const char *zUuid = db_column_text(&q, 3);
851
- @ Check-in
853
+ const char *zTagList = db_column_text(&q, 4);
854
+ Blob comment;
855
+ int wikiFlags = WIKI_INLINE;
856
+ if( db_get_boolean("timeline-block-markup", 0)==0 ){
857
+ wikiFlags |= WIKI_NOBLOCK;
858
+ }
852859
hyperlink_to_uuid(zUuid);
853
- @ - %w(zCom) by
854
- hyperlink_to_user(zUser,zDate," on");
855
- hyperlink_to_date(zDate, ".");
860
+ blob_zero(&comment);
861
+ db_column_blob(&q, 2, &comment);
862
+ wiki_convert(&comment, 0, wikiFlags);
863
+ blob_reset(&comment);
864
+ @ (user:
865
+ hyperlink_to_user(zUser,zDate,",");
866
+ if( zTagList && zTagList[0] && g.perm.Hyperlink ){
867
+ int i;
868
+ const char *z = zTagList;
869
+ Blob links;
870
+ blob_zero(&links);
871
+ while( z && z[0] ){
872
+ for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
873
+ blob_appendf(&links,
874
+ "%z%#h</a>%.2s",
875
+ href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i]
876
+ );
877
+ if( z[i]==0 ) break;
878
+ z += i+2;
879
+ }
880
+ @ tags: %s(blob_str(&links)),
881
+ blob_reset(&links);
882
+ }else{
883
+ @ tags: %h(zTagList),
884
+ }
885
+ @ date:
886
+ hyperlink_to_date(zDate, ")");
856887
}
857888
db_finalize(&q);
858889
}
859890
860891
861892
--- src/info.c
+++ src/info.c
@@ -831,30 +831,61 @@
831 }
832
833 /*
834 ** Output a description of a check-in
835 */
836 void checkin_description(int rid){
837 Stmt q;
838 db_prepare(&q,
839 "SELECT datetime(mtime), coalesce(euser,user),"
840 " coalesce(ecomment,comment), uuid"
 
 
 
841 " FROM event, blob"
842 " WHERE event.objid=%d AND type='ci'"
843 " AND blob.rid=%d",
844 rid, rid
845 );
846 while( db_step(&q)==SQLITE_ROW ){
847 const char *zDate = db_column_text(&q, 0);
848 const char *zUser = db_column_text(&q, 1);
849 const char *zCom = db_column_text(&q, 2);
850 const char *zUuid = db_column_text(&q, 3);
851 @ Check-in
 
 
 
 
 
852 hyperlink_to_uuid(zUuid);
853 @ - %w(zCom) by
854 hyperlink_to_user(zUser,zDate," on");
855 hyperlink_to_date(zDate, ".");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
856 }
857 db_finalize(&q);
858 }
859
860
861
--- src/info.c
+++ src/info.c
@@ -831,30 +831,61 @@
831 }
832
833 /*
834 ** Output a description of a check-in
835 */
836 static void checkin_description(int rid){
837 Stmt q;
838 db_prepare(&q,
839 "SELECT datetime(mtime), coalesce(euser,user),"
840 " coalesce(ecomment,comment), uuid,"
841 " (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref"
842 " WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid"
843 " AND tagxref.rid=blob.rid AND tagxref.tagtype>0)"
844 " FROM event, blob"
845 " WHERE event.objid=%d AND type='ci'"
846 " AND blob.rid=%d",
847 rid, rid
848 );
849 while( db_step(&q)==SQLITE_ROW ){
850 const char *zDate = db_column_text(&q, 0);
851 const char *zUser = db_column_text(&q, 1);
 
852 const char *zUuid = db_column_text(&q, 3);
853 const char *zTagList = db_column_text(&q, 4);
854 Blob comment;
855 int wikiFlags = WIKI_INLINE;
856 if( db_get_boolean("timeline-block-markup", 0)==0 ){
857 wikiFlags |= WIKI_NOBLOCK;
858 }
859 hyperlink_to_uuid(zUuid);
860 blob_zero(&comment);
861 db_column_blob(&q, 2, &comment);
862 wiki_convert(&comment, 0, wikiFlags);
863 blob_reset(&comment);
864 @ (user:
865 hyperlink_to_user(zUser,zDate,",");
866 if( zTagList && zTagList[0] && g.perm.Hyperlink ){
867 int i;
868 const char *z = zTagList;
869 Blob links;
870 blob_zero(&links);
871 while( z && z[0] ){
872 for(i=0; z[i] && (z[i]!=',' || z[i+1]!=' '); i++){}
873 blob_appendf(&links,
874 "%z%#h</a>%.2s",
875 href("%R/timeline?r=%#t&nd&c=%s",i,z,zDate), i,z, &z[i]
876 );
877 if( z[i]==0 ) break;
878 z += i+2;
879 }
880 @ tags: %s(blob_str(&links)),
881 blob_reset(&links);
882 }else{
883 @ tags: %h(zTagList),
884 }
885 @ date:
886 hyperlink_to_date(zDate, ")");
887 }
888 db_finalize(&q);
889 }
890
891
892

Keyboard Shortcuts

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