Fossil SCM

Add the --ii option to the "fossil bisect run" command.

drh 2024-05-27 13:06 trunk
Commit 93c918b6dd37e35ad795c5355cf2507a565cac42a1d405d28eb8e535df3244db
1 file changed +18
+18
--- src/bisect.c
+++ src/bisect.c
@@ -390,10 +390,12 @@
390390
** Invoke COMMAND (with arguments) repeatedly to perform the bisect.
391391
**
392392
** Options:
393393
** -i|--interactive Prompt user for decisions rather than
394394
** using the return code from COMMAND
395
+** --ii Like -i but also pause after showing
396
+** the status after each step.
395397
*/
396398
static void bisect_run(void){
397399
const char *zCmd;
398400
int isInteractive = 0;
399401
int i;
@@ -404,10 +406,14 @@
404406
const char *zArg = g.argv[i];
405407
if( zArg[0]=='-' && zArg[1]=='-' && zArg[2]!=0 ) zArg++;
406408
if( strcmp(zArg, "-i")==0 || strcmp(zArg, "-interactive")==0 ){
407409
isInteractive = 1;
408410
continue;
411
+ }
412
+ if( strcmp(zArg, "-ii")==0 ){
413
+ isInteractive = 2;
414
+ continue;
409415
}
410416
fossil_fatal("unknown command-line option: \"%s\"\n", g.argv[i]);
411417
}
412418
zCmd = g.argv[i];
413419
if( db_int(0, "SELECT count(*) FROM vvar"
@@ -460,10 +466,22 @@
460466
blob_append(&cmd, " bisect bad", -1);
461467
}
462468
fossil_print("%s\n", blob_str(&cmd));
463469
fossil_system(blob_str(&cmd));
464470
blob_reset(&cmd);
471
+ if( isInteractive>=2 && db_lget_int("bisect-complete", 0)==0 ){
472
+ int n;
473
+ char *z;
474
+ Blob in;
475
+ int bContinue = 1;
476
+ prompt_user("Run testcase again? (Y)es or No: ", &in);
477
+ n = blob_size(&in);
478
+ z = blob_str(&in);
479
+ if( n>0 && sqlite3_strnicmp("no", z, n)==0 ) bContinue = 0;
480
+ blob_reset(&in);
481
+ if( !bContinue ) break;
482
+ }
465483
}
466484
}
467485
468486
/*
469487
** COMMAND: bisect
470488
--- src/bisect.c
+++ src/bisect.c
@@ -390,10 +390,12 @@
390 ** Invoke COMMAND (with arguments) repeatedly to perform the bisect.
391 **
392 ** Options:
393 ** -i|--interactive Prompt user for decisions rather than
394 ** using the return code from COMMAND
 
 
395 */
396 static void bisect_run(void){
397 const char *zCmd;
398 int isInteractive = 0;
399 int i;
@@ -404,10 +406,14 @@
404 const char *zArg = g.argv[i];
405 if( zArg[0]=='-' && zArg[1]=='-' && zArg[2]!=0 ) zArg++;
406 if( strcmp(zArg, "-i")==0 || strcmp(zArg, "-interactive")==0 ){
407 isInteractive = 1;
408 continue;
 
 
 
 
409 }
410 fossil_fatal("unknown command-line option: \"%s\"\n", g.argv[i]);
411 }
412 zCmd = g.argv[i];
413 if( db_int(0, "SELECT count(*) FROM vvar"
@@ -460,10 +466,22 @@
460 blob_append(&cmd, " bisect bad", -1);
461 }
462 fossil_print("%s\n", blob_str(&cmd));
463 fossil_system(blob_str(&cmd));
464 blob_reset(&cmd);
 
 
 
 
 
 
 
 
 
 
 
 
465 }
466 }
467
468 /*
469 ** COMMAND: bisect
470
--- src/bisect.c
+++ src/bisect.c
@@ -390,10 +390,12 @@
390 ** Invoke COMMAND (with arguments) repeatedly to perform the bisect.
391 **
392 ** Options:
393 ** -i|--interactive Prompt user for decisions rather than
394 ** using the return code from COMMAND
395 ** --ii Like -i but also pause after showing
396 ** the status after each step.
397 */
398 static void bisect_run(void){
399 const char *zCmd;
400 int isInteractive = 0;
401 int i;
@@ -404,10 +406,14 @@
406 const char *zArg = g.argv[i];
407 if( zArg[0]=='-' && zArg[1]=='-' && zArg[2]!=0 ) zArg++;
408 if( strcmp(zArg, "-i")==0 || strcmp(zArg, "-interactive")==0 ){
409 isInteractive = 1;
410 continue;
411 }
412 if( strcmp(zArg, "-ii")==0 ){
413 isInteractive = 2;
414 continue;
415 }
416 fossil_fatal("unknown command-line option: \"%s\"\n", g.argv[i]);
417 }
418 zCmd = g.argv[i];
419 if( db_int(0, "SELECT count(*) FROM vvar"
@@ -460,10 +466,22 @@
466 blob_append(&cmd, " bisect bad", -1);
467 }
468 fossil_print("%s\n", blob_str(&cmd));
469 fossil_system(blob_str(&cmd));
470 blob_reset(&cmd);
471 if( isInteractive>=2 && db_lget_int("bisect-complete", 0)==0 ){
472 int n;
473 char *z;
474 Blob in;
475 int bContinue = 1;
476 prompt_user("Run testcase again? (Y)es or No: ", &in);
477 n = blob_size(&in);
478 z = blob_str(&in);
479 if( n>0 && sqlite3_strnicmp("no", z, n)==0 ) bContinue = 0;
480 blob_reset(&in);
481 if( !bContinue ) break;
482 }
483 }
484 }
485
486 /*
487 ** COMMAND: bisect
488

Keyboard Shortcuts

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