Fossil SCM

timeline.rss now supports n=### param, like the /timeline page does. This feature is arguable (could lead to DoS), but i want it for harvesting an activity timeline which includes older commits.

stephan 2010-02-19 17:57 trunk
Commit 65a46db339774e7854a54644f16d0a5665aad3dd
1 file changed +3 -2
+3 -2
--- src/rss.c
+++ src/rss.c
@@ -35,10 +35,11 @@
3535
Stmt q;
3636
int nLine=0;
3737
char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
3838
Blob bSQL;
3939
const char *zType = PD("y","all"); /* Type of events. All if NULL */
40
+ int nLimit = atoi(PD("n","20"));
4041
const char zSQL1[] =
4142
@ SELECT
4243
@ blob.rid,
4344
@ uuid,
4445
@ event.mtime,
@@ -55,11 +56,11 @@
5556
return;
5657
}
5758
5859
blob_zero(&bSQL);
5960
blob_append( &bSQL, zSQL1, -1 );
60
-
61
+
6162
if( zType[0]!='a' ){
6263
if( zType[0]=='c' && !g.okRead ) zType = "x";
6364
if( zType[0]=='w' && !g.okRdWiki ) zType = "x";
6465
if( zType[0]=='t' && !g.okRdTkt ) zType = "x";
6566
blob_appendf(&bSQL, " AND event.type=%Q", zType);
@@ -108,11 +109,11 @@
108109
@ <description>%h(zProjectDescr)</description>
109110
@ <pubDate>%s(zPubDate)</pubDate>
110111
@ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
111112
db_prepare(&q, blob_str(&bSQL));
112113
blob_reset( &bSQL );
113
- while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
114
+ while( db_step(&q)==SQLITE_ROW && nLine<=nLimit ){
114115
const char *zId = db_column_text(&q, 1);
115116
const char *zCom = db_column_text(&q, 3);
116117
const char *zAuthor = db_column_text(&q, 4);
117118
char *zPrefix = "";
118119
char *zDate;
119120
--- src/rss.c
+++ src/rss.c
@@ -35,10 +35,11 @@
35 Stmt q;
36 int nLine=0;
37 char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
38 Blob bSQL;
39 const char *zType = PD("y","all"); /* Type of events. All if NULL */
 
40 const char zSQL1[] =
41 @ SELECT
42 @ blob.rid,
43 @ uuid,
44 @ event.mtime,
@@ -55,11 +56,11 @@
55 return;
56 }
57
58 blob_zero(&bSQL);
59 blob_append( &bSQL, zSQL1, -1 );
60
61 if( zType[0]!='a' ){
62 if( zType[0]=='c' && !g.okRead ) zType = "x";
63 if( zType[0]=='w' && !g.okRdWiki ) zType = "x";
64 if( zType[0]=='t' && !g.okRdTkt ) zType = "x";
65 blob_appendf(&bSQL, " AND event.type=%Q", zType);
@@ -108,11 +109,11 @@
108 @ <description>%h(zProjectDescr)</description>
109 @ <pubDate>%s(zPubDate)</pubDate>
110 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
111 db_prepare(&q, blob_str(&bSQL));
112 blob_reset( &bSQL );
113 while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
114 const char *zId = db_column_text(&q, 1);
115 const char *zCom = db_column_text(&q, 3);
116 const char *zAuthor = db_column_text(&q, 4);
117 char *zPrefix = "";
118 char *zDate;
119
--- src/rss.c
+++ src/rss.c
@@ -35,10 +35,11 @@
35 Stmt q;
36 int nLine=0;
37 char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
38 Blob bSQL;
39 const char *zType = PD("y","all"); /* Type of events. All if NULL */
40 int nLimit = atoi(PD("n","20"));
41 const char zSQL1[] =
42 @ SELECT
43 @ blob.rid,
44 @ uuid,
45 @ event.mtime,
@@ -55,11 +56,11 @@
56 return;
57 }
58
59 blob_zero(&bSQL);
60 blob_append( &bSQL, zSQL1, -1 );
61
62 if( zType[0]!='a' ){
63 if( zType[0]=='c' && !g.okRead ) zType = "x";
64 if( zType[0]=='w' && !g.okRdWiki ) zType = "x";
65 if( zType[0]=='t' && !g.okRdTkt ) zType = "x";
66 blob_appendf(&bSQL, " AND event.type=%Q", zType);
@@ -108,11 +109,11 @@
109 @ <description>%h(zProjectDescr)</description>
110 @ <pubDate>%s(zPubDate)</pubDate>
111 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
112 db_prepare(&q, blob_str(&bSQL));
113 blob_reset( &bSQL );
114 while( db_step(&q)==SQLITE_ROW && nLine<=nLimit ){
115 const char *zId = db_column_text(&q, 1);
116 const char *zCom = db_column_text(&q, 3);
117 const char *zAuthor = db_column_text(&q, 4);
118 char *zPrefix = "";
119 char *zDate;
120

Keyboard Shortcuts

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