Fossil SCM
With 'fossil clean -x', prompt for any files not matching any of --ignore/--clean/--keep. This is actually what gives 'fossil clean -x' added value above 'fossil clean --ignore ""'.
Commit
7695a718bee7275c02ec864b41e4c053e1e30222
Parent
a40d3f90eb48fee…
1 file changed
+7
-5
+7
-5
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -542,13 +542,13 @@ | ||
| 542 | 542 | ** list of glob patterns. |
| 543 | 543 | ** -n|--dry-run If given, display instead of run actions. |
| 544 | 544 | ** --temp Remove only Fossil-generated temporary files. |
| 545 | 545 | ** -v|--verbose Show all files as they are removed. |
| 546 | 546 | ** -x|--extreme Remove all files not part of the current |
| 547 | -** checkout, without taking into consideration | |
| 548 | -** the "ignore-glob" setting and the --ignore | |
| 549 | -** command line option. | |
| 547 | +** checkout, except the ones matching --keep. | |
| 548 | +** Files not matching any of --clean/--ignore/-keep, | |
| 549 | +** will be prompted for. | |
| 550 | 550 | ** Compatibile with "git clean -x". |
| 551 | 551 | ** |
| 552 | 552 | ** See also: addremove, extra, status |
| 553 | 553 | */ |
| 554 | 554 | void clean_cmd(void){ |
| @@ -627,11 +627,12 @@ | ||
| 627 | 627 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 628 | 628 | } |
| 629 | 629 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 630 | 630 | while( db_step(&q)==SQLITE_ROW ){ |
| 631 | 631 | const char *zName = db_column_text(&q, 0); |
| 632 | - if( !allFileFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ | |
| 632 | + if( !allFileFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) | |
| 633 | + && !(extremeFlag && glob_match(pIgnore, zName+nRoot)) ){ | |
| 633 | 634 | Blob ans; |
| 634 | 635 | char cReply; |
| 635 | 636 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 636 | 637 | char *prompt = mprintf("%sRemove %s file \"%s\" (a=all/y/N)? ", |
| 637 | 638 | matchIgnore ? "WARNING: " : "", |
| @@ -672,11 +673,12 @@ | ||
| 672 | 673 | " ORDER BY 1 DESC", |
| 673 | 674 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 674 | 675 | ); |
| 675 | 676 | while( db_step(&q)==SQLITE_ROW ){ |
| 676 | 677 | const char *zName = db_column_text(&q, 0); |
| 677 | - if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ | |
| 678 | + if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) | |
| 679 | + && !(extremeFlag && glob_match(pIgnore, zName+nRoot)) ){ | |
| 678 | 680 | Blob ans; |
| 679 | 681 | char cReply; |
| 680 | 682 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 681 | 683 | int matchEmpty = extremeFlag && glob_match(pEmptyDirs, zName+nRoot); |
| 682 | 684 | char *prompt = mprintf("%sRemove %s empty directory \"%s\" " |
| 683 | 685 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -542,13 +542,13 @@ | |
| 542 | ** list of glob patterns. |
| 543 | ** -n|--dry-run If given, display instead of run actions. |
| 544 | ** --temp Remove only Fossil-generated temporary files. |
| 545 | ** -v|--verbose Show all files as they are removed. |
| 546 | ** -x|--extreme Remove all files not part of the current |
| 547 | ** checkout, without taking into consideration |
| 548 | ** the "ignore-glob" setting and the --ignore |
| 549 | ** command line option. |
| 550 | ** Compatibile with "git clean -x". |
| 551 | ** |
| 552 | ** See also: addremove, extra, status |
| 553 | */ |
| 554 | void clean_cmd(void){ |
| @@ -627,11 +627,12 @@ | |
| 627 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 628 | } |
| 629 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 630 | while( db_step(&q)==SQLITE_ROW ){ |
| 631 | const char *zName = db_column_text(&q, 0); |
| 632 | if( !allFileFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ |
| 633 | Blob ans; |
| 634 | char cReply; |
| 635 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 636 | char *prompt = mprintf("%sRemove %s file \"%s\" (a=all/y/N)? ", |
| 637 | matchIgnore ? "WARNING: " : "", |
| @@ -672,11 +673,12 @@ | |
| 672 | " ORDER BY 1 DESC", |
| 673 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 674 | ); |
| 675 | while( db_step(&q)==SQLITE_ROW ){ |
| 676 | const char *zName = db_column_text(&q, 0); |
| 677 | if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ |
| 678 | Blob ans; |
| 679 | char cReply; |
| 680 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 681 | int matchEmpty = extremeFlag && glob_match(pEmptyDirs, zName+nRoot); |
| 682 | char *prompt = mprintf("%sRemove %s empty directory \"%s\" " |
| 683 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -542,13 +542,13 @@ | |
| 542 | ** list of glob patterns. |
| 543 | ** -n|--dry-run If given, display instead of run actions. |
| 544 | ** --temp Remove only Fossil-generated temporary files. |
| 545 | ** -v|--verbose Show all files as they are removed. |
| 546 | ** -x|--extreme Remove all files not part of the current |
| 547 | ** checkout, except the ones matching --keep. |
| 548 | ** Files not matching any of --clean/--ignore/-keep, |
| 549 | ** will be prompted for. |
| 550 | ** Compatibile with "git clean -x". |
| 551 | ** |
| 552 | ** See also: addremove, extra, status |
| 553 | */ |
| 554 | void clean_cmd(void){ |
| @@ -627,11 +627,12 @@ | |
| 627 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 628 | } |
| 629 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 630 | while( db_step(&q)==SQLITE_ROW ){ |
| 631 | const char *zName = db_column_text(&q, 0); |
| 632 | if( !allFileFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) |
| 633 | && !(extremeFlag && glob_match(pIgnore, zName+nRoot)) ){ |
| 634 | Blob ans; |
| 635 | char cReply; |
| 636 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 637 | char *prompt = mprintf("%sRemove %s file \"%s\" (a=all/y/N)? ", |
| 638 | matchIgnore ? "WARNING: " : "", |
| @@ -672,11 +673,12 @@ | |
| 673 | " ORDER BY 1 DESC", |
| 674 | g.zLocalRoot, fossil_all_reserved_names(0) |
| 675 | ); |
| 676 | while( db_step(&q)==SQLITE_ROW ){ |
| 677 | const char *zName = db_column_text(&q, 0); |
| 678 | if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) |
| 679 | && !(extremeFlag && glob_match(pIgnore, zName+nRoot)) ){ |
| 680 | Blob ans; |
| 681 | char cReply; |
| 682 | int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot); |
| 683 | int matchEmpty = extremeFlag && glob_match(pEmptyDirs, zName+nRoot); |
| 684 | char *prompt = mprintf("%sRemove %s empty directory \"%s\" " |
| 685 |