Fossil SCM

Add support for "fossil remote" and "fossil sync --all" to the "fossil all" command.

drh 2023-01-05 19:49 trunk
Commit 693b950b1ef45ecb53eebfc40ba243284ff9466bbab277024f1c0e6783eeddf6
1 file changed +26 -4
+26 -4
--- src/allrepo.c
+++ src/allrepo.c
@@ -21,12 +21,13 @@
2121
#include "allrepo.h"
2222
#include <assert.h>
2323
2424
/*
2525
** Build a string that contains all of the command-line options
26
-** specified as arguments. If the option name begins with "+" then
27
-** it takes an argument. Without the "+" it does not.
26
+** specified as arguments. collect_argument() is used for stand-alone
27
+** options and collect_argument_value() is used for options that are
28
+** followed by an argument value.
2829
*/
2930
static void collect_argument(Blob *pExtra,const char *zArg,const char *zShort){
3031
const char *z = find_option(zArg, zShort, 0);
3132
if( z!=0 ){
3233
blob_appendf(pExtra, " %s", z);
@@ -281,10 +282,29 @@
281282
collect_argument(&extra, "wal",0);
282283
collect_argument(&extra, "stats",0);
283284
collect_argument(&extra, "index",0);
284285
collect_argument(&extra, "noindex",0);
285286
collect_argument(&extra, "ifneeded", 0);
287
+ }else if( fossil_strcmp(zCmd, "remote")==0 ){
288
+ showLabel = 1;
289
+ quiet = 1;
290
+ collect_argument(&extra, "show-passwords", 0);
291
+ if( g.argc==3 ){
292
+ zCmd = "remote -R";
293
+ }else if( g.argc!=4 ){
294
+ usage("remote ?config-data|list|ls?");
295
+ }else if( fossil_strcmp(g.argv[3],"ls")==0
296
+ || fossil_strcmp(g.argv[3],"list")==0 ){
297
+ zCmd = "remote ls -R";
298
+ }else if( fossil_strcmp(g.argv[3],"ls")==0
299
+ || fossil_strcmp(g.argv[3],"list")==0 ){
300
+ zCmd = "remote ls -R";
301
+ }else if( fossil_strcmp(g.argv[3],"config-data")==0 ){
302
+ zCmd = "remote config-data -R";
303
+ }else{
304
+ usage("remote ?config-data|list|ls?");
305
+ }
286306
}else if( fossil_strcmp(zCmd, "setting")==0 ){
287307
zCmd = "setting -R";
288308
collect_argv(&extra, 3);
289309
}else if( fossil_strcmp(zCmd, "unset")==0 ){
290310
zCmd = "unset -R";
@@ -295,10 +315,11 @@
295315
}else if( fossil_strcmp(zCmd, "sync")==0 ){
296316
zCmd = "sync -autourl -R";
297317
collect_argument(&extra, "share-links",0);
298318
collect_argument(&extra, "verbose","v");
299319
collect_argument(&extra, "unversioned","u");
320
+ collect_argument(&extra, "all",0);
300321
}else if( fossil_strcmp(zCmd, "test-integrity")==0 ){
301322
collect_argument(&extra, "db-only", "d");
302323
collect_argument(&extra, "parse", 0);
303324
collect_argument(&extra, "quick", "q");
304325
zCmd = "test-integrity";
@@ -383,12 +404,13 @@
383404
zCmd = "cache -R";
384405
showLabel = 1;
385406
collect_argv(&extra, 3);
386407
}else{
387408
fossil_fatal("\"all\" subcommand should be one of: "
388
- "add cache changes clean dbstat extras fts-config git ignore "
389
- "info list ls pull push rebuild server setting sync ui unset");
409
+ "add cache changes clean dbstat extras fts-config git ignore "
410
+ "info list ls pull push rebuild remote "
411
+ "server setting sync ui unset");
390412
}
391413
verify_all_options();
392414
db_multi_exec("CREATE TEMP TABLE repolist(name,tag);");
393415
if( useCheckouts ){
394416
db_multi_exec(
395417
--- src/allrepo.c
+++ src/allrepo.c
@@ -21,12 +21,13 @@
21 #include "allrepo.h"
22 #include <assert.h>
23
24 /*
25 ** Build a string that contains all of the command-line options
26 ** specified as arguments. If the option name begins with "+" then
27 ** it takes an argument. Without the "+" it does not.
 
28 */
29 static void collect_argument(Blob *pExtra,const char *zArg,const char *zShort){
30 const char *z = find_option(zArg, zShort, 0);
31 if( z!=0 ){
32 blob_appendf(pExtra, " %s", z);
@@ -281,10 +282,29 @@
281 collect_argument(&extra, "wal",0);
282 collect_argument(&extra, "stats",0);
283 collect_argument(&extra, "index",0);
284 collect_argument(&extra, "noindex",0);
285 collect_argument(&extra, "ifneeded", 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286 }else if( fossil_strcmp(zCmd, "setting")==0 ){
287 zCmd = "setting -R";
288 collect_argv(&extra, 3);
289 }else if( fossil_strcmp(zCmd, "unset")==0 ){
290 zCmd = "unset -R";
@@ -295,10 +315,11 @@
295 }else if( fossil_strcmp(zCmd, "sync")==0 ){
296 zCmd = "sync -autourl -R";
297 collect_argument(&extra, "share-links",0);
298 collect_argument(&extra, "verbose","v");
299 collect_argument(&extra, "unversioned","u");
 
300 }else if( fossil_strcmp(zCmd, "test-integrity")==0 ){
301 collect_argument(&extra, "db-only", "d");
302 collect_argument(&extra, "parse", 0);
303 collect_argument(&extra, "quick", "q");
304 zCmd = "test-integrity";
@@ -383,12 +404,13 @@
383 zCmd = "cache -R";
384 showLabel = 1;
385 collect_argv(&extra, 3);
386 }else{
387 fossil_fatal("\"all\" subcommand should be one of: "
388 "add cache changes clean dbstat extras fts-config git ignore "
389 "info list ls pull push rebuild server setting sync ui unset");
 
390 }
391 verify_all_options();
392 db_multi_exec("CREATE TEMP TABLE repolist(name,tag);");
393 if( useCheckouts ){
394 db_multi_exec(
395
--- src/allrepo.c
+++ src/allrepo.c
@@ -21,12 +21,13 @@
21 #include "allrepo.h"
22 #include <assert.h>
23
24 /*
25 ** Build a string that contains all of the command-line options
26 ** specified as arguments. collect_argument() is used for stand-alone
27 ** options and collect_argument_value() is used for options that are
28 ** followed by an argument value.
29 */
30 static void collect_argument(Blob *pExtra,const char *zArg,const char *zShort){
31 const char *z = find_option(zArg, zShort, 0);
32 if( z!=0 ){
33 blob_appendf(pExtra, " %s", z);
@@ -281,10 +282,29 @@
282 collect_argument(&extra, "wal",0);
283 collect_argument(&extra, "stats",0);
284 collect_argument(&extra, "index",0);
285 collect_argument(&extra, "noindex",0);
286 collect_argument(&extra, "ifneeded", 0);
287 }else if( fossil_strcmp(zCmd, "remote")==0 ){
288 showLabel = 1;
289 quiet = 1;
290 collect_argument(&extra, "show-passwords", 0);
291 if( g.argc==3 ){
292 zCmd = "remote -R";
293 }else if( g.argc!=4 ){
294 usage("remote ?config-data|list|ls?");
295 }else if( fossil_strcmp(g.argv[3],"ls")==0
296 || fossil_strcmp(g.argv[3],"list")==0 ){
297 zCmd = "remote ls -R";
298 }else if( fossil_strcmp(g.argv[3],"ls")==0
299 || fossil_strcmp(g.argv[3],"list")==0 ){
300 zCmd = "remote ls -R";
301 }else if( fossil_strcmp(g.argv[3],"config-data")==0 ){
302 zCmd = "remote config-data -R";
303 }else{
304 usage("remote ?config-data|list|ls?");
305 }
306 }else if( fossil_strcmp(zCmd, "setting")==0 ){
307 zCmd = "setting -R";
308 collect_argv(&extra, 3);
309 }else if( fossil_strcmp(zCmd, "unset")==0 ){
310 zCmd = "unset -R";
@@ -295,10 +315,11 @@
315 }else if( fossil_strcmp(zCmd, "sync")==0 ){
316 zCmd = "sync -autourl -R";
317 collect_argument(&extra, "share-links",0);
318 collect_argument(&extra, "verbose","v");
319 collect_argument(&extra, "unversioned","u");
320 collect_argument(&extra, "all",0);
321 }else if( fossil_strcmp(zCmd, "test-integrity")==0 ){
322 collect_argument(&extra, "db-only", "d");
323 collect_argument(&extra, "parse", 0);
324 collect_argument(&extra, "quick", "q");
325 zCmd = "test-integrity";
@@ -383,12 +404,13 @@
404 zCmd = "cache -R";
405 showLabel = 1;
406 collect_argv(&extra, 3);
407 }else{
408 fossil_fatal("\"all\" subcommand should be one of: "
409 "add cache changes clean dbstat extras fts-config git ignore "
410 "info list ls pull push rebuild remote "
411 "server setting sync ui unset");
412 }
413 verify_all_options();
414 db_multi_exec("CREATE TEMP TABLE repolist(name,tag);");
415 if( useCheckouts ){
416 db_multi_exec(
417

Keyboard Shortcuts

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