Fossil SCM

Use the absolute value of the -n argument as limit of the initial select when "after" is used so "-n N" with negative N can be use. (especially since the default is -20).

mgagnon 2025-04-03 02:09 fix-timeline-cli-after
Commit 0d26e8a46fccb53a6c1c52bd704bd1fbcf08679e5cf5de9a99d0adfccd827f7c
1 file changed +1 -1
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -3752,11 +3752,11 @@
37523752
mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
37533753
);
37543754
if( mode==TIMELINE_MODE_AFTER ){
37553755
/* Complete the outer above outer select. */
37563756
blob_append_sql(&sql,
3757
- "\nORDER BY event.mtime LIMIT %d) t ORDER BY t.mDateTime DESC;", n);
3757
+ "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
37583758
}
37593759
37603760
/* When zFilePattern is specified, compute complete ancestry;
37613761
* limit later at print_timeline() */
37623762
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
37633763
--- src/timeline.c
+++ src/timeline.c
@@ -3752,11 +3752,11 @@
3752 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3753 );
3754 if( mode==TIMELINE_MODE_AFTER ){
3755 /* Complete the outer above outer select. */
3756 blob_append_sql(&sql,
3757 "\nORDER BY event.mtime LIMIT %d) t ORDER BY t.mDateTime DESC;", n);
3758 }
3759
3760 /* When zFilePattern is specified, compute complete ancestry;
3761 * limit later at print_timeline() */
3762 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3763
--- src/timeline.c
+++ src/timeline.c
@@ -3752,11 +3752,11 @@
3752 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3753 );
3754 if( mode==TIMELINE_MODE_AFTER ){
3755 /* Complete the outer above outer select. */
3756 blob_append_sql(&sql,
3757 "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
3758 }
3759
3760 /* When zFilePattern is specified, compute complete ancestry;
3761 * limit later at print_timeline() */
3762 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3763

Keyboard Shortcuts

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