Fossil SCM
Possibly simpler alternative to timeline_cmd_dash_n_fix branch
Commit
c6a49e29b9fa969cd5aa51f421db5ffb93ec6aa0
Parent
18d9f5af0467d4b…
1 file changed
+6
+6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1774,10 +1774,16 @@ | ||
| 1774 | 1774 | } |
| 1775 | 1775 | if( zType && (zType[0]!='a') ){ |
| 1776 | 1776 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | 1777 | } |
| 1778 | 1778 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | + if(n>0){ | |
| 1780 | + blob_appendf(&sql, " LIMIT %d", n); | |
| 1781 | + n = 9999999; | |
| 1782 | + }else{ | |
| 1783 | + n = -n; | |
| 1784 | + } | |
| 1779 | 1785 | db_prepare(&q, blob_str(&sql)); |
| 1780 | 1786 | blob_reset(&sql); |
| 1781 | 1787 | print_timeline(&q, n, verboseFlag); |
| 1782 | 1788 | db_finalize(&q); |
| 1783 | 1789 | } |
| 1784 | 1790 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1774,10 +1774,16 @@ | |
| 1774 | } |
| 1775 | if( zType && (zType[0]!='a') ){ |
| 1776 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | } |
| 1778 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | db_prepare(&q, blob_str(&sql)); |
| 1780 | blob_reset(&sql); |
| 1781 | print_timeline(&q, n, verboseFlag); |
| 1782 | db_finalize(&q); |
| 1783 | } |
| 1784 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1774,10 +1774,16 @@ | |
| 1774 | } |
| 1775 | if( zType && (zType[0]!='a') ){ |
| 1776 | blob_appendf(&sql, " AND event.type=%Q ", zType); |
| 1777 | } |
| 1778 | blob_appendf(&sql, " ORDER BY event.mtime DESC"); |
| 1779 | if(n>0){ |
| 1780 | blob_appendf(&sql, " LIMIT %d", n); |
| 1781 | n = 9999999; |
| 1782 | }else{ |
| 1783 | n = -n; |
| 1784 | } |
| 1785 | db_prepare(&q, blob_str(&sql)); |
| 1786 | blob_reset(&sql); |
| 1787 | print_timeline(&q, n, verboseFlag); |
| 1788 | db_finalize(&q); |
| 1789 | } |
| 1790 |