Fossil SCM

wiki list CLI command no longer lists deleted pages by default: use --all to include those (same parameter name as /wcontent uses for that purpose). [forum:cf4195f8bf6824fa | Forum post cf4195f8bf6824fa].

stephan 2021-09-15 08:04 trunk
Commit 88e5336007aab9904f3584acd7fda98f71f860df5ab77be5b5c2024193b5072a
2 files changed +8 -4 +3
+8 -4
--- src/wiki.c
+++ src/wiki.c
@@ -2184,10 +2184,12 @@
21842184
**
21852185
** Lists all wiki entries, one per line, ordered
21862186
** case-insensitively by name.
21872187
**
21882188
** Options:
2189
+** --all Include "deleted" pages in output.
2190
+** By default deleted pages are elided.
21892191
** -t|--technote Technotes will be listed instead of
21902192
** pages. The technotes will be in order
21912193
** of timestamp with the most recent
21922194
** first.
21932195
** -s|--show-technote-ids The id of the tech note will be listed
@@ -2207,10 +2209,11 @@
22072209
** used to update its contents.
22082210
*/
22092211
void wiki_cmd(void){
22102212
int n;
22112213
int isSandbox = 0; /* true if dealing with sandbox pseudo-page */
2214
+ const int showAll = find_option("all", 0, 0)!=0;
22122215
22132216
db_find_and_open_repository(0, 0);
22142217
if( g.argc<3 ){
22152218
goto wiki_cmd_usage;
22162219
}
@@ -2422,14 +2425,11 @@
24222425
Stmt q;
24232426
const int fTechnote = find_option("technote","t",0)!=0;
24242427
const int showIds = find_option("show-technote-ids","s",0)!=0;
24252428
verify_all_options();
24262429
if (fTechnote==0){
2427
- db_prepare(&q,
2428
- "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'"
2429
- " ORDER BY lower(tagname) /*sort*/"
2430
- );
2430
+ db_prepare(&q, listAllWikiPages/*works-like:""*/);
24312431
}else{
24322432
db_prepare(&q,
24332433
"SELECT datetime(e.mtime), substr(t.tagname,7)"
24342434
" FROM event e, tag t"
24352435
" WHERE e.type='e'"
@@ -2438,10 +2438,14 @@
24382438
" ORDER BY e.mtime DESC /*sort*/"
24392439
);
24402440
}
24412441
while( db_step(&q)==SQLITE_ROW ){
24422442
const char *zName = db_column_text(&q, 0);
2443
+ const int wrid = db_column_int(&q, 2);
2444
+ if(!showAll && !wrid){
2445
+ continue;
2446
+ }
24432447
if( showIds ){
24442448
const char *zUuid = db_column_text(&q, 1);
24452449
fossil_print("%s ",zUuid);
24462450
}
24472451
fossil_print( "%s\n",zName);
24482452
--- src/wiki.c
+++ src/wiki.c
@@ -2184,10 +2184,12 @@
2184 **
2185 ** Lists all wiki entries, one per line, ordered
2186 ** case-insensitively by name.
2187 **
2188 ** Options:
 
 
2189 ** -t|--technote Technotes will be listed instead of
2190 ** pages. The technotes will be in order
2191 ** of timestamp with the most recent
2192 ** first.
2193 ** -s|--show-technote-ids The id of the tech note will be listed
@@ -2207,10 +2209,11 @@
2207 ** used to update its contents.
2208 */
2209 void wiki_cmd(void){
2210 int n;
2211 int isSandbox = 0; /* true if dealing with sandbox pseudo-page */
 
2212
2213 db_find_and_open_repository(0, 0);
2214 if( g.argc<3 ){
2215 goto wiki_cmd_usage;
2216 }
@@ -2422,14 +2425,11 @@
2422 Stmt q;
2423 const int fTechnote = find_option("technote","t",0)!=0;
2424 const int showIds = find_option("show-technote-ids","s",0)!=0;
2425 verify_all_options();
2426 if (fTechnote==0){
2427 db_prepare(&q,
2428 "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'"
2429 " ORDER BY lower(tagname) /*sort*/"
2430 );
2431 }else{
2432 db_prepare(&q,
2433 "SELECT datetime(e.mtime), substr(t.tagname,7)"
2434 " FROM event e, tag t"
2435 " WHERE e.type='e'"
@@ -2438,10 +2438,14 @@
2438 " ORDER BY e.mtime DESC /*sort*/"
2439 );
2440 }
2441 while( db_step(&q)==SQLITE_ROW ){
2442 const char *zName = db_column_text(&q, 0);
 
 
 
 
2443 if( showIds ){
2444 const char *zUuid = db_column_text(&q, 1);
2445 fossil_print("%s ",zUuid);
2446 }
2447 fossil_print( "%s\n",zName);
2448
--- src/wiki.c
+++ src/wiki.c
@@ -2184,10 +2184,12 @@
2184 **
2185 ** Lists all wiki entries, one per line, ordered
2186 ** case-insensitively by name.
2187 **
2188 ** Options:
2189 ** --all Include "deleted" pages in output.
2190 ** By default deleted pages are elided.
2191 ** -t|--technote Technotes will be listed instead of
2192 ** pages. The technotes will be in order
2193 ** of timestamp with the most recent
2194 ** first.
2195 ** -s|--show-technote-ids The id of the tech note will be listed
@@ -2207,10 +2209,11 @@
2209 ** used to update its contents.
2210 */
2211 void wiki_cmd(void){
2212 int n;
2213 int isSandbox = 0; /* true if dealing with sandbox pseudo-page */
2214 const int showAll = find_option("all", 0, 0)!=0;
2215
2216 db_find_and_open_repository(0, 0);
2217 if( g.argc<3 ){
2218 goto wiki_cmd_usage;
2219 }
@@ -2422,14 +2425,11 @@
2425 Stmt q;
2426 const int fTechnote = find_option("technote","t",0)!=0;
2427 const int showIds = find_option("show-technote-ids","s",0)!=0;
2428 verify_all_options();
2429 if (fTechnote==0){
2430 db_prepare(&q, listAllWikiPages/*works-like:""*/);
 
 
 
2431 }else{
2432 db_prepare(&q,
2433 "SELECT datetime(e.mtime), substr(t.tagname,7)"
2434 " FROM event e, tag t"
2435 " WHERE e.type='e'"
@@ -2438,10 +2438,14 @@
2438 " ORDER BY e.mtime DESC /*sort*/"
2439 );
2440 }
2441 while( db_step(&q)==SQLITE_ROW ){
2442 const char *zName = db_column_text(&q, 0);
2443 const int wrid = db_column_int(&q, 2);
2444 if(!showAll && !wrid){
2445 continue;
2446 }
2447 if( showIds ){
2448 const char *zUuid = db_column_text(&q, 1);
2449 fossil_print("%s ",zUuid);
2450 }
2451 fossil_print( "%s\n",zName);
2452
--- www/changes.wiki
+++ www/changes.wiki
@@ -28,10 +28,13 @@
2828
* Add the <tt>close</tt>, <tt>reopen</tt>, <tt>hide</tt>, and
2929
</tt>unhide</tt> subcommands to [/help?cmd=branch|the branch command].
3030
* The [/mdrules|Markdown formatter] now interprets the content of
3131
block HTML markup (such as &lt;table&gt;) in most cases. Only content
3232
of &lt;pre&gt; and &lt;script&gt; is passed through verbatim.
33
+ * The [/help?cmd=wiki|wiki list command] no longer lists "deleted"
34
+ pages by default. Use the new <tt>--all</tt> option to include deleted
35
+ pages in the output.
3336
3437
<a name='v2_16'></a>
3538
<h2>Changes for Version 2.16 (2021-07-02)</h2>
3639
* <b>Security:</b> Fix the client-side TLS so that it verifies that the
3740
server hostname matches its certificate.
3841
--- www/changes.wiki
+++ www/changes.wiki
@@ -28,10 +28,13 @@
28 * Add the <tt>close</tt>, <tt>reopen</tt>, <tt>hide</tt>, and
29 </tt>unhide</tt> subcommands to [/help?cmd=branch|the branch command].
30 * The [/mdrules|Markdown formatter] now interprets the content of
31 block HTML markup (such as &lt;table&gt;) in most cases. Only content
32 of &lt;pre&gt; and &lt;script&gt; is passed through verbatim.
 
 
 
33
34 <a name='v2_16'></a>
35 <h2>Changes for Version 2.16 (2021-07-02)</h2>
36 * <b>Security:</b> Fix the client-side TLS so that it verifies that the
37 server hostname matches its certificate.
38
--- www/changes.wiki
+++ www/changes.wiki
@@ -28,10 +28,13 @@
28 * Add the <tt>close</tt>, <tt>reopen</tt>, <tt>hide</tt>, and
29 </tt>unhide</tt> subcommands to [/help?cmd=branch|the branch command].
30 * The [/mdrules|Markdown formatter] now interprets the content of
31 block HTML markup (such as &lt;table&gt;) in most cases. Only content
32 of &lt;pre&gt; and &lt;script&gt; is passed through verbatim.
33 * The [/help?cmd=wiki|wiki list command] no longer lists "deleted"
34 pages by default. Use the new <tt>--all</tt> option to include deleted
35 pages in the output.
36
37 <a name='v2_16'></a>
38 <h2>Changes for Version 2.16 (2021-07-02)</h2>
39 * <b>Security:</b> Fix the client-side TLS so that it verifies that the
40 server hostname matches its certificate.
41

Keyboard Shortcuts

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