Fossil SCM
For the "fossil all" command, make --dont-stop the default. There is a new option --stop-on-error that sets the legacy behavior. Pause for 1/3rd of a second after any subprocess failure so that if the failures is due to SIGINT, a second SIGINT can have time to arrive before continuing.
Commit
bcd5adddbbbd323187e51e776a70ed096b5e746ecc0355e704ff3f486f44d581
Parent
e0d8f733b7f9a9d…
1 file changed
+12
-6
+12
-6
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -137,13 +137,13 @@ | ||
| 137 | 137 | ** when one of the following commands are run against the repository: |
| 138 | 138 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 139 | 139 | ** are added back to the list of repositories by these commands. |
| 140 | 140 | ** |
| 141 | 141 | ** Options: |
| 142 | -** --showfile Show the repository or checkout being operated upon. | |
| 143 | -** --dontstop Continue with other repositories even after an error. | |
| 144 | -** --dry-run If given, display instead of run actions. | |
| 142 | +** --dry-run If given, display instead of run actions. | |
| 143 | +** --showfile Show the repository or checkout being operated upon. | |
| 144 | +** --stop-on-error Halt immediately if any subprocess fails. | |
| 145 | 145 | */ |
| 146 | 146 | void all_cmd(void){ |
| 147 | 147 | int n; |
| 148 | 148 | Stmt q; |
| 149 | 149 | const char *zCmd; |
| @@ -151,14 +151,16 @@ | ||
| 151 | 151 | Blob extra; |
| 152 | 152 | int useCheckouts = 0; |
| 153 | 153 | int quiet = 0; |
| 154 | 154 | int dryRunFlag = 0; |
| 155 | 155 | int showFile = find_option("showfile",0,0)!=0; |
| 156 | - int stopOnError = find_option("dontstop",0,0)==0; | |
| 156 | + int stopOnError; | |
| 157 | 157 | int nToDel = 0; |
| 158 | 158 | int showLabel = 0; |
| 159 | 159 | |
| 160 | + (void)find_option("dontstop",0,0); /* Legacy. Now the default */ | |
| 161 | + stopOnError = find_option("stop-on-error",0,0)!=0; | |
| 160 | 162 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 161 | 163 | if( !dryRunFlag ){ |
| 162 | 164 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 163 | 165 | } |
| 164 | 166 | |
| @@ -416,12 +418,16 @@ | ||
| 416 | 418 | fossil_print("%s\n", zSyscmd); |
| 417 | 419 | fflush(stdout); |
| 418 | 420 | } |
| 419 | 421 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 420 | 422 | free(zSyscmd); |
| 421 | - if( stopOnError && rc ){ | |
| 422 | - break; | |
| 423 | + if( rc ){ | |
| 424 | + if( stopOnError ) break; | |
| 425 | + /* If there is an error, pause briefly, but do not stop. The brief | |
| 426 | + ** pause is so that if the prior command failed with Ctrl-C then there | |
| 427 | + ** will be time to stop the whole thing with a second Ctrl-C. */ | |
| 428 | + sqlite3_sleep(330); | |
| 423 | 429 | } |
| 424 | 430 | } |
| 425 | 431 | db_finalize(&q); |
| 426 | 432 | |
| 427 | 433 | blob_reset(&extra); |
| 428 | 434 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -137,13 +137,13 @@ | |
| 137 | ** when one of the following commands are run against the repository: |
| 138 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 139 | ** are added back to the list of repositories by these commands. |
| 140 | ** |
| 141 | ** Options: |
| 142 | ** --showfile Show the repository or checkout being operated upon. |
| 143 | ** --dontstop Continue with other repositories even after an error. |
| 144 | ** --dry-run If given, display instead of run actions. |
| 145 | */ |
| 146 | void all_cmd(void){ |
| 147 | int n; |
| 148 | Stmt q; |
| 149 | const char *zCmd; |
| @@ -151,14 +151,16 @@ | |
| 151 | Blob extra; |
| 152 | int useCheckouts = 0; |
| 153 | int quiet = 0; |
| 154 | int dryRunFlag = 0; |
| 155 | int showFile = find_option("showfile",0,0)!=0; |
| 156 | int stopOnError = find_option("dontstop",0,0)==0; |
| 157 | int nToDel = 0; |
| 158 | int showLabel = 0; |
| 159 | |
| 160 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 161 | if( !dryRunFlag ){ |
| 162 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 163 | } |
| 164 | |
| @@ -416,12 +418,16 @@ | |
| 416 | fossil_print("%s\n", zSyscmd); |
| 417 | fflush(stdout); |
| 418 | } |
| 419 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 420 | free(zSyscmd); |
| 421 | if( stopOnError && rc ){ |
| 422 | break; |
| 423 | } |
| 424 | } |
| 425 | db_finalize(&q); |
| 426 | |
| 427 | blob_reset(&extra); |
| 428 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -137,13 +137,13 @@ | |
| 137 | ** when one of the following commands are run against the repository: |
| 138 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 139 | ** are added back to the list of repositories by these commands. |
| 140 | ** |
| 141 | ** Options: |
| 142 | ** --dry-run If given, display instead of run actions. |
| 143 | ** --showfile Show the repository or checkout being operated upon. |
| 144 | ** --stop-on-error Halt immediately if any subprocess fails. |
| 145 | */ |
| 146 | void all_cmd(void){ |
| 147 | int n; |
| 148 | Stmt q; |
| 149 | const char *zCmd; |
| @@ -151,14 +151,16 @@ | |
| 151 | Blob extra; |
| 152 | int useCheckouts = 0; |
| 153 | int quiet = 0; |
| 154 | int dryRunFlag = 0; |
| 155 | int showFile = find_option("showfile",0,0)!=0; |
| 156 | int stopOnError; |
| 157 | int nToDel = 0; |
| 158 | int showLabel = 0; |
| 159 | |
| 160 | (void)find_option("dontstop",0,0); /* Legacy. Now the default */ |
| 161 | stopOnError = find_option("stop-on-error",0,0)!=0; |
| 162 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 163 | if( !dryRunFlag ){ |
| 164 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 165 | } |
| 166 | |
| @@ -416,12 +418,16 @@ | |
| 418 | fossil_print("%s\n", zSyscmd); |
| 419 | fflush(stdout); |
| 420 | } |
| 421 | rc = dryRunFlag ? 0 : fossil_system(zSyscmd); |
| 422 | free(zSyscmd); |
| 423 | if( rc ){ |
| 424 | if( stopOnError ) break; |
| 425 | /* If there is an error, pause briefly, but do not stop. The brief |
| 426 | ** pause is so that if the prior command failed with Ctrl-C then there |
| 427 | ** will be time to stop the whole thing with a second Ctrl-C. */ |
| 428 | sqlite3_sleep(330); |
| 429 | } |
| 430 | } |
| 431 | db_finalize(&q); |
| 432 | |
| 433 | blob_reset(&extra); |
| 434 |