Fossil SCM

By default, do not show wikis associated with check-ins and branches in the output of 'fossil wiki ls'. This is the CLI pendant to [29a24941e].

danield 2022-06-02 19:51 trunk
Commit 4877e77a97878c9422191c976f15c720ff0b46bf3fa65ee3cf07193ee68d1304
1 file changed +10 -1
+10 -1
--- src/wiki.c
+++ src/wiki.c
@@ -2189,19 +2189,22 @@
21892189
**
21902190
** > fossil wiki list ?OPTIONS?
21912191
** > fossil wiki ls ?OPTIONS?
21922192
**
21932193
** Lists all wiki entries, one per line, ordered
2194
-** case-insensitively by name.
2194
+** case-insensitively by name. Wiki pages associated with
2195
+** check-ins and branches are NOT shown, unless -a is given.
21952196
**
21962197
** Options:
21972198
** --all Include "deleted" pages in output.
21982199
** By default deleted pages are elided.
21992200
** -t|--technote Technotes will be listed instead of
22002201
** pages. The technotes will be in order
22012202
** of timestamp with the most recent
22022203
** first.
2204
+** -a|--show-associated Show wiki pages associated with
2205
+** check-ins and branches.
22032206
** -s|--show-technote-ids The id of the tech note will be listed
22042207
** along side the timestamp. The tech note
22052208
** id will be the first word on each line.
22062209
** This option only applies if the
22072210
** --technote option is also specified.
@@ -2431,10 +2434,11 @@
24312434
}else if(( strncmp(g.argv[2],"list",n)==0 )
24322435
|| ( strncmp(g.argv[2],"ls",n)==0 )){
24332436
Stmt q;
24342437
const int fTechnote = find_option("technote","t",0)!=0;
24352438
const int showIds = find_option("show-technote-ids","s",0)!=0;
2439
+ const int showCkBr = find_option("show-associated","a",0)!=0;
24362440
verify_all_options();
24372441
if (fTechnote==0){
24382442
db_prepare(&q, listAllWikiPages/*works-like:""*/);
24392443
}else{
24402444
db_prepare(&q,
@@ -2449,10 +2453,15 @@
24492453
while( db_step(&q)==SQLITE_ROW ){
24502454
const char *zName = db_column_text(&q, 0);
24512455
const int wrid = db_column_int(&q, 2);
24522456
if(!showAll && !wrid){
24532457
continue;
2458
+ }
2459
+ if( !showCkBr &&
2460
+ (sqlite3_strglob("checkin/*", zName)==0 ||
2461
+ sqlite3_strglob("branch/*", zName)==0) ){
2462
+ continue;
24542463
}
24552464
if( showIds ){
24562465
const char *zUuid = db_column_text(&q, 1);
24572466
fossil_print("%s ",zUuid);
24582467
}
24592468
--- src/wiki.c
+++ src/wiki.c
@@ -2189,19 +2189,22 @@
2189 **
2190 ** > fossil wiki list ?OPTIONS?
2191 ** > fossil wiki ls ?OPTIONS?
2192 **
2193 ** Lists all wiki entries, one per line, ordered
2194 ** case-insensitively by name.
 
2195 **
2196 ** Options:
2197 ** --all Include "deleted" pages in output.
2198 ** By default deleted pages are elided.
2199 ** -t|--technote Technotes will be listed instead of
2200 ** pages. The technotes will be in order
2201 ** of timestamp with the most recent
2202 ** first.
 
 
2203 ** -s|--show-technote-ids The id of the tech note will be listed
2204 ** along side the timestamp. The tech note
2205 ** id will be the first word on each line.
2206 ** This option only applies if the
2207 ** --technote option is also specified.
@@ -2431,10 +2434,11 @@
2431 }else if(( strncmp(g.argv[2],"list",n)==0 )
2432 || ( strncmp(g.argv[2],"ls",n)==0 )){
2433 Stmt q;
2434 const int fTechnote = find_option("technote","t",0)!=0;
2435 const int showIds = find_option("show-technote-ids","s",0)!=0;
 
2436 verify_all_options();
2437 if (fTechnote==0){
2438 db_prepare(&q, listAllWikiPages/*works-like:""*/);
2439 }else{
2440 db_prepare(&q,
@@ -2449,10 +2453,15 @@
2449 while( db_step(&q)==SQLITE_ROW ){
2450 const char *zName = db_column_text(&q, 0);
2451 const int wrid = db_column_int(&q, 2);
2452 if(!showAll && !wrid){
2453 continue;
 
 
 
 
 
2454 }
2455 if( showIds ){
2456 const char *zUuid = db_column_text(&q, 1);
2457 fossil_print("%s ",zUuid);
2458 }
2459
--- src/wiki.c
+++ src/wiki.c
@@ -2189,19 +2189,22 @@
2189 **
2190 ** > fossil wiki list ?OPTIONS?
2191 ** > fossil wiki ls ?OPTIONS?
2192 **
2193 ** Lists all wiki entries, one per line, ordered
2194 ** case-insensitively by name. Wiki pages associated with
2195 ** check-ins and branches are NOT shown, unless -a is given.
2196 **
2197 ** Options:
2198 ** --all Include "deleted" pages in output.
2199 ** By default deleted pages are elided.
2200 ** -t|--technote Technotes will be listed instead of
2201 ** pages. The technotes will be in order
2202 ** of timestamp with the most recent
2203 ** first.
2204 ** -a|--show-associated Show wiki pages associated with
2205 ** check-ins and branches.
2206 ** -s|--show-technote-ids The id of the tech note will be listed
2207 ** along side the timestamp. The tech note
2208 ** id will be the first word on each line.
2209 ** This option only applies if the
2210 ** --technote option is also specified.
@@ -2431,10 +2434,11 @@
2434 }else if(( strncmp(g.argv[2],"list",n)==0 )
2435 || ( strncmp(g.argv[2],"ls",n)==0 )){
2436 Stmt q;
2437 const int fTechnote = find_option("technote","t",0)!=0;
2438 const int showIds = find_option("show-technote-ids","s",0)!=0;
2439 const int showCkBr = find_option("show-associated","a",0)!=0;
2440 verify_all_options();
2441 if (fTechnote==0){
2442 db_prepare(&q, listAllWikiPages/*works-like:""*/);
2443 }else{
2444 db_prepare(&q,
@@ -2449,10 +2453,15 @@
2453 while( db_step(&q)==SQLITE_ROW ){
2454 const char *zName = db_column_text(&q, 0);
2455 const int wrid = db_column_int(&q, 2);
2456 if(!showAll && !wrid){
2457 continue;
2458 }
2459 if( !showCkBr &&
2460 (sqlite3_strglob("checkin/*", zName)==0 ||
2461 sqlite3_strglob("branch/*", zName)==0) ){
2462 continue;
2463 }
2464 if( showIds ){
2465 const char *zUuid = db_column_text(&q, 1);
2466 fossil_print("%s ",zUuid);
2467 }
2468

Keyboard Shortcuts

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