Fossil SCM

No longer assume -f with -x|--verily, as everything matching --ignore will not be prompted for anyway.

jan.nijtmans 2015-04-30 22:03 cleanX
Commit f870407c8cc61bb3dcf420f4a1668462b20d975f
D .fossil-settings/clean-glob
-14
--- a/.fossil-settings/clean-glob
+++ b/.fossil-settings/clean-glob
@@ -1,14 +0,0 @@
1
-*.a
2
-*.lib
3
-*.manifest
4
-*.o
5
-bld/*
6
-w.a
7
-*.lib
8
-*.manifest
9
-*.o
10
-*.obj
11
-*.pdb
12
-*.res
13
-Makefile
14
-aut
--- a/.fossil-settings/clean-glob
+++ b/.fossil-settings/clean-glob
@@ -1,14 +0,0 @@
1 *.a
2 *.lib
3 *.manifest
4 *.o
5 bld/*
6 w.a
7 *.lib
8 *.manifest
9 *.o
10 *.obj
11 *.pdb
12 *.res
13 Makefile
14 aut
--- a/.fossil-settings/clean-glob
+++ b/.fossil-settings/clean-glob
@@ -1,14 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,5 +1,22 @@
11
compat/openssl*
22
compat/tcl*
3
+*.a
4
+*.lib
5
+*.manifest
6
+*.o
7
+*.obj
8
+*.pdb
9
+*.res
10
+Makefile
11
+bld/*
12
+wbld/*
13
+win/*.c
14
+win/*.h
15
+win/*.exe
16
+win/headers
17
+win/linkopts
18
+autoconfig.h
19
+config.log
320
fossil
421
fossil.exe
522
win/fossil.exe
623
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,5 +1,22 @@
1 compat/openssl*
2 compat/tcl*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3 fossil
4 fossil.exe
5 win/fossil.exe
6
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,5 +1,22 @@
1 compat/openssl*
2 compat/tcl*
3 *.a
4 *.lib
5 *.manifest
6 *.o
7 *.obj
8 *.pdb
9 *.res
10 Makefile
11 bld/*
12 wbld/*
13 win/*.c
14 win/*.h
15 win/*.exe
16 win/headers
17 win/linkopts
18 autoconfig.h
19 config.log
20 fossil
21 fossil.exe
22 win/fossil.exe
23
+5 -28
--- src/checkin.c
+++ src/checkin.c
@@ -634,11 +634,11 @@
634634
** values for --clean, --ignore, and --keep are determined by the
635635
** (versionable) clean-glob, ignore-glob, and keep-glob settings.
636636
** Files and subdirectories whose names begin with "." are automatically
637637
** ignored unless the --dotfiles option is used.
638638
**
639
-** The --verily option ignores ignore-glob settings and turns on
639
+** The --verily option ignores the ignore-glob setting and turns on
640640
**--dotfiles, and --emptydirs. Use the --verily option when you
641641
** really want to clean up everything.
642642
**
643643
** Options:
644644
** --allckouts Check for empty directories within any checkouts
@@ -676,11 +676,11 @@
676676
** -v|--verbose Show all files as they are removed.
677677
**
678678
** See also: addremove, extras, status
679679
*/
680680
void clean_cmd(void){
681
- int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
681
+ int allFileFlag, dryRunFlag, verboseFlag;
682682
int emptyDirsFlag, dirsOnlyFlag;
683683
unsigned scanFlags = 0;
684684
int verilyFlag;
685685
const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
686686
Glob *pIgnore, *pKeep, *pClean;
@@ -691,11 +691,11 @@
691691
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
692692
}
693693
if( !dryRunFlag ){
694694
dryRunFlag = find_option("whatif",0,0)!=0;
695695
}
696
- allFileFlag = allDirFlag = find_option("force","f",0)!=0;
696
+ allFileFlag = find_option("force","f",0)!=0;
697697
dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
698698
emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
699699
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
700700
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
701701
if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED;
@@ -703,11 +703,11 @@
703703
verboseFlag = find_option("verbose","v",0)!=0;
704704
zKeepFlag = find_option("keep",0,1);
705705
zCleanFlag = find_option("clean",0,1);
706706
db_must_be_within_tree();
707707
if( find_option("verily","x",0)!=0 ){
708
- verilyFlag = allFileFlag = allDirFlag = 1;
708
+ verilyFlag = 1;
709709
emptyDirsFlag = 1;
710710
scanFlags |= SCAN_ALL;
711711
zCleanFlag = 0;
712712
}
713713
if( zIgnoreFlag==0 ){
@@ -783,12 +783,11 @@
783783
Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0));
784784
Stmt q;
785785
Blob root;
786786
blob_init(&root, g.zLocalRoot, nRoot - 1);
787787
vfile_dir_scan(&root, blob_size(&root), scanFlags,
788
- verilyFlag ? 0 : pIgnore,
789
- verilyFlag ? 0 : pEmptyDirs);
788
+ verilyFlag ? 0 : pIgnore, pEmptyDirs);
790789
blob_reset(&root);
791790
db_prepare(&q,
792791
"SELECT %Q || x FROM dscan_temp"
793792
" WHERE x NOT IN (%s) AND y = 0"
794793
" ORDER BY 1 DESC",
@@ -801,32 +800,10 @@
801800
fossil_print("KEPT directory \"%s\" not removed (due to --keep"
802801
" or \"keep-glob\")\n", zName+nRoot);
803802
}
804803
continue;
805804
}
806
- if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot)
807
- && !(verilyFlag && glob_match(pIgnore, zName+nRoot)) ){
808
- Blob ans;
809
- char cReply;
810
- int matchIgnore = verilyFlag && glob_match(pIgnore, zName+nRoot);
811
- int matchEmpty = verilyFlag && glob_match(pEmptyDirs, zName+nRoot);
812
- char *prompt = mprintf("%sRemove %s empty directory \"%s\" "
813
- "(a=all/y/N)? ",
814
- (matchEmpty || matchIgnore) ?
815
- "WARNING: " : "", matchEmpty ? "\"RESERVED\"" :
816
- matchIgnore ? "\"IGNORED\"" : "unmanaged",
817
- zName+nRoot);
818
- prompt_user(prompt, &ans);
819
- cReply = blob_str(&ans)[0];
820
- if( cReply=='a' || cReply=='A' ){
821
- allDirFlag = 1;
822
- }else if( cReply!='y' && cReply!='Y' ){
823
- blob_reset(&ans);
824
- continue;
825
- }
826
- blob_reset(&ans);
827
- }
828805
if( dryRunFlag || file_rmdir(zName)==0 ){
829806
if( verboseFlag || dryRunFlag ){
830807
fossil_print("Removed unmanaged directory: %s\n", zName+nRoot);
831808
}
832809
}else if( verboseFlag ){
833810
--- src/checkin.c
+++ src/checkin.c
@@ -634,11 +634,11 @@
634 ** values for --clean, --ignore, and --keep are determined by the
635 ** (versionable) clean-glob, ignore-glob, and keep-glob settings.
636 ** Files and subdirectories whose names begin with "." are automatically
637 ** ignored unless the --dotfiles option is used.
638 **
639 ** The --verily option ignores ignore-glob settings and turns on
640 **--dotfiles, and --emptydirs. Use the --verily option when you
641 ** really want to clean up everything.
642 **
643 ** Options:
644 ** --allckouts Check for empty directories within any checkouts
@@ -676,11 +676,11 @@
676 ** -v|--verbose Show all files as they are removed.
677 **
678 ** See also: addremove, extras, status
679 */
680 void clean_cmd(void){
681 int allFileFlag, allDirFlag, dryRunFlag, verboseFlag;
682 int emptyDirsFlag, dirsOnlyFlag;
683 unsigned scanFlags = 0;
684 int verilyFlag;
685 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
686 Glob *pIgnore, *pKeep, *pClean;
@@ -691,11 +691,11 @@
691 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
692 }
693 if( !dryRunFlag ){
694 dryRunFlag = find_option("whatif",0,0)!=0;
695 }
696 allFileFlag = allDirFlag = find_option("force","f",0)!=0;
697 dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
698 emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
699 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
700 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
701 if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED;
@@ -703,11 +703,11 @@
703 verboseFlag = find_option("verbose","v",0)!=0;
704 zKeepFlag = find_option("keep",0,1);
705 zCleanFlag = find_option("clean",0,1);
706 db_must_be_within_tree();
707 if( find_option("verily","x",0)!=0 ){
708 verilyFlag = allFileFlag = allDirFlag = 1;
709 emptyDirsFlag = 1;
710 scanFlags |= SCAN_ALL;
711 zCleanFlag = 0;
712 }
713 if( zIgnoreFlag==0 ){
@@ -783,12 +783,11 @@
783 Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0));
784 Stmt q;
785 Blob root;
786 blob_init(&root, g.zLocalRoot, nRoot - 1);
787 vfile_dir_scan(&root, blob_size(&root), scanFlags,
788 verilyFlag ? 0 : pIgnore,
789 verilyFlag ? 0 : pEmptyDirs);
790 blob_reset(&root);
791 db_prepare(&q,
792 "SELECT %Q || x FROM dscan_temp"
793 " WHERE x NOT IN (%s) AND y = 0"
794 " ORDER BY 1 DESC",
@@ -801,32 +800,10 @@
801 fossil_print("KEPT directory \"%s\" not removed (due to --keep"
802 " or \"keep-glob\")\n", zName+nRoot);
803 }
804 continue;
805 }
806 if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot)
807 && !(verilyFlag && glob_match(pIgnore, zName+nRoot)) ){
808 Blob ans;
809 char cReply;
810 int matchIgnore = verilyFlag && glob_match(pIgnore, zName+nRoot);
811 int matchEmpty = verilyFlag && glob_match(pEmptyDirs, zName+nRoot);
812 char *prompt = mprintf("%sRemove %s empty directory \"%s\" "
813 "(a=all/y/N)? ",
814 (matchEmpty || matchIgnore) ?
815 "WARNING: " : "", matchEmpty ? "\"RESERVED\"" :
816 matchIgnore ? "\"IGNORED\"" : "unmanaged",
817 zName+nRoot);
818 prompt_user(prompt, &ans);
819 cReply = blob_str(&ans)[0];
820 if( cReply=='a' || cReply=='A' ){
821 allDirFlag = 1;
822 }else if( cReply!='y' && cReply!='Y' ){
823 blob_reset(&ans);
824 continue;
825 }
826 blob_reset(&ans);
827 }
828 if( dryRunFlag || file_rmdir(zName)==0 ){
829 if( verboseFlag || dryRunFlag ){
830 fossil_print("Removed unmanaged directory: %s\n", zName+nRoot);
831 }
832 }else if( verboseFlag ){
833
--- src/checkin.c
+++ src/checkin.c
@@ -634,11 +634,11 @@
634 ** values for --clean, --ignore, and --keep are determined by the
635 ** (versionable) clean-glob, ignore-glob, and keep-glob settings.
636 ** Files and subdirectories whose names begin with "." are automatically
637 ** ignored unless the --dotfiles option is used.
638 **
639 ** The --verily option ignores the ignore-glob setting and turns on
640 **--dotfiles, and --emptydirs. Use the --verily option when you
641 ** really want to clean up everything.
642 **
643 ** Options:
644 ** --allckouts Check for empty directories within any checkouts
@@ -676,11 +676,11 @@
676 ** -v|--verbose Show all files as they are removed.
677 **
678 ** See also: addremove, extras, status
679 */
680 void clean_cmd(void){
681 int allFileFlag, dryRunFlag, verboseFlag;
682 int emptyDirsFlag, dirsOnlyFlag;
683 unsigned scanFlags = 0;
684 int verilyFlag;
685 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
686 Glob *pIgnore, *pKeep, *pClean;
@@ -691,11 +691,11 @@
691 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
692 }
693 if( !dryRunFlag ){
694 dryRunFlag = find_option("whatif",0,0)!=0;
695 }
696 allFileFlag = find_option("force","f",0)!=0;
697 dirsOnlyFlag = find_option("dirsonly",0,0)!=0;
698 emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag;
699 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
700 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
701 if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED;
@@ -703,11 +703,11 @@
703 verboseFlag = find_option("verbose","v",0)!=0;
704 zKeepFlag = find_option("keep",0,1);
705 zCleanFlag = find_option("clean",0,1);
706 db_must_be_within_tree();
707 if( find_option("verily","x",0)!=0 ){
708 verilyFlag = 1;
709 emptyDirsFlag = 1;
710 scanFlags |= SCAN_ALL;
711 zCleanFlag = 0;
712 }
713 if( zIgnoreFlag==0 ){
@@ -783,12 +783,11 @@
783 Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0));
784 Stmt q;
785 Blob root;
786 blob_init(&root, g.zLocalRoot, nRoot - 1);
787 vfile_dir_scan(&root, blob_size(&root), scanFlags,
788 verilyFlag ? 0 : pIgnore, pEmptyDirs);
 
789 blob_reset(&root);
790 db_prepare(&q,
791 "SELECT %Q || x FROM dscan_temp"
792 " WHERE x NOT IN (%s) AND y = 0"
793 " ORDER BY 1 DESC",
@@ -801,32 +800,10 @@
800 fossil_print("KEPT directory \"%s\" not removed (due to --keep"
801 " or \"keep-glob\")\n", zName+nRoot);
802 }
803 continue;
804 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805 if( dryRunFlag || file_rmdir(zName)==0 ){
806 if( verboseFlag || dryRunFlag ){
807 fossil_print("Removed unmanaged directory: %s\n", zName+nRoot);
808 }
809 }else if( verboseFlag ){
810

Keyboard Shortcuts

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