Fossil SCM

Fix the use of "-p PATH" flag with "after" keyword in the timeline command.

mgagnon 2025-04-03 16:58 fix-timeline-cli-after
Commit 52645bdc3651c16daffd03854c1e0fd341ceb04934f809de6113c17d2ccff5bb
1 file changed +8 -6
+8 -6
--- src/timeline.c
+++ src/timeline.c
@@ -3752,15 +3752,10 @@
37523752
mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
37533753
);
37543754
if( zType && (zType[0]!='a') ){
37553755
blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
37563756
}
3757
- if( mode==TIMELINE_MODE_AFTER ){
3758
- /* Complete the outer above outer select. */
3759
- blob_append_sql(&sql,
3760
- "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
3761
- }
37623757
37633758
/* When zFilePattern is specified, compute complete ancestry;
37643759
* limit later at print_timeline() */
37653760
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
37663761
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
@@ -3810,11 +3805,18 @@
38103805
" WHERE tx.value='%q'\n"
38113806
")\n" /* No merge closures */
38123807
" AND (tagxref.value IS NULL OR tagxref.value='%q')",
38133808
zBr, zBr, zBr, TAG_BRANCH, zBr, zBr);
38143809
}
3815
- blob_append_sql(&sql, "\nORDER BY event.mtime DESC");
3810
+
3811
+ if( mode==TIMELINE_MODE_AFTER ){
3812
+ /* Complete the above outer select. */
3813
+ blob_append_sql(&sql,
3814
+ "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
3815
+ }else{
3816
+ blob_append_sql(&sql, "\nORDER BY event.mtime DESC");
3817
+ }
38163818
if( iOffset>0 ){
38173819
/* Don't handle LIMIT here, otherwise print_timeline()
38183820
* will not determine the end-marker correctly! */
38193821
blob_append_sql(&sql, "\n LIMIT -1 OFFSET %d", iOffset);
38203822
}
38213823
--- src/timeline.c
+++ src/timeline.c
@@ -3752,15 +3752,10 @@
3752 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3753 );
3754 if( zType && (zType[0]!='a') ){
3755 blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
3756 }
3757 if( mode==TIMELINE_MODE_AFTER ){
3758 /* Complete the outer above outer select. */
3759 blob_append_sql(&sql,
3760 "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
3761 }
3762
3763 /* When zFilePattern is specified, compute complete ancestry;
3764 * limit later at print_timeline() */
3765 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3766 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
@@ -3810,11 +3805,18 @@
3810 " WHERE tx.value='%q'\n"
3811 ")\n" /* No merge closures */
3812 " AND (tagxref.value IS NULL OR tagxref.value='%q')",
3813 zBr, zBr, zBr, TAG_BRANCH, zBr, zBr);
3814 }
3815 blob_append_sql(&sql, "\nORDER BY event.mtime DESC");
 
 
 
 
 
 
 
3816 if( iOffset>0 ){
3817 /* Don't handle LIMIT here, otherwise print_timeline()
3818 * will not determine the end-marker correctly! */
3819 blob_append_sql(&sql, "\n LIMIT -1 OFFSET %d", iOffset);
3820 }
3821
--- src/timeline.c
+++ src/timeline.c
@@ -3752,15 +3752,10 @@
3752 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3753 );
3754 if( zType && (zType[0]!='a') ){
3755 blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
3756 }
 
 
 
 
 
3757
3758 /* When zFilePattern is specified, compute complete ancestry;
3759 * limit later at print_timeline() */
3760 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3761 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
@@ -3810,11 +3805,18 @@
3805 " WHERE tx.value='%q'\n"
3806 ")\n" /* No merge closures */
3807 " AND (tagxref.value IS NULL OR tagxref.value='%q')",
3808 zBr, zBr, zBr, TAG_BRANCH, zBr, zBr);
3809 }
3810
3811 if( mode==TIMELINE_MODE_AFTER ){
3812 /* Complete the above outer select. */
3813 blob_append_sql(&sql,
3814 "\nORDER BY event.mtime LIMIT abs(%d)) t ORDER BY t.mDateTime DESC;", n);
3815 }else{
3816 blob_append_sql(&sql, "\nORDER BY event.mtime DESC");
3817 }
3818 if( iOffset>0 ){
3819 /* Don't handle LIMIT here, otherwise print_timeline()
3820 * will not determine the end-marker correctly! */
3821 blob_append_sql(&sql, "\n LIMIT -1 OFFSET %d", iOffset);
3822 }
3823

Keyboard Shortcuts

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