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 ""'.

jan.nijtmans 2014-03-27 09:36 cleanX
Commit 7695a718bee7275c02ec864b41e4c053e1e30222
1 file changed +7 -5
+7 -5
--- src/checkin.c
+++ src/checkin.c
@@ -542,13 +542,13 @@
542542
** list of glob patterns.
543543
** -n|--dry-run If given, display instead of run actions.
544544
** --temp Remove only Fossil-generated temporary files.
545545
** -v|--verbose Show all files as they are removed.
546546
** -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.
550550
** Compatibile with "git clean -x".
551551
**
552552
** See also: addremove, extra, status
553553
*/
554554
void clean_cmd(void){
@@ -627,11 +627,12 @@
627627
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
628628
}
629629
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
630630
while( db_step(&q)==SQLITE_ROW ){
631631
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)) ){
633634
Blob ans;
634635
char cReply;
635636
int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot);
636637
char *prompt = mprintf("%sRemove %s file \"%s\" (a=all/y/N)? ",
637638
matchIgnore ? "WARNING: " : "",
@@ -672,11 +673,12 @@
672673
" ORDER BY 1 DESC",
673674
g.zLocalRoot, fossil_all_reserved_names(0)
674675
);
675676
while( db_step(&q)==SQLITE_ROW ){
676677
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)) ){
678680
Blob ans;
679681
char cReply;
680682
int matchIgnore = extremeFlag && glob_match(pIgnore, zName+nRoot);
681683
int matchEmpty = extremeFlag && glob_match(pEmptyDirs, zName+nRoot);
682684
char *prompt = mprintf("%sRemove %s empty directory \"%s\" "
683685
--- 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

Keyboard Shortcuts

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