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].
Commit
88e5336007aab9904f3584acd7fda98f71f860df5ab77be5b5c2024193b5072a
Parent
7912deb5fd401ac…
2 files changed
+8
-4
+3
+8
-4
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -2184,10 +2184,12 @@ | ||
| 2184 | 2184 | ** |
| 2185 | 2185 | ** Lists all wiki entries, one per line, ordered |
| 2186 | 2186 | ** case-insensitively by name. |
| 2187 | 2187 | ** |
| 2188 | 2188 | ** Options: |
| 2189 | +** --all Include "deleted" pages in output. | |
| 2190 | +** By default deleted pages are elided. | |
| 2189 | 2191 | ** -t|--technote Technotes will be listed instead of |
| 2190 | 2192 | ** pages. The technotes will be in order |
| 2191 | 2193 | ** of timestamp with the most recent |
| 2192 | 2194 | ** first. |
| 2193 | 2195 | ** -s|--show-technote-ids The id of the tech note will be listed |
| @@ -2207,10 +2209,11 @@ | ||
| 2207 | 2209 | ** used to update its contents. |
| 2208 | 2210 | */ |
| 2209 | 2211 | void wiki_cmd(void){ |
| 2210 | 2212 | int n; |
| 2211 | 2213 | int isSandbox = 0; /* true if dealing with sandbox pseudo-page */ |
| 2214 | + const int showAll = find_option("all", 0, 0)!=0; | |
| 2212 | 2215 | |
| 2213 | 2216 | db_find_and_open_repository(0, 0); |
| 2214 | 2217 | if( g.argc<3 ){ |
| 2215 | 2218 | goto wiki_cmd_usage; |
| 2216 | 2219 | } |
| @@ -2422,14 +2425,11 @@ | ||
| 2422 | 2425 | Stmt q; |
| 2423 | 2426 | const int fTechnote = find_option("technote","t",0)!=0; |
| 2424 | 2427 | const int showIds = find_option("show-technote-ids","s",0)!=0; |
| 2425 | 2428 | verify_all_options(); |
| 2426 | 2429 | 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:""*/); | |
| 2431 | 2431 | }else{ |
| 2432 | 2432 | db_prepare(&q, |
| 2433 | 2433 | "SELECT datetime(e.mtime), substr(t.tagname,7)" |
| 2434 | 2434 | " FROM event e, tag t" |
| 2435 | 2435 | " WHERE e.type='e'" |
| @@ -2438,10 +2438,14 @@ | ||
| 2438 | 2438 | " ORDER BY e.mtime DESC /*sort*/" |
| 2439 | 2439 | ); |
| 2440 | 2440 | } |
| 2441 | 2441 | while( db_step(&q)==SQLITE_ROW ){ |
| 2442 | 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 | + } | |
| 2443 | 2447 | if( showIds ){ |
| 2444 | 2448 | const char *zUuid = db_column_text(&q, 1); |
| 2445 | 2449 | fossil_print("%s ",zUuid); |
| 2446 | 2450 | } |
| 2447 | 2451 | fossil_print( "%s\n",zName); |
| 2448 | 2452 |
| --- 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 |
+3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -28,10 +28,13 @@ | ||
| 28 | 28 | * Add the <tt>close</tt>, <tt>reopen</tt>, <tt>hide</tt>, and |
| 29 | 29 | </tt>unhide</tt> subcommands to [/help?cmd=branch|the branch command]. |
| 30 | 30 | * The [/mdrules|Markdown formatter] now interprets the content of |
| 31 | 31 | block HTML markup (such as <table>) in most cases. Only content |
| 32 | 32 | of <pre> and <script> 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. | |
| 33 | 36 | |
| 34 | 37 | <a name='v2_16'></a> |
| 35 | 38 | <h2>Changes for Version 2.16 (2021-07-02)</h2> |
| 36 | 39 | * <b>Security:</b> Fix the client-side TLS so that it verifies that the |
| 37 | 40 | server hostname matches its certificate. |
| 38 | 41 |
| --- 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 <table>) in most cases. Only content |
| 32 | of <pre> and <script> 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 <table>) in most cases. Only content |
| 32 | of <pre> and <script> 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 |