Fossil SCM

Added rss CLI command help text and removed the permissions checks (which are not valid in CLI mode).

stephan 2014-01-18 09:35 UTC rss-cli
Commit e8edc7ca4b9aaebd09705c5e3ee357940fba2d06
1 file changed +26 -25
+26 -25
--- src/rss.c
+++ src/rss.c
@@ -205,18 +205,42 @@
205205
}
206206
207207
/*
208208
** COMMAND: rss
209209
**
210
-** The CLI variant of the /timeline.rss page.
210
+** The CLI variant of the /timeline.rss page, this produces an RSS
211
+** feed of the timeline to stdout. Options:
212
+**
213
+** -type|y FLAG
214
+** may be: all (default), ci (show checkins only), t (show tickets only),
215
+** w (show wiki only). LIMIT is the number of items to show.
216
+**
217
+** -tkt UUID
218
+** Filters for only those events for the specified ticket.
219
+**
220
+** -tag TAG
221
+** filters for a tag
222
+**
223
+** -wiki NAME
224
+** Filters on a specific wiki page.
225
+**
226
+** Only one of -tkt, -tag, or -wiki may be used.
227
+**
228
+** -name FILENAME
229
+** filters for a specific file. This may be combined with one of the other
230
+** filters (useful for looking at a specific branch).
231
+**
232
+** -url|-U STRING
233
+** Sets the RSS feed's root URL to the given string. The default is
234
+** "URL-PLACEHOLDER".
211235
*/
212236
void cmd_timeline_rss(void){
213237
Stmt q;
214238
int nLine=0;
215239
char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
216240
Blob bSQL;
217
- const char *zType = find_option("y",NULL,1); /* Type of events. All if NULL */
241
+ const char *zType = find_option("type","y",1); /* Type of events. All if NULL */
218242
const char *zTicketUuid = find_option("tkt",NULL,1);
219243
const char *zTag = find_option("tag",NULL,1);
220244
const char *zFilename = find_option("name",NULL,1);
221245
const char *zWiki = find_option("wiki",NULL,1);
222246
const char *zLimit = find_option("limit", "n",1);
@@ -246,34 +270,11 @@
246270
247271
blob_zero(&bSQL);
248272
blob_append( &bSQL, zSQL1, -1 );
249273
250274
if( zType[0]!='a' ){
251
- if( zType[0]=='c' && !g.perm.Read ) zType = "x";
252
- if( zType[0]=='w' && !g.perm.RdWiki ) zType = "x";
253
- if( zType[0]=='t' && !g.perm.RdTkt ) zType = "x";
254275
blob_appendf(&bSQL, " AND event.type=%Q", zType);
255
- }else{
256
- if( !g.perm.Read ){
257
- if( g.perm.RdTkt && g.perm.RdWiki ){
258
- blob_append(&bSQL, " AND event.type!='ci'", -1);
259
- }else if( g.perm.RdTkt ){
260
- blob_append(&bSQL, " AND event.type=='t'", -1);
261
-
262
- }else{
263
- blob_append(&bSQL, " AND event.type=='w'", -1);
264
- }
265
- }else if( !g.perm.RdWiki ){
266
- if( g.perm.RdTkt ){
267
- blob_append(&bSQL, " AND event.type!='w'", -1);
268
- }else{
269
- blob_append(&bSQL, " AND event.type=='ci'", -1);
270
- }
271
- }else if( !g.perm.RdTkt ){
272
- assert( !g.perm.RdTkt &&& g.perm.Read && g.perm.RdWiki );
273
- blob_append(&bSQL, " AND event.type!='t'", -1);
274
- }
275276
}
276277
277278
if( zTicketUuid ){
278279
nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
279280
zTicketUuid);
280281
--- src/rss.c
+++ src/rss.c
@@ -205,18 +205,42 @@
205 }
206
207 /*
208 ** COMMAND: rss
209 **
210 ** The CLI variant of the /timeline.rss page.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211 */
212 void cmd_timeline_rss(void){
213 Stmt q;
214 int nLine=0;
215 char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
216 Blob bSQL;
217 const char *zType = find_option("y",NULL,1); /* Type of events. All if NULL */
218 const char *zTicketUuid = find_option("tkt",NULL,1);
219 const char *zTag = find_option("tag",NULL,1);
220 const char *zFilename = find_option("name",NULL,1);
221 const char *zWiki = find_option("wiki",NULL,1);
222 const char *zLimit = find_option("limit", "n",1);
@@ -246,34 +270,11 @@
246
247 blob_zero(&bSQL);
248 blob_append( &bSQL, zSQL1, -1 );
249
250 if( zType[0]!='a' ){
251 if( zType[0]=='c' && !g.perm.Read ) zType = "x";
252 if( zType[0]=='w' && !g.perm.RdWiki ) zType = "x";
253 if( zType[0]=='t' && !g.perm.RdTkt ) zType = "x";
254 blob_appendf(&bSQL, " AND event.type=%Q", zType);
255 }else{
256 if( !g.perm.Read ){
257 if( g.perm.RdTkt && g.perm.RdWiki ){
258 blob_append(&bSQL, " AND event.type!='ci'", -1);
259 }else if( g.perm.RdTkt ){
260 blob_append(&bSQL, " AND event.type=='t'", -1);
261
262 }else{
263 blob_append(&bSQL, " AND event.type=='w'", -1);
264 }
265 }else if( !g.perm.RdWiki ){
266 if( g.perm.RdTkt ){
267 blob_append(&bSQL, " AND event.type!='w'", -1);
268 }else{
269 blob_append(&bSQL, " AND event.type=='ci'", -1);
270 }
271 }else if( !g.perm.RdTkt ){
272 assert( !g.perm.RdTkt &&& g.perm.Read && g.perm.RdWiki );
273 blob_append(&bSQL, " AND event.type!='t'", -1);
274 }
275 }
276
277 if( zTicketUuid ){
278 nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
279 zTicketUuid);
280
--- src/rss.c
+++ src/rss.c
@@ -205,18 +205,42 @@
205 }
206
207 /*
208 ** COMMAND: rss
209 **
210 ** The CLI variant of the /timeline.rss page, this produces an RSS
211 ** feed of the timeline to stdout. Options:
212 **
213 ** -type|y FLAG
214 ** may be: all (default), ci (show checkins only), t (show tickets only),
215 ** w (show wiki only). LIMIT is the number of items to show.
216 **
217 ** -tkt UUID
218 ** Filters for only those events for the specified ticket.
219 **
220 ** -tag TAG
221 ** filters for a tag
222 **
223 ** -wiki NAME
224 ** Filters on a specific wiki page.
225 **
226 ** Only one of -tkt, -tag, or -wiki may be used.
227 **
228 ** -name FILENAME
229 ** filters for a specific file. This may be combined with one of the other
230 ** filters (useful for looking at a specific branch).
231 **
232 ** -url|-U STRING
233 ** Sets the RSS feed's root URL to the given string. The default is
234 ** "URL-PLACEHOLDER".
235 */
236 void cmd_timeline_rss(void){
237 Stmt q;
238 int nLine=0;
239 char *zPubDate, *zProjectName, *zProjectDescr, *zFreeProjectName=0;
240 Blob bSQL;
241 const char *zType = find_option("type","y",1); /* Type of events. All if NULL */
242 const char *zTicketUuid = find_option("tkt",NULL,1);
243 const char *zTag = find_option("tag",NULL,1);
244 const char *zFilename = find_option("name",NULL,1);
245 const char *zWiki = find_option("wiki",NULL,1);
246 const char *zLimit = find_option("limit", "n",1);
@@ -246,34 +270,11 @@
270
271 blob_zero(&bSQL);
272 blob_append( &bSQL, zSQL1, -1 );
273
274 if( zType[0]!='a' ){
 
 
 
275 blob_appendf(&bSQL, " AND event.type=%Q", zType);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276 }
277
278 if( zTicketUuid ){
279 nTagId = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
280 zTicketUuid);
281

Keyboard Shortcuts

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