Fossil SCM

When showing timelines of references, change the text of Wiki edits from "Changes to wiki..." or "Added wiki..." to be just "Wiki...".

drh 2020-04-16 22:26 backlink-updates
Commit 6d125b722586162a70f37281f1add8de1c226a816f0ee63ffe48bdf932e47550
3 files changed +2 -1 +17 -1 +2 -1
+2 -1
--- src/backlink.c
+++ src/backlink.c
@@ -54,11 +54,12 @@
5454
if( zLabel ) cgi_printf("%s", zLabel);
5555
blob_zero(&sql);
5656
blob_append(&sql, timeline_query_for_www(), -1);
5757
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
5858
db_prepare(&q, "%s", blob_sql_text(&sql));
59
- www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
59
+ www_print_timeline(&q,
60
+ TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS,
6061
0, 0, 0, 0, 0, 0);
6162
db_finalize(&q);
6263
}
6364
6465
/*
6566
--- src/backlink.c
+++ src/backlink.c
@@ -54,11 +54,12 @@
54 if( zLabel ) cgi_printf("%s", zLabel);
55 blob_zero(&sql);
56 blob_append(&sql, timeline_query_for_www(), -1);
57 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
58 db_prepare(&q, "%s", blob_sql_text(&sql));
59 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
 
60 0, 0, 0, 0, 0, 0);
61 db_finalize(&q);
62 }
63
64 /*
65
--- src/backlink.c
+++ src/backlink.c
@@ -54,11 +54,12 @@
54 if( zLabel ) cgi_printf("%s", zLabel);
55 blob_zero(&sql);
56 blob_append(&sql, timeline_query_for_www(), -1);
57 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
58 db_prepare(&q, "%s", blob_sql_text(&sql));
59 www_print_timeline(&q,
60 TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL|TIMELINE_REFS,
61 0, 0, 0, 0, 0, 0);
62 db_finalize(&q);
63 }
64
65 /*
66
+17 -1
--- src/timeline.c
+++ src/timeline.c
@@ -116,10 +116,11 @@
116116
#define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117117
#define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118118
#define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119119
#define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
120120
#define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */
121
+#define TIMELINE_REFS 0x8000000 /* Output intended for References tab */
121122
#endif
122123
123124
/*
124125
** Hash a string and use the hash to determine a background color.
125126
*/
@@ -560,12 +561,27 @@
560561
}
561562
if( zType[0]!='c' ){
562563
/* Comments for anything other than a check-in are generated by
563564
** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
564565
if( zType[0]=='w' ){
566
+ const char *zCom = blob_str(&comment);
567
+ char *zWiki;
565568
wiki_hyperlink_override(zUuid);
566
- wiki_convert(&comment, 0, WIKI_INLINE);
569
+ if( (tmFlags & TIMELINE_REFS)!=0
570
+ && (zWiki = strstr(zCom,"wiki"))!=0
571
+ ){
572
+ /* The TIMELINE_REFS flag causes timeline comments of the
573
+ ** form "Changes to wiki..." or "Added wiki" to be changed
574
+ ** into just "Wiki..." */
575
+ Blob rcom;
576
+ blob_init(&rcom, 0, 0);
577
+ blob_appendf(&rcom, "W%s", zWiki+1);
578
+ wiki_convert(&rcom, 0, WIKI_INLINE);
579
+ blob_reset(&rcom);
580
+ }else{
581
+ wiki_convert(&comment, 0, WIKI_INLINE);
582
+ }
567583
wiki_hyperlink_override(0);
568584
}else{
569585
wiki_convert(&comment, 0, WIKI_INLINE);
570586
}
571587
}else{
572588
--- src/timeline.c
+++ src/timeline.c
@@ -116,10 +116,11 @@
116 #define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118 #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119 #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
120 #define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */
 
121 #endif
122
123 /*
124 ** Hash a string and use the hash to determine a background color.
125 */
@@ -560,12 +561,27 @@
560 }
561 if( zType[0]!='c' ){
562 /* Comments for anything other than a check-in are generated by
563 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
564 if( zType[0]=='w' ){
 
 
565 wiki_hyperlink_override(zUuid);
566 wiki_convert(&comment, 0, WIKI_INLINE);
 
 
 
 
 
 
 
 
 
 
 
 
 
567 wiki_hyperlink_override(0);
568 }else{
569 wiki_convert(&comment, 0, WIKI_INLINE);
570 }
571 }else{
572
--- src/timeline.c
+++ src/timeline.c
@@ -116,10 +116,11 @@
116 #define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118 #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119 #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
120 #define TIMELINE_FORUMTXT 0x4000000 /* Render all forum messages */
121 #define TIMELINE_REFS 0x8000000 /* Output intended for References tab */
122 #endif
123
124 /*
125 ** Hash a string and use the hash to determine a background color.
126 */
@@ -560,12 +561,27 @@
561 }
562 if( zType[0]!='c' ){
563 /* Comments for anything other than a check-in are generated by
564 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
565 if( zType[0]=='w' ){
566 const char *zCom = blob_str(&comment);
567 char *zWiki;
568 wiki_hyperlink_override(zUuid);
569 if( (tmFlags & TIMELINE_REFS)!=0
570 && (zWiki = strstr(zCom,"wiki"))!=0
571 ){
572 /* The TIMELINE_REFS flag causes timeline comments of the
573 ** form "Changes to wiki..." or "Added wiki" to be changed
574 ** into just "Wiki..." */
575 Blob rcom;
576 blob_init(&rcom, 0, 0);
577 blob_appendf(&rcom, "W%s", zWiki+1);
578 wiki_convert(&rcom, 0, WIKI_INLINE);
579 blob_reset(&rcom);
580 }else{
581 wiki_convert(&comment, 0, WIKI_INLINE);
582 }
583 wiki_hyperlink_override(0);
584 }else{
585 wiki_convert(&comment, 0, WIKI_INLINE);
586 }
587 }else{
588
+2 -1
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,12 @@
896896
timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897897
);
898898
}
899899
db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900900
www_print_timeline(&q,
901
- TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT,
901
+ TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT |
902
+ TIMELINE_REFS,
902903
0, 0, 0, 0, 0, 0);
903904
db_finalize(&q);
904905
fossil_free(zFullUuid);
905906
}
906907
907908
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,12 @@
896 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897 );
898 }
899 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900 www_print_timeline(&q,
901 TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT,
 
902 0, 0, 0, 0, 0, 0);
903 db_finalize(&q);
904 fossil_free(zFullUuid);
905 }
906
907
--- src/tkt.c
+++ src/tkt.c
@@ -896,11 +896,12 @@
896 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
897 );
898 }
899 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
900 www_print_timeline(&q,
901 TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT |
902 TIMELINE_REFS,
903 0, 0, 0, 0, 0, 0);
904 db_finalize(&q);
905 fossil_free(zFullUuid);
906 }
907
908

Keyboard Shortcuts

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