Fossil SCM

Fix memory leak in prompt handling. Move clean-glob setting to ignore-glob, that makes "fossil extras" and "fossil clean" behave much more sensible.

jan.nijtmans 2015-06-26 21:25 undo-clean
Commit a98c99571fa3f0e173970882182e09f31c073f39
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*
33
fossil
44
fossil.exe
55
win/fossil.exe
6
+*.a
7
+*.lib
8
+*.manifest
9
+*.o
10
+*.obj
11
+*.pdb
12
+*.res
13
+Makefile
14
+bld/*
15
+wbld/*
16
+win/*.c
17
+win/*.h
18
+win/*.exe
19
+win/headers
20
+win/linkopts
21
+autoconfig.h
22
+config.log
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 fossil
4 fossil.exe
5 win/fossil.exe
6 *.a
7 *.lib
8 *.manifest
9 *.o
10 *.obj
11 *.pdb
12 *.res
13 Makefile
14 bld/*
15 wbld/*
16 win/*.c
17 win/*.h
18 win/*.exe
19 win/headers
20 win/linkopts
21 autoconfig.h
22 config.log
23
+3 -3
--- src/checkin.c
+++ src/checkin.c
@@ -672,12 +672,12 @@
672672
** that were removed will be removed as well.
673673
** -f|--force Remove directories without prompting.
674674
** -x|--verily Remove everything that is not a managed file or
675675
** the repository itself. Implies -f --emptydirs
676676
** --dotfiles. Disregard keep-glob and ignore-glob,
677
-** except that files matching ignore-glob are not
678
-** never undo-able.
677
+** except that files matching ignore-glob are never
678
+** undo-able.
679679
** --clean <CSG> Never prompt for files matching this
680680
** comma separated list of glob patterns.
681681
** --ignore <CSG> Ignore files matching patterns from the
682682
** comma separated list of glob patterns.
683683
** --keep <CSG> Keep files matching this comma separated
@@ -772,16 +772,16 @@
772772
if( !dryRunFlag && !glob_match(pClean, zName+nRoot)
773773
&& !(verilyFlag && glob_match(pIgnore, zName+nRoot))
774774
&& undo_save(zName+nRoot, 10*1024*1024) ){
775775
prompt = mprintf("file \"%s\" too big. Deletion will not be "
776776
"undo-able. Continue (y/N)? ", zName+nRoot);
777
- blob_zero(&ans);
778777
prompt_user(prompt, &ans);
779778
cReply = blob_str(&ans)[0];
780779
if( cReply!='y' && cReply!='Y' ){
781780
fossil_fatal("Clean aborted");
782781
}
782
+ blob_reset(&ans);
783783
}
784784
if( dryRunFlag || file_delete(zName)==0 ){
785785
if( verboseFlag || dryRunFlag ){
786786
fossil_print("Removed unmanaged file: %s\n", zName+nRoot);
787787
}
788788
--- src/checkin.c
+++ src/checkin.c
@@ -672,12 +672,12 @@
672 ** that were removed will be removed as well.
673 ** -f|--force Remove directories without prompting.
674 ** -x|--verily Remove everything that is not a managed file or
675 ** the repository itself. Implies -f --emptydirs
676 ** --dotfiles. Disregard keep-glob and ignore-glob,
677 ** except that files matching ignore-glob are not
678 ** never undo-able.
679 ** --clean <CSG> Never prompt for files matching this
680 ** comma separated list of glob patterns.
681 ** --ignore <CSG> Ignore files matching patterns from the
682 ** comma separated list of glob patterns.
683 ** --keep <CSG> Keep files matching this comma separated
@@ -772,16 +772,16 @@
772 if( !dryRunFlag && !glob_match(pClean, zName+nRoot)
773 && !(verilyFlag && glob_match(pIgnore, zName+nRoot))
774 && undo_save(zName+nRoot, 10*1024*1024) ){
775 prompt = mprintf("file \"%s\" too big. Deletion will not be "
776 "undo-able. Continue (y/N)? ", zName+nRoot);
777 blob_zero(&ans);
778 prompt_user(prompt, &ans);
779 cReply = blob_str(&ans)[0];
780 if( cReply!='y' && cReply!='Y' ){
781 fossil_fatal("Clean aborted");
782 }
 
783 }
784 if( dryRunFlag || file_delete(zName)==0 ){
785 if( verboseFlag || dryRunFlag ){
786 fossil_print("Removed unmanaged file: %s\n", zName+nRoot);
787 }
788
--- src/checkin.c
+++ src/checkin.c
@@ -672,12 +672,12 @@
672 ** that were removed will be removed as well.
673 ** -f|--force Remove directories without prompting.
674 ** -x|--verily Remove everything that is not a managed file or
675 ** the repository itself. Implies -f --emptydirs
676 ** --dotfiles. Disregard keep-glob and ignore-glob,
677 ** except that files matching ignore-glob are never
678 ** undo-able.
679 ** --clean <CSG> Never prompt for files matching this
680 ** comma separated list of glob patterns.
681 ** --ignore <CSG> Ignore files matching patterns from the
682 ** comma separated list of glob patterns.
683 ** --keep <CSG> Keep files matching this comma separated
@@ -772,16 +772,16 @@
772 if( !dryRunFlag && !glob_match(pClean, zName+nRoot)
773 && !(verilyFlag && glob_match(pIgnore, zName+nRoot))
774 && undo_save(zName+nRoot, 10*1024*1024) ){
775 prompt = mprintf("file \"%s\" too big. Deletion will not be "
776 "undo-able. Continue (y/N)? ", zName+nRoot);
 
777 prompt_user(prompt, &ans);
778 cReply = blob_str(&ans)[0];
779 if( cReply!='y' && cReply!='Y' ){
780 fossil_fatal("Clean aborted");
781 }
782 blob_reset(&ans);
783 }
784 if( dryRunFlag || file_delete(zName)==0 ){
785 if( verboseFlag || dryRunFlag ){
786 fossil_print("Removed unmanaged file: %s\n", zName+nRoot);
787 }
788

Keyboard Shortcuts

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