Fossil SCM

Possibly simpler alternative to timeline_cmd_dash_n_fix branch

jan.nijtmans 2013-10-20 06:40 UTC trunk
Commit c6a49e29b9fa969cd5aa51f421db5ffb93ec6aa0
1 file changed +6
--- src/timeline.c
+++ src/timeline.c
@@ -1774,10 +1774,16 @@
17741774
}
17751775
if( zType && (zType[0]!='a') ){
17761776
blob_appendf(&sql, " AND event.type=%Q ", zType);
17771777
}
17781778
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
+ }
17791785
db_prepare(&q, blob_str(&sql));
17801786
blob_reset(&sql);
17811787
print_timeline(&q, n, verboseFlag);
17821788
db_finalize(&q);
17831789
}
17841790
--- 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

Keyboard Shortcuts

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