Fossil SCM
Add the --ii option to the "fossil bisect run" command.
Commit
93c918b6dd37e35ad795c5355cf2507a565cac42a1d405d28eb8e535df3244db
Parent
c50da2eaa428133…
1 file changed
+18
+18
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -390,10 +390,12 @@ | ||
| 390 | 390 | ** Invoke COMMAND (with arguments) repeatedly to perform the bisect. |
| 391 | 391 | ** |
| 392 | 392 | ** Options: |
| 393 | 393 | ** -i|--interactive Prompt user for decisions rather than |
| 394 | 394 | ** using the return code from COMMAND |
| 395 | +** --ii Like -i but also pause after showing | |
| 396 | +** the status after each step. | |
| 395 | 397 | */ |
| 396 | 398 | static void bisect_run(void){ |
| 397 | 399 | const char *zCmd; |
| 398 | 400 | int isInteractive = 0; |
| 399 | 401 | int i; |
| @@ -404,10 +406,14 @@ | ||
| 404 | 406 | const char *zArg = g.argv[i]; |
| 405 | 407 | if( zArg[0]=='-' && zArg[1]=='-' && zArg[2]!=0 ) zArg++; |
| 406 | 408 | if( strcmp(zArg, "-i")==0 || strcmp(zArg, "-interactive")==0 ){ |
| 407 | 409 | isInteractive = 1; |
| 408 | 410 | continue; |
| 411 | + } | |
| 412 | + if( strcmp(zArg, "-ii")==0 ){ | |
| 413 | + isInteractive = 2; | |
| 414 | + continue; | |
| 409 | 415 | } |
| 410 | 416 | fossil_fatal("unknown command-line option: \"%s\"\n", g.argv[i]); |
| 411 | 417 | } |
| 412 | 418 | zCmd = g.argv[i]; |
| 413 | 419 | if( db_int(0, "SELECT count(*) FROM vvar" |
| @@ -460,10 +466,22 @@ | ||
| 460 | 466 | blob_append(&cmd, " bisect bad", -1); |
| 461 | 467 | } |
| 462 | 468 | fossil_print("%s\n", blob_str(&cmd)); |
| 463 | 469 | fossil_system(blob_str(&cmd)); |
| 464 | 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 | + } | |
| 465 | 483 | } |
| 466 | 484 | } |
| 467 | 485 | |
| 468 | 486 | /* |
| 469 | 487 | ** COMMAND: bisect |
| 470 | 488 |
| --- 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 |