Fossil SCM
Add support for "fossil remote" and "fossil sync --all" to the "fossil all" command.
Commit
693b950b1ef45ecb53eebfc40ba243284ff9466bbab277024f1c0e6783eeddf6
Parent
a821cbf522bee8d…
1 file changed
+26
-4
+26
-4
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -21,12 +21,13 @@ | ||
| 21 | 21 | #include "allrepo.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 23 | |
| 24 | 24 | /* |
| 25 | 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. | |
| 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. | |
| 28 | 29 | */ |
| 29 | 30 | static void collect_argument(Blob *pExtra,const char *zArg,const char *zShort){ |
| 30 | 31 | const char *z = find_option(zArg, zShort, 0); |
| 31 | 32 | if( z!=0 ){ |
| 32 | 33 | blob_appendf(pExtra, " %s", z); |
| @@ -281,10 +282,29 @@ | ||
| 281 | 282 | collect_argument(&extra, "wal",0); |
| 282 | 283 | collect_argument(&extra, "stats",0); |
| 283 | 284 | collect_argument(&extra, "index",0); |
| 284 | 285 | collect_argument(&extra, "noindex",0); |
| 285 | 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 | + } | |
| 286 | 306 | }else if( fossil_strcmp(zCmd, "setting")==0 ){ |
| 287 | 307 | zCmd = "setting -R"; |
| 288 | 308 | collect_argv(&extra, 3); |
| 289 | 309 | }else if( fossil_strcmp(zCmd, "unset")==0 ){ |
| 290 | 310 | zCmd = "unset -R"; |
| @@ -295,10 +315,11 @@ | ||
| 295 | 315 | }else if( fossil_strcmp(zCmd, "sync")==0 ){ |
| 296 | 316 | zCmd = "sync -autourl -R"; |
| 297 | 317 | collect_argument(&extra, "share-links",0); |
| 298 | 318 | collect_argument(&extra, "verbose","v"); |
| 299 | 319 | collect_argument(&extra, "unversioned","u"); |
| 320 | + collect_argument(&extra, "all",0); | |
| 300 | 321 | }else if( fossil_strcmp(zCmd, "test-integrity")==0 ){ |
| 301 | 322 | collect_argument(&extra, "db-only", "d"); |
| 302 | 323 | collect_argument(&extra, "parse", 0); |
| 303 | 324 | collect_argument(&extra, "quick", "q"); |
| 304 | 325 | zCmd = "test-integrity"; |
| @@ -383,12 +404,13 @@ | ||
| 383 | 404 | zCmd = "cache -R"; |
| 384 | 405 | showLabel = 1; |
| 385 | 406 | collect_argv(&extra, 3); |
| 386 | 407 | }else{ |
| 387 | 408 | 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"); | |
| 390 | 412 | } |
| 391 | 413 | verify_all_options(); |
| 392 | 414 | db_multi_exec("CREATE TEMP TABLE repolist(name,tag);"); |
| 393 | 415 | if( useCheckouts ){ |
| 394 | 416 | db_multi_exec( |
| 395 | 417 |
| --- 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 |