Fossil SCM
Fix the use of "-p PATH" flag with "after" keyword in the timeline command.
Commit
52645bdc3651c16daffd03854c1e0fd341ceb04934f809de6113c17d2ccff5bb
Parent
7f1b2f1b8bc417d…
1 file changed
+8
-6
+8
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -3752,15 +3752,10 @@ | ||
| 3752 | 3752 | mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/ |
| 3753 | 3753 | ); |
| 3754 | 3754 | if( zType && (zType[0]!='a') ){ |
| 3755 | 3755 | blob_append_sql(&sql, "\n AND event.type=%Q ", zType); |
| 3756 | 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 | 3757 | |
| 3763 | 3758 | /* When zFilePattern is specified, compute complete ancestry; |
| 3764 | 3759 | * limit later at print_timeline() */ |
| 3765 | 3760 | if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){ |
| 3766 | 3761 | db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)"); |
| @@ -3810,11 +3805,18 @@ | ||
| 3810 | 3805 | " WHERE tx.value='%q'\n" |
| 3811 | 3806 | ")\n" /* No merge closures */ |
| 3812 | 3807 | " AND (tagxref.value IS NULL OR tagxref.value='%q')", |
| 3813 | 3808 | zBr, zBr, zBr, TAG_BRANCH, zBr, zBr); |
| 3814 | 3809 | } |
| 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 | + } | |
| 3816 | 3818 | if( iOffset>0 ){ |
| 3817 | 3819 | /* Don't handle LIMIT here, otherwise print_timeline() |
| 3818 | 3820 | * will not determine the end-marker correctly! */ |
| 3819 | 3821 | blob_append_sql(&sql, "\n LIMIT -1 OFFSET %d", iOffset); |
| 3820 | 3822 | } |
| 3821 | 3823 |
| --- 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 |