Fossil SCM
Add possible 'a=all' response to "fossil clean", and print out which files actually are removed.
Commit
3a2c433aa472fb802763cc252f2f01d98713b420
Parent
5a3855f68b3ddb0…
1 file changed
+8
-6
+8
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -434,24 +434,26 @@ | ||
| 434 | 434 | } |
| 435 | 435 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 436 | 436 | while( db_step(&q)==SQLITE_ROW ){ |
| 437 | 437 | if( testFlag ){ |
| 438 | 438 | fossil_print("%s\n", db_column_text(&q,0)); |
| 439 | - }else if( allFlag || glob_match(pIgnore, db_column_text(&q, 0)+n) ){ | |
| 440 | - file_delete(db_column_text(&q, 0)); | |
| 441 | - }else{ | |
| 439 | + }else if( !allFlag && !glob_match(pIgnore, db_column_text(&q, 0)+n) ){ | |
| 442 | 440 | Blob ans; |
| 443 | 441 | char cReply; |
| 444 | - char *prompt = mprintf("remove unmanaged file \"%s\" (y/N)? ", | |
| 442 | + char *prompt = mprintf("remove unmanaged file \"%s\" (y/a=all/N)? ", | |
| 445 | 443 | db_column_text(&q, 0)); |
| 446 | 444 | blob_zero(&ans); |
| 447 | 445 | prompt_user(prompt, &ans); |
| 448 | 446 | cReply = blob_str(&ans)[0]; |
| 449 | - if( cReply=='y' || cReply=='Y' ){ | |
| 450 | - file_delete(db_column_text(&q, 0)); | |
| 447 | + if( cReply=='a' || cReply=='A' ){ | |
| 448 | + allFlag = 0; | |
| 449 | + }else if( cReply!='y' && cReply!='Y' ){ | |
| 450 | + continue; | |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | + file_delete(db_column_text(&q, 0)); | |
| 454 | + fossil_print("removed unmanaged file \"%s\"\n", db_column_text(&q,0)); | |
| 453 | 455 | } |
| 454 | 456 | glob_free(pIgnore); |
| 455 | 457 | db_finalize(&q); |
| 456 | 458 | } |
| 457 | 459 | |
| 458 | 460 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -434,24 +434,26 @@ | |
| 434 | } |
| 435 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 436 | while( db_step(&q)==SQLITE_ROW ){ |
| 437 | if( testFlag ){ |
| 438 | fossil_print("%s\n", db_column_text(&q,0)); |
| 439 | }else if( allFlag || glob_match(pIgnore, db_column_text(&q, 0)+n) ){ |
| 440 | file_delete(db_column_text(&q, 0)); |
| 441 | }else{ |
| 442 | Blob ans; |
| 443 | char cReply; |
| 444 | char *prompt = mprintf("remove unmanaged file \"%s\" (y/N)? ", |
| 445 | db_column_text(&q, 0)); |
| 446 | blob_zero(&ans); |
| 447 | prompt_user(prompt, &ans); |
| 448 | cReply = blob_str(&ans)[0]; |
| 449 | if( cReply=='y' || cReply=='Y' ){ |
| 450 | file_delete(db_column_text(&q, 0)); |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | glob_free(pIgnore); |
| 455 | db_finalize(&q); |
| 456 | } |
| 457 | |
| 458 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -434,24 +434,26 @@ | |
| 434 | } |
| 435 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 436 | while( db_step(&q)==SQLITE_ROW ){ |
| 437 | if( testFlag ){ |
| 438 | fossil_print("%s\n", db_column_text(&q,0)); |
| 439 | }else if( !allFlag && !glob_match(pIgnore, db_column_text(&q, 0)+n) ){ |
| 440 | Blob ans; |
| 441 | char cReply; |
| 442 | char *prompt = mprintf("remove unmanaged file \"%s\" (y/a=all/N)? ", |
| 443 | db_column_text(&q, 0)); |
| 444 | blob_zero(&ans); |
| 445 | prompt_user(prompt, &ans); |
| 446 | cReply = blob_str(&ans)[0]; |
| 447 | if( cReply=='a' || cReply=='A' ){ |
| 448 | allFlag = 0; |
| 449 | }else if( cReply!='y' && cReply!='Y' ){ |
| 450 | continue; |
| 451 | } |
| 452 | } |
| 453 | file_delete(db_column_text(&q, 0)); |
| 454 | fossil_print("removed unmanaged file \"%s\"\n", db_column_text(&q,0)); |
| 455 | } |
| 456 | glob_free(pIgnore); |
| 457 | db_finalize(&q); |
| 458 | } |
| 459 | |
| 460 |