Fossil SCM

Show check-in comments in block style in all contexts other than timeline regardless of the timeline-block-markup setting. The timeline-block-markup setting only effects the timeline.

drh 2013-02-28 20:10 trunk
Commit cae8b6964d73c61dffc0ca89ffc471135a8813a5
3 files changed +1 -1 +6 -6 +8 -3
+1 -1
--- src/attach.c
+++ src/attach.c
@@ -94,11 +94,11 @@
9494
}
9595
@ <br><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a>
9696
@ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br />
9797
if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
9898
if( zComment && zComment[0] ){
99
- @ %w(zComment)<br />
99
+ @ %!w(zComment)<br />
100100
}
101101
if( zPage==0 && zTkt==0 ){
102102
if( zSrc==0 || zSrc[0]==0 ){
103103
zSrc = "Deleted from";
104104
}else {
105105
--- src/attach.c
+++ src/attach.c
@@ -94,11 +94,11 @@
94 }
95 @ <br><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a>
96 @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br />
97 if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
98 if( zComment && zComment[0] ){
99 @ %w(zComment)<br />
100 }
101 if( zPage==0 && zTkt==0 ){
102 if( zSrc==0 || zSrc[0]==0 ){
103 zSrc = "Deleted from";
104 }else {
105
--- src/attach.c
+++ src/attach.c
@@ -94,11 +94,11 @@
94 }
95 @ <br><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a>
96 @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br />
97 if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
98 if( zComment && zComment[0] ){
99 @ %!w(zComment)<br />
100 }
101 if( zPage==0 && zTkt==0 ){
102 if( zSrc==0 || zSrc[0]==0 ){
103 zSrc = "Deleted from";
104 }else {
105
+6 -6
--- src/info.c
+++ src/info.c
@@ -529,14 +529,14 @@
529529
}else{
530530
@ <tr><th>User:</th><td>
531531
hyperlink_to_user(zUser,zDate,"</td></tr>");
532532
}
533533
if( zEComment ){
534
- @ <tr><th>Edited&nbsp;Comment:</th><td>%w(zEComment)</td></tr>
535
- @ <tr><th>Original&nbsp;Comment:</th><td>%w(zComment)</td></tr>
534
+ @ <tr><th>Edited&nbsp;Comment:</th><td>%!w(zEComment)</td></tr>
535
+ @ <tr><th>Original&nbsp;Comment:</th><td>%!w(zComment)</td></tr>
536536
}else{
537
- @ <tr><th>Comment:</th><td>%w(zComment)</td></tr>
537
+ @ <tr><th>Comment:</th><td>%!w(zComment)</td></tr>
538538
}
539539
if( g.perm.Admin ){
540540
db_prepare(&q,
541541
"SELECT rcvfrom.ipaddr, user.login, datetime(rcvfrom.mtime)"
542542
" FROM blob JOIN rcvfrom USING(rcvid) LEFT JOIN user USING(uid)"
@@ -1075,11 +1075,11 @@
10751075
@ - part of checkin
10761076
hyperlink_to_uuid(zVers);
10771077
if( zBr && zBr[0] ){
10781078
@ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
10791079
}
1080
- @ - %w(zCom) (user:
1080
+ @ - %!w(zCom) (user:
10811081
hyperlink_to_user(zUser,zDate,")");
10821082
if( g.perm.Hyperlink ){
10831083
@ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
10841084
@ [annotate]</a>
10851085
}
@@ -1158,11 +1158,11 @@
11581158
@ Control file referencing
11591159
}
11601160
if( zType[0]!='e' ){
11611161
hyperlink_to_uuid(zUuid);
11621162
}
1163
- @ - %w(zCom) by
1163
+ @ - %!w(zCom) by
11641164
hyperlink_to_user(zUser,zDate," on");
11651165
hyperlink_to_date(zDate, ".");
11661166
if( pDownloadName && blob_size(pDownloadName)==0 ){
11671167
blob_appendf(pDownloadName, "%.10s.txt", zUuid);
11681168
}
@@ -2155,11 +2155,11 @@
21552155
if( zNewColor && zNewColor[0] ){
21562156
@ <tr><td style="background-color: %h(zNewColor);">
21572157
}else{
21582158
@ <tr><td>
21592159
}
2160
- @ %w(blob_str(&comment))
2160
+ @ %!w(blob_str(&comment))
21612161
blob_zero(&suffix);
21622162
blob_appendf(&suffix, "(user: %h", zNewUser);
21632163
db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag"
21642164
" WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d"
21652165
" AND tagtype>1 AND tag.tagid=tagxref.tagid",
21662166
--- src/info.c
+++ src/info.c
@@ -529,14 +529,14 @@
529 }else{
530 @ <tr><th>User:</th><td>
531 hyperlink_to_user(zUser,zDate,"</td></tr>");
532 }
533 if( zEComment ){
534 @ <tr><th>Edited&nbsp;Comment:</th><td>%w(zEComment)</td></tr>
535 @ <tr><th>Original&nbsp;Comment:</th><td>%w(zComment)</td></tr>
536 }else{
537 @ <tr><th>Comment:</th><td>%w(zComment)</td></tr>
538 }
539 if( g.perm.Admin ){
540 db_prepare(&q,
541 "SELECT rcvfrom.ipaddr, user.login, datetime(rcvfrom.mtime)"
542 " FROM blob JOIN rcvfrom USING(rcvid) LEFT JOIN user USING(uid)"
@@ -1075,11 +1075,11 @@
1075 @ - part of checkin
1076 hyperlink_to_uuid(zVers);
1077 if( zBr && zBr[0] ){
1078 @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
1079 }
1080 @ - %w(zCom) (user:
1081 hyperlink_to_user(zUser,zDate,")");
1082 if( g.perm.Hyperlink ){
1083 @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
1084 @ [annotate]</a>
1085 }
@@ -1158,11 +1158,11 @@
1158 @ Control file referencing
1159 }
1160 if( zType[0]!='e' ){
1161 hyperlink_to_uuid(zUuid);
1162 }
1163 @ - %w(zCom) by
1164 hyperlink_to_user(zUser,zDate," on");
1165 hyperlink_to_date(zDate, ".");
1166 if( pDownloadName && blob_size(pDownloadName)==0 ){
1167 blob_appendf(pDownloadName, "%.10s.txt", zUuid);
1168 }
@@ -2155,11 +2155,11 @@
2155 if( zNewColor && zNewColor[0] ){
2156 @ <tr><td style="background-color: %h(zNewColor);">
2157 }else{
2158 @ <tr><td>
2159 }
2160 @ %w(blob_str(&comment))
2161 blob_zero(&suffix);
2162 blob_appendf(&suffix, "(user: %h", zNewUser);
2163 db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag"
2164 " WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d"
2165 " AND tagtype>1 AND tag.tagid=tagxref.tagid",
2166
--- src/info.c
+++ src/info.c
@@ -529,14 +529,14 @@
529 }else{
530 @ <tr><th>User:</th><td>
531 hyperlink_to_user(zUser,zDate,"</td></tr>");
532 }
533 if( zEComment ){
534 @ <tr><th>Edited&nbsp;Comment:</th><td>%!w(zEComment)</td></tr>
535 @ <tr><th>Original&nbsp;Comment:</th><td>%!w(zComment)</td></tr>
536 }else{
537 @ <tr><th>Comment:</th><td>%!w(zComment)</td></tr>
538 }
539 if( g.perm.Admin ){
540 db_prepare(&q,
541 "SELECT rcvfrom.ipaddr, user.login, datetime(rcvfrom.mtime)"
542 " FROM blob JOIN rcvfrom USING(rcvid) LEFT JOIN user USING(uid)"
@@ -1075,11 +1075,11 @@
1075 @ - part of checkin
1076 hyperlink_to_uuid(zVers);
1077 if( zBr && zBr[0] ){
1078 @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a>
1079 }
1080 @ - %!w(zCom) (user:
1081 hyperlink_to_user(zUser,zDate,")");
1082 if( g.perm.Hyperlink ){
1083 @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName))
1084 @ [annotate]</a>
1085 }
@@ -1158,11 +1158,11 @@
1158 @ Control file referencing
1159 }
1160 if( zType[0]!='e' ){
1161 hyperlink_to_uuid(zUuid);
1162 }
1163 @ - %!w(zCom) by
1164 hyperlink_to_user(zUser,zDate," on");
1165 hyperlink_to_date(zDate, ".");
1166 if( pDownloadName && blob_size(pDownloadName)==0 ){
1167 blob_appendf(pDownloadName, "%.10s.txt", zUuid);
1168 }
@@ -2155,11 +2155,11 @@
2155 if( zNewColor && zNewColor[0] ){
2156 @ <tr><td style="background-color: %h(zNewColor);">
2157 }else{
2158 @ <tr><td>
2159 }
2160 @ %!w(blob_str(&comment))
2161 blob_zero(&suffix);
2162 blob_appendf(&suffix, "(user: %h", zNewUser);
2163 db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag"
2164 " WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d"
2165 " AND tagtype>1 AND tag.tagid=tagxref.tagid",
2166
+8 -3
--- src/printf.c
+++ src/printf.c
@@ -164,15 +164,20 @@
164164
165165
/*
166166
** Return an appropriate set of flags for wiki_convert() for displaying
167167
** comments on a timeline. These flag settings are determined by
168168
** configuration parameters.
169
+**
170
+** The altForm2 argument is true for "%!w" (with the "!" alternate-form-2
171
+** flags) and is false for plain "%w". The ! indicates that the text is
172
+** to be rendered on a form rather than the timeline and that block markup
173
+** is acceptable even if the "timeline-block-markup" setting is false.
169174
*/
170
-static int wiki_convert_flags(void){
175
+static int wiki_convert_flags(int altForm2){
171176
static int wikiFlags = 0;
172177
if( wikiFlags==0 ){
173
- if( db_get_boolean("timeline-block-markup", 0) ){
178
+ if( altForm2 || db_get_boolean("timeline-block-markup", 0) ){
174179
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
175180
}else{
176181
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
177182
}
178183
if( db_get_boolean("timeline-plaintext", 0) ){
@@ -722,11 +727,11 @@
722727
case etWIKISTR: {
723728
int limit = flag_alternateform ? va_arg(ap,int) : -1;
724729
char *zWiki = va_arg(ap, char*);
725730
Blob wiki;
726731
blob_init(&wiki, zWiki, limit);
727
- wiki_convert(&wiki, pBlob, wiki_convert_flags());
732
+ wiki_convert(&wiki, pBlob, wiki_convert_flags(flag_altform2));
728733
blob_reset(&wiki);
729734
length = width = 0;
730735
break;
731736
}
732737
case etERROR:
733738
--- src/printf.c
+++ src/printf.c
@@ -164,15 +164,20 @@
164
165 /*
166 ** Return an appropriate set of flags for wiki_convert() for displaying
167 ** comments on a timeline. These flag settings are determined by
168 ** configuration parameters.
 
 
 
 
 
169 */
170 static int wiki_convert_flags(void){
171 static int wikiFlags = 0;
172 if( wikiFlags==0 ){
173 if( db_get_boolean("timeline-block-markup", 0) ){
174 wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
175 }else{
176 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
177 }
178 if( db_get_boolean("timeline-plaintext", 0) ){
@@ -722,11 +727,11 @@
722 case etWIKISTR: {
723 int limit = flag_alternateform ? va_arg(ap,int) : -1;
724 char *zWiki = va_arg(ap, char*);
725 Blob wiki;
726 blob_init(&wiki, zWiki, limit);
727 wiki_convert(&wiki, pBlob, wiki_convert_flags());
728 blob_reset(&wiki);
729 length = width = 0;
730 break;
731 }
732 case etERROR:
733
--- src/printf.c
+++ src/printf.c
@@ -164,15 +164,20 @@
164
165 /*
166 ** Return an appropriate set of flags for wiki_convert() for displaying
167 ** comments on a timeline. These flag settings are determined by
168 ** configuration parameters.
169 **
170 ** The altForm2 argument is true for "%!w" (with the "!" alternate-form-2
171 ** flags) and is false for plain "%w". The ! indicates that the text is
172 ** to be rendered on a form rather than the timeline and that block markup
173 ** is acceptable even if the "timeline-block-markup" setting is false.
174 */
175 static int wiki_convert_flags(int altForm2){
176 static int wikiFlags = 0;
177 if( wikiFlags==0 ){
178 if( altForm2 || db_get_boolean("timeline-block-markup", 0) ){
179 wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
180 }else{
181 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
182 }
183 if( db_get_boolean("timeline-plaintext", 0) ){
@@ -722,11 +727,11 @@
727 case etWIKISTR: {
728 int limit = flag_alternateform ? va_arg(ap,int) : -1;
729 char *zWiki = va_arg(ap, char*);
730 Blob wiki;
731 blob_init(&wiki, zWiki, limit);
732 wiki_convert(&wiki, pBlob, wiki_convert_flags(flag_altform2));
733 blob_reset(&wiki);
734 length = width = 0;
735 break;
736 }
737 case etERROR:
738

Keyboard Shortcuts

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