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.

drh 2020-10-14 17:47 trunk
Commit bcd5adddbbbd323187e51e776a70ed096b5e746ecc0355e704ff3f486f44d581
1 file changed +12 -6
+12 -6
--- src/allrepo.c
+++ src/allrepo.c
@@ -137,13 +137,13 @@
137137
** when one of the following commands are run against the repository:
138138
** clone, info, pull, push, or sync. Even previously ignored repositories
139139
** are added back to the list of repositories by these commands.
140140
**
141141
** 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.
145145
*/
146146
void all_cmd(void){
147147
int n;
148148
Stmt q;
149149
const char *zCmd;
@@ -151,14 +151,16 @@
151151
Blob extra;
152152
int useCheckouts = 0;
153153
int quiet = 0;
154154
int dryRunFlag = 0;
155155
int showFile = find_option("showfile",0,0)!=0;
156
- int stopOnError = find_option("dontstop",0,0)==0;
156
+ int stopOnError;
157157
int nToDel = 0;
158158
int showLabel = 0;
159159
160
+ (void)find_option("dontstop",0,0); /* Legacy. Now the default */
161
+ stopOnError = find_option("stop-on-error",0,0)!=0;
160162
dryRunFlag = find_option("dry-run","n",0)!=0;
161163
if( !dryRunFlag ){
162164
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
163165
}
164166
@@ -416,12 +418,16 @@
416418
fossil_print("%s\n", zSyscmd);
417419
fflush(stdout);
418420
}
419421
rc = dryRunFlag ? 0 : fossil_system(zSyscmd);
420422
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);
423429
}
424430
}
425431
db_finalize(&q);
426432
427433
blob_reset(&extra);
428434
--- 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

Keyboard Shortcuts

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