Fossil SCM
Fix timeline_query_for_tty() function (Oops....)
Commit
108548b28c356410171c5d87e4e87b8aa4ffce41
Parent
d7fd72dc303ebb4…
1 file changed
+6
-2
+6
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1675,15 +1675,16 @@ | ||
| 1675 | 1675 | /* |
| 1676 | 1676 | ** Return a pointer to a static string that forms the basis for |
| 1677 | 1677 | ** a timeline query for display on a TTY. |
| 1678 | 1678 | */ |
| 1679 | 1679 | const char *timeline_query_for_tty(void){ |
| 1680 | + static const char *zBase = 0; | |
| 1680 | 1681 | static const char zBaseSql[] = |
| 1681 | 1682 | @ SELECT |
| 1682 | 1683 | @ blob.rid AS rid, |
| 1683 | 1684 | @ uuid, |
| 1684 | - @ datetime(event.mtime%s(timeline_utc())) AS mDateTime, | |
| 1685 | + @ datetime(event.mtime%s) AS mDateTime, | |
| 1685 | 1686 | @ coalesce(ecomment,comment) |
| 1686 | 1687 | @ || ' (user: ' || coalesce(euser,user,'?') |
| 1687 | 1688 | @ || (SELECT case when length(x)>0 then ' tags: ' || x else '' end |
| 1688 | 1689 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1689 | 1690 | @ FROM tag, tagxref |
| @@ -1700,11 +1701,14 @@ | ||
| 1700 | 1701 | @ AND tagxref.tagtype>0 |
| 1701 | 1702 | @ AND tagxref.rid=blob.rid |
| 1702 | 1703 | @ WHERE blob.rid=event.objid |
| 1703 | 1704 | @ AND tag.tagname='branch' |
| 1704 | 1705 | ; |
| 1705 | - return zBaseSql; | |
| 1706 | + if( zBase==0 ){ | |
| 1707 | + zBase = mprintf(zBaseSql, timeline_utc()); | |
| 1708 | + } | |
| 1709 | + return zBase; | |
| 1706 | 1710 | } |
| 1707 | 1711 | |
| 1708 | 1712 | /* |
| 1709 | 1713 | ** Return true if the input string is a date in the ISO 8601 format: |
| 1710 | 1714 | ** YYYY-MM-DD. |
| 1711 | 1715 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1675,15 +1675,16 @@ | |
| 1675 | /* |
| 1676 | ** Return a pointer to a static string that forms the basis for |
| 1677 | ** a timeline query for display on a TTY. |
| 1678 | */ |
| 1679 | const char *timeline_query_for_tty(void){ |
| 1680 | static const char zBaseSql[] = |
| 1681 | @ SELECT |
| 1682 | @ blob.rid AS rid, |
| 1683 | @ uuid, |
| 1684 | @ datetime(event.mtime%s(timeline_utc())) AS mDateTime, |
| 1685 | @ coalesce(ecomment,comment) |
| 1686 | @ || ' (user: ' || coalesce(euser,user,'?') |
| 1687 | @ || (SELECT case when length(x)>0 then ' tags: ' || x else '' end |
| 1688 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1689 | @ FROM tag, tagxref |
| @@ -1700,11 +1701,14 @@ | |
| 1700 | @ AND tagxref.tagtype>0 |
| 1701 | @ AND tagxref.rid=blob.rid |
| 1702 | @ WHERE blob.rid=event.objid |
| 1703 | @ AND tag.tagname='branch' |
| 1704 | ; |
| 1705 | return zBaseSql; |
| 1706 | } |
| 1707 | |
| 1708 | /* |
| 1709 | ** Return true if the input string is a date in the ISO 8601 format: |
| 1710 | ** YYYY-MM-DD. |
| 1711 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1675,15 +1675,16 @@ | |
| 1675 | /* |
| 1676 | ** Return a pointer to a static string that forms the basis for |
| 1677 | ** a timeline query for display on a TTY. |
| 1678 | */ |
| 1679 | const char *timeline_query_for_tty(void){ |
| 1680 | static const char *zBase = 0; |
| 1681 | static const char zBaseSql[] = |
| 1682 | @ SELECT |
| 1683 | @ blob.rid AS rid, |
| 1684 | @ uuid, |
| 1685 | @ datetime(event.mtime%s) AS mDateTime, |
| 1686 | @ coalesce(ecomment,comment) |
| 1687 | @ || ' (user: ' || coalesce(euser,user,'?') |
| 1688 | @ || (SELECT case when length(x)>0 then ' tags: ' || x else '' end |
| 1689 | @ FROM (SELECT group_concat(substr(tagname,5), ', ') AS x |
| 1690 | @ FROM tag, tagxref |
| @@ -1700,11 +1701,14 @@ | |
| 1701 | @ AND tagxref.tagtype>0 |
| 1702 | @ AND tagxref.rid=blob.rid |
| 1703 | @ WHERE blob.rid=event.objid |
| 1704 | @ AND tag.tagname='branch' |
| 1705 | ; |
| 1706 | if( zBase==0 ){ |
| 1707 | zBase = mprintf(zBaseSql, timeline_utc()); |
| 1708 | } |
| 1709 | return zBase; |
| 1710 | } |
| 1711 | |
| 1712 | /* |
| 1713 | ** Return true if the input string is a date in the ISO 8601 format: |
| 1714 | ** YYYY-MM-DD. |
| 1715 |