Fossil SCM

rebase

jan.nijtmans 2013-06-19 07:14 trunk merge
Commit cbf9660369975e7819d3e6d8783513e645de0d7b
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,4 +1,21 @@
11
compat/openssl-1.0.1e/*
22
compat/tcl-8.6/*
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
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
1 compat/openssl-1.0.1e/*
2 compat/tcl-8.6/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3 fossil
4 fossil.exe
5
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
1 compat/openssl-1.0.1e/*
2 compat/tcl-8.6/*
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
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
11
compat/openssl-1.0.1e/*
22
compat/tcl-8.6/*
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
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
1 compat/openssl-1.0.1e/*
2 compat/tcl-8.6/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3 fossil
4 fossil.exe
5
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
1 compat/openssl-1.0.1e/*
2 compat/tcl-8.6/*
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
+8 -27
--- src/add.c
+++ src/add.c
@@ -221,15 +221,14 @@
221221
**
222222
** When adding files or directories recursively, filenames that begin
223223
** with "." are excluded by default. To include such files, add
224224
** the "--dotfiles" option to the command-line.
225225
**
226
-** The --ignore and --clean options are comma-separate lists of glob patterns
226
+** The --ignore option is a comma-separate lists of glob patterns
227227
** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
228228
** option does not appear on the command line then the "ignore-glob" setting
229
-** is used. If the --clean option does not appear on the command line then
230
-** the "clean-glob" setting is used.
229
+** is used.
231230
**
232231
** The --case-sensitive option determines whether or not filenames should
233232
** be treated case sensitive or not. If the option is not given, the default
234233
** depends on the global setting, or the operating system default, if not set.
235234
**
@@ -237,32 +236,25 @@
237236
**
238237
** --case-sensitive <BOOL> override case-sensitive setting
239238
** --dotfiles include files beginning with a dot (".")
240239
** --ignore <CSG> ignore files matching patterns from the
241240
** comma separated list of glob patterns.
242
-** --clean <CSG> also ignore files matching patterns from
243
-** the comma separated list of glob patterns.
244241
**
245242
** See also: addremove, rm
246243
*/
247244
void add_cmd(void){
248245
int i; /* Loop counter */
249246
int vid; /* Currently checked out version */
250247
int nRoot; /* Full path characters in g.zLocalRoot */
251
- const char *zCleanFlag; /* The --clean option or clean-glob setting */
252248
const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
253
- Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */
249
+ Glob *pIgnore; /* Ignore everything matching the glob patterns */
254250
unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
255251
256
- zCleanFlag = find_option("clean",0,1);
257252
zIgnoreFlag = find_option("ignore",0,1);
258253
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
259254
capture_case_sensitive_option();
260255
db_must_be_within_tree();
261
- if( zCleanFlag==0 ){
262
- zCleanFlag = db_get("clean-glob", 0);
263
- }
264256
if( zIgnoreFlag==0 ){
265257
zIgnoreFlag = db_get("ignore-glob", 0);
266258
}
267259
vid = db_lget_int("checkout",0);
268260
if( vid==0 ){
@@ -269,11 +261,10 @@
269261
fossil_panic("no checkout to add to");
270262
}
271263
db_begin_transaction();
272264
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
273265
filename_collation());
274
- pClean = glob_create(zCleanFlag);
275266
pIgnore = glob_create(zIgnoreFlag);
276267
nRoot = strlen(g.zLocalRoot);
277268
278269
/* Load the names of all files that are to be added into sfile temp table */
279270
for(i=2; i<g.argc; i++){
@@ -283,11 +274,11 @@
283274
284275
file_canonical_name(g.argv[i], &fullName, 0);
285276
zName = blob_str(&fullName);
286277
isDir = file_wd_isdir(zName);
287278
if( isDir==1 ){
288
- vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
279
+ vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
289280
}else if( isDir==0 ){
290281
fossil_warning("not found: %s", zName);
291282
}else if( file_access(zName, R_OK) ){
292283
fossil_fatal("cannot open %s", zName);
293284
}else{
@@ -298,11 +289,10 @@
298289
);
299290
}
300291
blob_reset(&fullName);
301292
}
302293
glob_free(pIgnore);
303
- glob_free(pClean);
304294
305295
add_files_in_sfile(vid);
306296
db_end_transaction(0);
307297
}
308298
@@ -461,13 +451,12 @@
461451
**
462452
** Files and directories whose names begin with "." are ignored unless
463453
** the --dotfiles option is used.
464454
**
465455
** The --ignore option overrides the "ignore-glob" setting, as do the
466
-** --case-sensitive option with the "case-sensitive" setting and the
467
-** --clean option with the "clean-glob" setting. See the documentation
468
-** on the "settings" command for further information.
456
+** --case-sensitive option with the "case-sensitive" setting. See the
457
+** documentation on the "settings" command for further information.
469458
**
470459
** The -n|--dry-run option shows what would happen without actually doing anything.
471460
**
472461
** This command can be used to track third party software.
473462
**
@@ -474,37 +463,31 @@
474463
** Options:
475464
** --case-sensitive <BOOL> override case-sensitive setting
476465
** --dotfiles include files beginning with a dot (".")
477466
** --ignore <CSG> ignore files matching patterns from the
478467
** comma separated list of glob patterns.
479
-** --clean <CSG> also ignore files matching patterns from
480
-** the comma separated list of glob patterns.
481468
** -n|--dry-run If given, display instead of run actions
482469
**
483470
** See also: add, rm
484471
*/
485472
void addremove_cmd(void){
486473
Blob path;
487
- const char *zCleanFlag = find_option("clean",0,1);
488474
const char *zIgnoreFlag = find_option("ignore",0,1);
489475
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
490476
int dryRunFlag = find_option("dry-run","n",0)!=0;
491477
int n;
492478
Stmt q;
493479
int vid;
494480
int nAdd = 0;
495481
int nDelete = 0;
496
- Glob *pIgnore, *pClean;
482
+ Glob *pIgnore;
497483
498484
if( !dryRunFlag ){
499485
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
500486
}
501487
capture_case_sensitive_option();
502488
db_must_be_within_tree();
503
- if( zCleanFlag==0 ){
504
- zCleanFlag = db_get("clean-glob", 0);
505
- }
506489
if( zIgnoreFlag==0 ){
507490
zIgnoreFlag = db_get("ignore-glob", 0);
508491
}
509492
vid = db_lget_int("checkout",0);
510493
if( vid==0 ){
@@ -521,15 +504,13 @@
521504
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
522505
filename_collation());
523506
n = strlen(g.zLocalRoot);
524507
blob_init(&path, g.zLocalRoot, n-1);
525508
/* now we read the complete file structure into a temp table */
526
- pClean = glob_create(zCleanFlag);
527509
pIgnore = glob_create(zIgnoreFlag);
528
- vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore);
510
+ vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
529511
glob_free(pIgnore);
530
- glob_free(pClean);
531512
nAdd = add_files_in_sfile(vid);
532513
533514
/* step 2: search for missing files */
534515
db_prepare(&q,
535516
"SELECT pathname, %Q || pathname, deleted FROM vfile"
536517
--- src/add.c
+++ src/add.c
@@ -221,15 +221,14 @@
221 **
222 ** When adding files or directories recursively, filenames that begin
223 ** with "." are excluded by default. To include such files, add
224 ** the "--dotfiles" option to the command-line.
225 **
226 ** The --ignore and --clean options are comma-separate lists of glob patterns
227 ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
228 ** option does not appear on the command line then the "ignore-glob" setting
229 ** is used. If the --clean option does not appear on the command line then
230 ** the "clean-glob" setting is used.
231 **
232 ** The --case-sensitive option determines whether or not filenames should
233 ** be treated case sensitive or not. If the option is not given, the default
234 ** depends on the global setting, or the operating system default, if not set.
235 **
@@ -237,32 +236,25 @@
237 **
238 ** --case-sensitive <BOOL> override case-sensitive setting
239 ** --dotfiles include files beginning with a dot (".")
240 ** --ignore <CSG> ignore files matching patterns from the
241 ** comma separated list of glob patterns.
242 ** --clean <CSG> also ignore files matching patterns from
243 ** the comma separated list of glob patterns.
244 **
245 ** See also: addremove, rm
246 */
247 void add_cmd(void){
248 int i; /* Loop counter */
249 int vid; /* Currently checked out version */
250 int nRoot; /* Full path characters in g.zLocalRoot */
251 const char *zCleanFlag; /* The --clean option or clean-glob setting */
252 const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
253 Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */
254 unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
255
256 zCleanFlag = find_option("clean",0,1);
257 zIgnoreFlag = find_option("ignore",0,1);
258 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
259 capture_case_sensitive_option();
260 db_must_be_within_tree();
261 if( zCleanFlag==0 ){
262 zCleanFlag = db_get("clean-glob", 0);
263 }
264 if( zIgnoreFlag==0 ){
265 zIgnoreFlag = db_get("ignore-glob", 0);
266 }
267 vid = db_lget_int("checkout",0);
268 if( vid==0 ){
@@ -269,11 +261,10 @@
269 fossil_panic("no checkout to add to");
270 }
271 db_begin_transaction();
272 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
273 filename_collation());
274 pClean = glob_create(zCleanFlag);
275 pIgnore = glob_create(zIgnoreFlag);
276 nRoot = strlen(g.zLocalRoot);
277
278 /* Load the names of all files that are to be added into sfile temp table */
279 for(i=2; i<g.argc; i++){
@@ -283,11 +274,11 @@
283
284 file_canonical_name(g.argv[i], &fullName, 0);
285 zName = blob_str(&fullName);
286 isDir = file_wd_isdir(zName);
287 if( isDir==1 ){
288 vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
289 }else if( isDir==0 ){
290 fossil_warning("not found: %s", zName);
291 }else if( file_access(zName, R_OK) ){
292 fossil_fatal("cannot open %s", zName);
293 }else{
@@ -298,11 +289,10 @@
298 );
299 }
300 blob_reset(&fullName);
301 }
302 glob_free(pIgnore);
303 glob_free(pClean);
304
305 add_files_in_sfile(vid);
306 db_end_transaction(0);
307 }
308
@@ -461,13 +451,12 @@
461 **
462 ** Files and directories whose names begin with "." are ignored unless
463 ** the --dotfiles option is used.
464 **
465 ** The --ignore option overrides the "ignore-glob" setting, as do the
466 ** --case-sensitive option with the "case-sensitive" setting and the
467 ** --clean option with the "clean-glob" setting. See the documentation
468 ** on the "settings" command for further information.
469 **
470 ** The -n|--dry-run option shows what would happen without actually doing anything.
471 **
472 ** This command can be used to track third party software.
473 **
@@ -474,37 +463,31 @@
474 ** Options:
475 ** --case-sensitive <BOOL> override case-sensitive setting
476 ** --dotfiles include files beginning with a dot (".")
477 ** --ignore <CSG> ignore files matching patterns from the
478 ** comma separated list of glob patterns.
479 ** --clean <CSG> also ignore files matching patterns from
480 ** the comma separated list of glob patterns.
481 ** -n|--dry-run If given, display instead of run actions
482 **
483 ** See also: add, rm
484 */
485 void addremove_cmd(void){
486 Blob path;
487 const char *zCleanFlag = find_option("clean",0,1);
488 const char *zIgnoreFlag = find_option("ignore",0,1);
489 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
490 int dryRunFlag = find_option("dry-run","n",0)!=0;
491 int n;
492 Stmt q;
493 int vid;
494 int nAdd = 0;
495 int nDelete = 0;
496 Glob *pIgnore, *pClean;
497
498 if( !dryRunFlag ){
499 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
500 }
501 capture_case_sensitive_option();
502 db_must_be_within_tree();
503 if( zCleanFlag==0 ){
504 zCleanFlag = db_get("clean-glob", 0);
505 }
506 if( zIgnoreFlag==0 ){
507 zIgnoreFlag = db_get("ignore-glob", 0);
508 }
509 vid = db_lget_int("checkout",0);
510 if( vid==0 ){
@@ -521,15 +504,13 @@
521 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
522 filename_collation());
523 n = strlen(g.zLocalRoot);
524 blob_init(&path, g.zLocalRoot, n-1);
525 /* now we read the complete file structure into a temp table */
526 pClean = glob_create(zCleanFlag);
527 pIgnore = glob_create(zIgnoreFlag);
528 vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore);
529 glob_free(pIgnore);
530 glob_free(pClean);
531 nAdd = add_files_in_sfile(vid);
532
533 /* step 2: search for missing files */
534 db_prepare(&q,
535 "SELECT pathname, %Q || pathname, deleted FROM vfile"
536
--- src/add.c
+++ src/add.c
@@ -221,15 +221,14 @@
221 **
222 ** When adding files or directories recursively, filenames that begin
223 ** with "." are excluded by default. To include such files, add
224 ** the "--dotfiles" option to the command-line.
225 **
226 ** The --ignore option is a comma-separate lists of glob patterns
227 ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore
228 ** option does not appear on the command line then the "ignore-glob" setting
229 ** is used.
 
230 **
231 ** The --case-sensitive option determines whether or not filenames should
232 ** be treated case sensitive or not. If the option is not given, the default
233 ** depends on the global setting, or the operating system default, if not set.
234 **
@@ -237,32 +236,25 @@
236 **
237 ** --case-sensitive <BOOL> override case-sensitive setting
238 ** --dotfiles include files beginning with a dot (".")
239 ** --ignore <CSG> ignore files matching patterns from the
240 ** comma separated list of glob patterns.
 
 
241 **
242 ** See also: addremove, rm
243 */
244 void add_cmd(void){
245 int i; /* Loop counter */
246 int vid; /* Currently checked out version */
247 int nRoot; /* Full path characters in g.zLocalRoot */
 
248 const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */
249 Glob *pIgnore; /* Ignore everything matching the glob patterns */
250 unsigned scanFlags = 0; /* Flags passed to vfile_scan() */
251
 
252 zIgnoreFlag = find_option("ignore",0,1);
253 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
254 capture_case_sensitive_option();
255 db_must_be_within_tree();
 
 
 
256 if( zIgnoreFlag==0 ){
257 zIgnoreFlag = db_get("ignore-glob", 0);
258 }
259 vid = db_lget_int("checkout",0);
260 if( vid==0 ){
@@ -269,11 +261,10 @@
261 fossil_panic("no checkout to add to");
262 }
263 db_begin_transaction();
264 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
265 filename_collation());
 
266 pIgnore = glob_create(zIgnoreFlag);
267 nRoot = strlen(g.zLocalRoot);
268
269 /* Load the names of all files that are to be added into sfile temp table */
270 for(i=2; i<g.argc; i++){
@@ -283,11 +274,11 @@
274
275 file_canonical_name(g.argv[i], &fullName, 0);
276 zName = blob_str(&fullName);
277 isDir = file_wd_isdir(zName);
278 if( isDir==1 ){
279 vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore);
280 }else if( isDir==0 ){
281 fossil_warning("not found: %s", zName);
282 }else if( file_access(zName, R_OK) ){
283 fossil_fatal("cannot open %s", zName);
284 }else{
@@ -298,11 +289,10 @@
289 );
290 }
291 blob_reset(&fullName);
292 }
293 glob_free(pIgnore);
 
294
295 add_files_in_sfile(vid);
296 db_end_transaction(0);
297 }
298
@@ -461,13 +451,12 @@
451 **
452 ** Files and directories whose names begin with "." are ignored unless
453 ** the --dotfiles option is used.
454 **
455 ** The --ignore option overrides the "ignore-glob" setting, as do the
456 ** --case-sensitive option with the "case-sensitive" setting. See the
457 ** documentation on the "settings" command for further information.
 
458 **
459 ** The -n|--dry-run option shows what would happen without actually doing anything.
460 **
461 ** This command can be used to track third party software.
462 **
@@ -474,37 +463,31 @@
463 ** Options:
464 ** --case-sensitive <BOOL> override case-sensitive setting
465 ** --dotfiles include files beginning with a dot (".")
466 ** --ignore <CSG> ignore files matching patterns from the
467 ** comma separated list of glob patterns.
 
 
468 ** -n|--dry-run If given, display instead of run actions
469 **
470 ** See also: add, rm
471 */
472 void addremove_cmd(void){
473 Blob path;
 
474 const char *zIgnoreFlag = find_option("ignore",0,1);
475 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
476 int dryRunFlag = find_option("dry-run","n",0)!=0;
477 int n;
478 Stmt q;
479 int vid;
480 int nAdd = 0;
481 int nDelete = 0;
482 Glob *pIgnore;
483
484 if( !dryRunFlag ){
485 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
486 }
487 capture_case_sensitive_option();
488 db_must_be_within_tree();
 
 
 
489 if( zIgnoreFlag==0 ){
490 zIgnoreFlag = db_get("ignore-glob", 0);
491 }
492 vid = db_lget_int("checkout",0);
493 if( vid==0 ){
@@ -521,15 +504,13 @@
504 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
505 filename_collation());
506 n = strlen(g.zLocalRoot);
507 blob_init(&path, g.zLocalRoot, n-1);
508 /* now we read the complete file structure into a temp table */
 
509 pIgnore = glob_create(zIgnoreFlag);
510 vfile_scan(&path, blob_size(&path), scanFlags, pIgnore);
511 glob_free(pIgnore);
 
512 nAdd = add_files_in_sfile(vid);
513
514 /* step 2: search for missing files */
515 db_prepare(&q,
516 "SELECT pathname, %Q || pathname, deleted FROM vfile"
517
+48 -22
--- src/checkin.c
+++ src/checkin.c
@@ -382,83 +382,104 @@
382382
** Usage: %fossil clean ?OPTIONS?
383383
**
384384
** Delete all "extra" files in the source tree. "Extra" files are
385385
** files that are not officially part of the checkout. This operation
386386
** cannot be undone.
387
+**
388
+** WARNING: Normally, only the files unknown to Fossil are removed;
389
+** however, if the --extreme option is specified, all files that are
390
+** not part of the current checkout will be removed as well, without
391
+** regard for the files which are normally ignored.
387392
**
388393
** You will be prompted before removing each eligible file unless the
389
-** --force flag is in use or it matches the --clean option. The
394
+** --force flag is in use or it matches the --ignore option. The
390395
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
391
-** --ignore option is omitted, the same with "clean-glob" and --clean
392
-** as well as "keep-glob" and --keep. If you are sure you wish to
393
-** remove all "extra" files except the ones specified with --ignore
394
-** and --keep, you can specify the optional -f|--force flag and no
395
-** prompts will be issued. If a file matches both --keep and --clean,
396
-** --keep takes precedence.
396
+** --ignore option is omitted, the same with "keep-glob" and --keep.
397
+** If you are sure you wish to remove all "extra" files except the
398
+** ones specified with --ignore and --keep, you can specify the
399
+** optional -f|--force flag and no prompts will be issued. If a
400
+** file matches both --keep and --ignore, --keep takes precedence.
397401
**
398402
** Files and subdirectories whose names begin with "." are
399403
** normally kept. They are handled if the "--dotfiles" option
400404
** is used.
401405
**
402406
** Options:
403407
** --case-sensitive <BOOL> override case-sensitive setting
404408
** --dotfiles Include files beginning with a dot (".").
405409
** -f|--force Remove files without prompting.
406
-** --clean <CSG> Never prompt for files matching this
407
-** comma separated list of glob patterns.
408410
** --ignore <CSG> Ignore files matching patterns from the
409411
** comma separated list of glob patterns.
410412
** --keep <CSG> Keep files matching this comma separated
411413
** list of glob patterns.
412414
** -n|--dry-run If given, display instead of run actions.
413415
** --temp Remove only Fossil-generated temporary files.
414416
** -v|--verbose Show all files as they are removed.
417
+** -x|--extreme Remove all files not part of the current
418
+** checkout, without taking into consideration
419
+** the "ignore-glob" setting and the --ignore
420
+** command line option.
421
+** Compatibile with "git clean -x".
415422
**
416423
** See also: addremove, extra, status
417424
*/
418425
void clean_cmd(void){
419
- int allFlag, dryRunFlag, verboseFlag;
426
+ int allFlag, dryRunFlag, verboseFlag, extremeFlag;
420427
unsigned scanFlags = 0;
421
- const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
428
+ const char *zIgnoreFlag, *zKeepFlag;
422429
Blob path, repo;
423430
Stmt q;
424431
int n;
425
- Glob *pIgnore, *pKeep, *pClean;
432
+ Glob *pIgnore, *pKeep;
426433
427434
dryRunFlag = find_option("dry-run","n",0)!=0;
428435
if( !dryRunFlag ){
429436
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
430437
}
438
+ extremeFlag = find_option("extreme","x",0)!=0;
431439
allFlag = find_option("force","f",0)!=0;
432440
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
433441
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
434442
zIgnoreFlag = find_option("ignore",0,1);
435443
verboseFlag = find_option("verbose","v",0)!=0;
436444
zKeepFlag = find_option("keep",0,1);
437
- zCleanFlag = find_option("clean",0,1);
438445
capture_case_sensitive_option();
439446
db_must_be_within_tree();
440447
if( zIgnoreFlag==0 ){
441448
zIgnoreFlag = db_get("ignore-glob", 0);
442449
}
443450
if( zKeepFlag==0 ){
444451
zKeepFlag = db_get("keep-glob", 0);
445452
}
446
- if( zCleanFlag==0 ){
447
- zCleanFlag = db_get("clean-glob", 0);
448
- }
449453
verify_all_options();
454
+ if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
455
+ Blob extremeAnswer;
456
+ char *extremePrompt =
457
+ "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
458
+ "that would otherwise be left alone will be deleted (i.e. those\n"
459
+ "matching the \"ignore-glob\" settings and the --ignore command\n"
460
+ "line option). As a precaution, in order to proceed with this\n"
461
+ "clean operation, the string \"YES\" must be entered in all upper\n"
462
+ "case; any other response will cancel the clean operation.\n\n"
463
+ "Do you still wish to proceed with the clean operation? ";
464
+ blob_zero(&extremeAnswer);
465
+ prompt_user(extremePrompt, &extremeAnswer);
466
+ if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
467
+ fossil_print("Extreme clean operation canceled.\n");
468
+ blob_reset(&extremeAnswer);
469
+ return;
470
+ }
471
+ blob_reset(&extremeAnswer);
472
+ }
450473
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
451474
filename_collation());
452475
n = strlen(g.zLocalRoot);
453476
blob_init(&path, g.zLocalRoot, n-1);
454477
pIgnore = glob_create(zIgnoreFlag);
455478
pKeep = glob_create(zKeepFlag);
456
- pClean = glob_create(zCleanFlag);
457
- vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep);
458
- glob_free(pKeep);
459
- glob_free(pIgnore);
479
+ vfile_scan(&path, blob_size(&path), scanFlags,
480
+ extremeFlag ? 0 : pIgnore);
460481
db_prepare(&q,
461482
"SELECT %Q || x FROM sfile"
462483
" WHERE x NOT IN (%s)"
463484
" ORDER BY 1",
464485
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -467,11 +488,15 @@
467488
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
468489
}
469490
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
470491
while( db_step(&q)==SQLITE_ROW ){
471492
const char *zName = db_column_text(&q, 0);
472
- if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){
493
+ if( glob_match(pKeep, zName+n) ){
494
+ fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+n);
495
+ continue;
496
+ }
497
+ if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){
473498
Blob ans;
474499
char cReply;
475500
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
476501
zName+n);
477502
blob_zero(&ans);
@@ -490,11 +515,12 @@
490515
}
491516
if( !dryRunFlag ){
492517
file_delete(zName);
493518
}
494519
}
495
- glob_free(pClean);
520
+ glob_free(pKeep);
521
+ glob_free(pIgnore);
496522
db_finalize(&q);
497523
}
498524
499525
/*
500526
** Prompt the user for a check-in or stash comment (given in pPrompt),
501527
--- src/checkin.c
+++ src/checkin.c
@@ -382,83 +382,104 @@
382 ** Usage: %fossil clean ?OPTIONS?
383 **
384 ** Delete all "extra" files in the source tree. "Extra" files are
385 ** files that are not officially part of the checkout. This operation
386 ** cannot be undone.
 
 
 
 
 
387 **
388 ** You will be prompted before removing each eligible file unless the
389 ** --force flag is in use or it matches the --clean option. The
390 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
391 ** --ignore option is omitted, the same with "clean-glob" and --clean
392 ** as well as "keep-glob" and --keep. If you are sure you wish to
393 ** remove all "extra" files except the ones specified with --ignore
394 ** and --keep, you can specify the optional -f|--force flag and no
395 ** prompts will be issued. If a file matches both --keep and --clean,
396 ** --keep takes precedence.
397 **
398 ** Files and subdirectories whose names begin with "." are
399 ** normally kept. They are handled if the "--dotfiles" option
400 ** is used.
401 **
402 ** Options:
403 ** --case-sensitive <BOOL> override case-sensitive setting
404 ** --dotfiles Include files beginning with a dot (".").
405 ** -f|--force Remove files without prompting.
406 ** --clean <CSG> Never prompt for files matching this
407 ** comma separated list of glob patterns.
408 ** --ignore <CSG> Ignore files matching patterns from the
409 ** comma separated list of glob patterns.
410 ** --keep <CSG> Keep files matching this comma separated
411 ** list of glob patterns.
412 ** -n|--dry-run If given, display instead of run actions.
413 ** --temp Remove only Fossil-generated temporary files.
414 ** -v|--verbose Show all files as they are removed.
 
 
 
 
 
415 **
416 ** See also: addremove, extra, status
417 */
418 void clean_cmd(void){
419 int allFlag, dryRunFlag, verboseFlag;
420 unsigned scanFlags = 0;
421 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
422 Blob path, repo;
423 Stmt q;
424 int n;
425 Glob *pIgnore, *pKeep, *pClean;
426
427 dryRunFlag = find_option("dry-run","n",0)!=0;
428 if( !dryRunFlag ){
429 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
430 }
 
431 allFlag = find_option("force","f",0)!=0;
432 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
433 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
434 zIgnoreFlag = find_option("ignore",0,1);
435 verboseFlag = find_option("verbose","v",0)!=0;
436 zKeepFlag = find_option("keep",0,1);
437 zCleanFlag = find_option("clean",0,1);
438 capture_case_sensitive_option();
439 db_must_be_within_tree();
440 if( zIgnoreFlag==0 ){
441 zIgnoreFlag = db_get("ignore-glob", 0);
442 }
443 if( zKeepFlag==0 ){
444 zKeepFlag = db_get("keep-glob", 0);
445 }
446 if( zCleanFlag==0 ){
447 zCleanFlag = db_get("clean-glob", 0);
448 }
449 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
451 filename_collation());
452 n = strlen(g.zLocalRoot);
453 blob_init(&path, g.zLocalRoot, n-1);
454 pIgnore = glob_create(zIgnoreFlag);
455 pKeep = glob_create(zKeepFlag);
456 pClean = glob_create(zCleanFlag);
457 vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep);
458 glob_free(pKeep);
459 glob_free(pIgnore);
460 db_prepare(&q,
461 "SELECT %Q || x FROM sfile"
462 " WHERE x NOT IN (%s)"
463 " ORDER BY 1",
464 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -467,11 +488,15 @@
467 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
468 }
469 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
470 while( db_step(&q)==SQLITE_ROW ){
471 const char *zName = db_column_text(&q, 0);
472 if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){
 
 
 
 
473 Blob ans;
474 char cReply;
475 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
476 zName+n);
477 blob_zero(&ans);
@@ -490,11 +515,12 @@
490 }
491 if( !dryRunFlag ){
492 file_delete(zName);
493 }
494 }
495 glob_free(pClean);
 
496 db_finalize(&q);
497 }
498
499 /*
500 ** Prompt the user for a check-in or stash comment (given in pPrompt),
501
--- src/checkin.c
+++ src/checkin.c
@@ -382,83 +382,104 @@
382 ** Usage: %fossil clean ?OPTIONS?
383 **
384 ** Delete all "extra" files in the source tree. "Extra" files are
385 ** files that are not officially part of the checkout. This operation
386 ** cannot be undone.
387 **
388 ** WARNING: Normally, only the files unknown to Fossil are removed;
389 ** however, if the --extreme option is specified, all files that are
390 ** not part of the current checkout will be removed as well, without
391 ** regard for the files which are normally ignored.
392 **
393 ** You will be prompted before removing each eligible file unless the
394 ** --force flag is in use or it matches the --ignore option. The
395 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
396 ** --ignore option is omitted, the same with "keep-glob" and --keep.
397 ** If you are sure you wish to remove all "extra" files except the
398 ** ones specified with --ignore and --keep, you can specify the
399 ** optional -f|--force flag and no prompts will be issued. If a
400 ** file matches both --keep and --ignore, --keep takes precedence.
 
401 **
402 ** Files and subdirectories whose names begin with "." are
403 ** normally kept. They are handled if the "--dotfiles" option
404 ** is used.
405 **
406 ** Options:
407 ** --case-sensitive <BOOL> override case-sensitive setting
408 ** --dotfiles Include files beginning with a dot (".").
409 ** -f|--force Remove files without prompting.
 
 
410 ** --ignore <CSG> Ignore files matching patterns from the
411 ** comma separated list of glob patterns.
412 ** --keep <CSG> Keep files matching this comma separated
413 ** list of glob patterns.
414 ** -n|--dry-run If given, display instead of run actions.
415 ** --temp Remove only Fossil-generated temporary files.
416 ** -v|--verbose Show all files as they are removed.
417 ** -x|--extreme Remove all files not part of the current
418 ** checkout, without taking into consideration
419 ** the "ignore-glob" setting and the --ignore
420 ** command line option.
421 ** Compatibile with "git clean -x".
422 **
423 ** See also: addremove, extra, status
424 */
425 void clean_cmd(void){
426 int allFlag, dryRunFlag, verboseFlag, extremeFlag;
427 unsigned scanFlags = 0;
428 const char *zIgnoreFlag, *zKeepFlag;
429 Blob path, repo;
430 Stmt q;
431 int n;
432 Glob *pIgnore, *pKeep;
433
434 dryRunFlag = find_option("dry-run","n",0)!=0;
435 if( !dryRunFlag ){
436 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
437 }
438 extremeFlag = find_option("extreme","x",0)!=0;
439 allFlag = find_option("force","f",0)!=0;
440 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
441 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
442 zIgnoreFlag = find_option("ignore",0,1);
443 verboseFlag = find_option("verbose","v",0)!=0;
444 zKeepFlag = find_option("keep",0,1);
 
445 capture_case_sensitive_option();
446 db_must_be_within_tree();
447 if( zIgnoreFlag==0 ){
448 zIgnoreFlag = db_get("ignore-glob", 0);
449 }
450 if( zKeepFlag==0 ){
451 zKeepFlag = db_get("keep-glob", 0);
452 }
 
 
 
453 verify_all_options();
454 if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
455 Blob extremeAnswer;
456 char *extremePrompt =
457 "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
458 "that would otherwise be left alone will be deleted (i.e. those\n"
459 "matching the \"ignore-glob\" settings and the --ignore command\n"
460 "line option). As a precaution, in order to proceed with this\n"
461 "clean operation, the string \"YES\" must be entered in all upper\n"
462 "case; any other response will cancel the clean operation.\n\n"
463 "Do you still wish to proceed with the clean operation? ";
464 blob_zero(&extremeAnswer);
465 prompt_user(extremePrompt, &extremeAnswer);
466 if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
467 fossil_print("Extreme clean operation canceled.\n");
468 blob_reset(&extremeAnswer);
469 return;
470 }
471 blob_reset(&extremeAnswer);
472 }
473 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
474 filename_collation());
475 n = strlen(g.zLocalRoot);
476 blob_init(&path, g.zLocalRoot, n-1);
477 pIgnore = glob_create(zIgnoreFlag);
478 pKeep = glob_create(zKeepFlag);
479 vfile_scan(&path, blob_size(&path), scanFlags,
480 extremeFlag ? 0 : pIgnore);
 
 
481 db_prepare(&q,
482 "SELECT %Q || x FROM sfile"
483 " WHERE x NOT IN (%s)"
484 " ORDER BY 1",
485 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -467,11 +488,15 @@
488 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
489 }
490 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
491 while( db_step(&q)==SQLITE_ROW ){
492 const char *zName = db_column_text(&q, 0);
493 if( glob_match(pKeep, zName+n) ){
494 fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+n);
495 continue;
496 }
497 if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){
498 Blob ans;
499 char cReply;
500 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
501 zName+n);
502 blob_zero(&ans);
@@ -490,11 +515,12 @@
515 }
516 if( !dryRunFlag ){
517 file_delete(zName);
518 }
519 }
520 glob_free(pKeep);
521 glob_free(pIgnore);
522 db_finalize(&q);
523 }
524
525 /*
526 ** Prompt the user for a check-in or stash comment (given in pPrompt),
527
--- src/configure.c
+++ src/configure.c
@@ -101,11 +101,10 @@
101101
102102
{ "project-name", CONFIGSET_PROJ },
103103
{ "project-description", CONFIGSET_PROJ },
104104
{ "manifest", CONFIGSET_PROJ },
105105
{ "binary-glob", CONFIGSET_PROJ },
106
- { "clean-glob", CONFIGSET_PROJ },
107106
{ "ignore-glob", CONFIGSET_PROJ },
108107
{ "keep-glob", CONFIGSET_PROJ },
109108
{ "crnl-glob", CONFIGSET_PROJ },
110109
{ "encoding-glob", CONFIGSET_PROJ },
111110
{ "empty-dirs", CONFIGSET_PROJ },
112111
--- src/configure.c
+++ src/configure.c
@@ -101,11 +101,10 @@
101
102 { "project-name", CONFIGSET_PROJ },
103 { "project-description", CONFIGSET_PROJ },
104 { "manifest", CONFIGSET_PROJ },
105 { "binary-glob", CONFIGSET_PROJ },
106 { "clean-glob", CONFIGSET_PROJ },
107 { "ignore-glob", CONFIGSET_PROJ },
108 { "keep-glob", CONFIGSET_PROJ },
109 { "crnl-glob", CONFIGSET_PROJ },
110 { "encoding-glob", CONFIGSET_PROJ },
111 { "empty-dirs", CONFIGSET_PROJ },
112
--- src/configure.c
+++ src/configure.c
@@ -101,11 +101,10 @@
101
102 { "project-name", CONFIGSET_PROJ },
103 { "project-description", CONFIGSET_PROJ },
104 { "manifest", CONFIGSET_PROJ },
105 { "binary-glob", CONFIGSET_PROJ },
 
106 { "ignore-glob", CONFIGSET_PROJ },
107 { "keep-glob", CONFIGSET_PROJ },
108 { "crnl-glob", CONFIGSET_PROJ },
109 { "encoding-glob", CONFIGSET_PROJ },
110 { "empty-dirs", CONFIGSET_PROJ },
111
+7 -8
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
20852085
char const *def; /* Default value */
20862086
};
20872087
#endif /* INTERFACE */
20882088
struct stControlSettings const ctrlSettings[] = {
20892089
{ "access-log", 0, 0, 0, "off" },
2090
+ { "allow-clean-x", 0, 0, 0, "off" },
20902091
{ "allow-symlinks",0, 0, 1, "off" },
20912092
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
20922093
{ "auto-hyperlink",0, 0, 0, "on", },
20932094
{ "auto-shun", 0, 0, 0, "on" },
20942095
{ "autosync", 0, 0, 0, "on" },
@@ -2097,11 +2098,10 @@
20972098
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
20982099
{ "case-sensitive",0, 0, 0, "off" },
20992100
#else
21002101
{ "case-sensitive",0, 0, 0, "on" },
21012102
#endif
2102
- { "clean-glob", 0, 40, 1, "" },
21032103
{ "crnl-glob", 0, 40, 1, "" },
21042104
{ "default-perms", 0, 16, 0, "u" },
21052105
{ "diff-binary", 0, 0, 0, "on" },
21062106
{ "diff-command", 0, 40, 0, "" },
21072107
{ "dont-push", 0, 0, 0, "off" },
@@ -2161,10 +2161,14 @@
21612161
** allow-symlinks If enabled, don't follow symlinks, and instead treat
21622162
** (versionable) them as symlinks on Unix. Has no effect on Windows
21632163
** (existing links in repository created on Unix become
21642164
** plain-text files with link destination path inside).
21652165
** Default: off
2166
+**
2167
+** allow-clean-x If enabled, allow the --extreme option to be used in
2168
+** the clean command.
2169
+** Default: off
21662170
**
21672171
** auto-captcha If enabled, the Login page provides a button to
21682172
** fill in the captcha password. Default: on
21692173
**
21702174
** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2189,15 +2193,10 @@
21892193
** case-sensitive If TRUE, the files whose names differ only in case
21902194
** care considered distinct. If FALSE files whose names
21912195
** differ only in case are the same file. Defaults to
21922196
** TRUE for unix and FALSE for Cygwin, Mac and Windows.
21932197
**
2194
-** clean-glob The VALUE is a comma or newline-separated list of GLOB
2195
-** (versionable) patterns specifying files that the "clean" command will
2196
-** delete without prompting even when the -force flag has
2197
-** not been used. Example: *.a *.lib *.o
2198
-**
21992198
** clearsign When enabled, fossil will attempt to sign all commits
22002199
** with gpg. When disabled (the default), commits will
22012200
** be unsigned. Default: off
22022201
**
22032202
** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2247,15 +2246,15 @@
22472246
** even if the login page request came via HTTP.
22482247
**
22492248
** ignore-glob The VALUE is a comma or newline-separated list of GLOB
22502249
** (versionable) patterns specifying files that the "add", "addremove",
22512250
** "clean", and "extra" commands will ignore.
2252
-** Example: *.log customCode.c notes.txt
2251
+** Example: *.log *.a *.lib *.o
22532252
**
22542253
** keep-glob The VALUE is a comma or newline-separated list of GLOB
22552254
** (versionable) patterns specifying files that the "clean" command will
2256
-** keep.
2255
+** keep. Example: *.log customCode.c notes.txt
22572256
**
22582257
** localauth If enabled, require that HTTP connections from
22592258
** 127.0.0.1 be authenticated by password. If
22602259
** false, all HTTP requests from localhost have
22612260
** unrestricted access to the repository.
22622261
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
2085 char const *def; /* Default value */
2086 };
2087 #endif /* INTERFACE */
2088 struct stControlSettings const ctrlSettings[] = {
2089 { "access-log", 0, 0, 0, "off" },
 
2090 { "allow-symlinks",0, 0, 1, "off" },
2091 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2092 { "auto-hyperlink",0, 0, 0, "on", },
2093 { "auto-shun", 0, 0, 0, "on" },
2094 { "autosync", 0, 0, 0, "on" },
@@ -2097,11 +2098,10 @@
2097 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2098 { "case-sensitive",0, 0, 0, "off" },
2099 #else
2100 { "case-sensitive",0, 0, 0, "on" },
2101 #endif
2102 { "clean-glob", 0, 40, 1, "" },
2103 { "crnl-glob", 0, 40, 1, "" },
2104 { "default-perms", 0, 16, 0, "u" },
2105 { "diff-binary", 0, 0, 0, "on" },
2106 { "diff-command", 0, 40, 0, "" },
2107 { "dont-push", 0, 0, 0, "off" },
@@ -2161,10 +2161,14 @@
2161 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2162 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2163 ** (existing links in repository created on Unix become
2164 ** plain-text files with link destination path inside).
2165 ** Default: off
 
 
 
 
2166 **
2167 ** auto-captcha If enabled, the Login page provides a button to
2168 ** fill in the captcha password. Default: on
2169 **
2170 ** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2189,15 +2193,10 @@
2189 ** case-sensitive If TRUE, the files whose names differ only in case
2190 ** care considered distinct. If FALSE files whose names
2191 ** differ only in case are the same file. Defaults to
2192 ** TRUE for unix and FALSE for Cygwin, Mac and Windows.
2193 **
2194 ** clean-glob The VALUE is a comma or newline-separated list of GLOB
2195 ** (versionable) patterns specifying files that the "clean" command will
2196 ** delete without prompting even when the -force flag has
2197 ** not been used. Example: *.a *.lib *.o
2198 **
2199 ** clearsign When enabled, fossil will attempt to sign all commits
2200 ** with gpg. When disabled (the default), commits will
2201 ** be unsigned. Default: off
2202 **
2203 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2247,15 +2246,15 @@
2247 ** even if the login page request came via HTTP.
2248 **
2249 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2250 ** (versionable) patterns specifying files that the "add", "addremove",
2251 ** "clean", and "extra" commands will ignore.
2252 ** Example: *.log customCode.c notes.txt
2253 **
2254 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2255 ** (versionable) patterns specifying files that the "clean" command will
2256 ** keep.
2257 **
2258 ** localauth If enabled, require that HTTP connections from
2259 ** 127.0.0.1 be authenticated by password. If
2260 ** false, all HTTP requests from localhost have
2261 ** unrestricted access to the repository.
2262
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
2085 char const *def; /* Default value */
2086 };
2087 #endif /* INTERFACE */
2088 struct stControlSettings const ctrlSettings[] = {
2089 { "access-log", 0, 0, 0, "off" },
2090 { "allow-clean-x", 0, 0, 0, "off" },
2091 { "allow-symlinks",0, 0, 1, "off" },
2092 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2093 { "auto-hyperlink",0, 0, 0, "on", },
2094 { "auto-shun", 0, 0, 0, "on" },
2095 { "autosync", 0, 0, 0, "on" },
@@ -2097,11 +2098,10 @@
2098 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2099 { "case-sensitive",0, 0, 0, "off" },
2100 #else
2101 { "case-sensitive",0, 0, 0, "on" },
2102 #endif
 
2103 { "crnl-glob", 0, 40, 1, "" },
2104 { "default-perms", 0, 16, 0, "u" },
2105 { "diff-binary", 0, 0, 0, "on" },
2106 { "diff-command", 0, 40, 0, "" },
2107 { "dont-push", 0, 0, 0, "off" },
@@ -2161,10 +2161,14 @@
2161 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2162 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2163 ** (existing links in repository created on Unix become
2164 ** plain-text files with link destination path inside).
2165 ** Default: off
2166 **
2167 ** allow-clean-x If enabled, allow the --extreme option to be used in
2168 ** the clean command.
2169 ** Default: off
2170 **
2171 ** auto-captcha If enabled, the Login page provides a button to
2172 ** fill in the captcha password. Default: on
2173 **
2174 ** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2189,15 +2193,10 @@
2193 ** case-sensitive If TRUE, the files whose names differ only in case
2194 ** care considered distinct. If FALSE files whose names
2195 ** differ only in case are the same file. Defaults to
2196 ** TRUE for unix and FALSE for Cygwin, Mac and Windows.
2197 **
 
 
 
 
 
2198 ** clearsign When enabled, fossil will attempt to sign all commits
2199 ** with gpg. When disabled (the default), commits will
2200 ** be unsigned. Default: off
2201 **
2202 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2247,15 +2246,15 @@
2246 ** even if the login page request came via HTTP.
2247 **
2248 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2249 ** (versionable) patterns specifying files that the "add", "addremove",
2250 ** "clean", and "extra" commands will ignore.
2251 ** Example: *.log *.a *.lib *.o
2252 **
2253 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2254 ** (versionable) patterns specifying files that the "clean" command will
2255 ** keep. Example: *.log customCode.c notes.txt
2256 **
2257 ** localauth If enabled, require that HTTP connections from
2258 ** 127.0.0.1 be authenticated by password. If
2259 ** false, all HTTP requests from localhost have
2260 ** unrestricted access to the repository.
2261
--- src/json_config.c
+++ src/json_config.c
@@ -64,11 +64,10 @@
6464
6565
{ "project-name", CONFIGSET_PROJ },
6666
{ "project-description", CONFIGSET_PROJ },
6767
{ "manifest", CONFIGSET_PROJ },
6868
{ "binary-glob", CONFIGSET_PROJ },
69
-{ "clean-glob", CONFIGSET_PROJ },
7069
{ "encoding-glob", CONFIGSET_PROJ },
7170
{ "ignore-glob", CONFIGSET_PROJ },
7271
{ "keep-glob", CONFIGSET_PROJ },
7372
{ "crnl-glob", CONFIGSET_PROJ },
7473
{ "empty-dirs", CONFIGSET_PROJ },
7574
--- src/json_config.c
+++ src/json_config.c
@@ -64,11 +64,10 @@
64
65 { "project-name", CONFIGSET_PROJ },
66 { "project-description", CONFIGSET_PROJ },
67 { "manifest", CONFIGSET_PROJ },
68 { "binary-glob", CONFIGSET_PROJ },
69 { "clean-glob", CONFIGSET_PROJ },
70 { "encoding-glob", CONFIGSET_PROJ },
71 { "ignore-glob", CONFIGSET_PROJ },
72 { "keep-glob", CONFIGSET_PROJ },
73 { "crnl-glob", CONFIGSET_PROJ },
74 { "empty-dirs", CONFIGSET_PROJ },
75
--- src/json_config.c
+++ src/json_config.c
@@ -64,11 +64,10 @@
64
65 { "project-name", CONFIGSET_PROJ },
66 { "project-description", CONFIGSET_PROJ },
67 { "manifest", CONFIGSET_PROJ },
68 { "binary-glob", CONFIGSET_PROJ },
 
69 { "encoding-glob", CONFIGSET_PROJ },
70 { "ignore-glob", CONFIGSET_PROJ },
71 { "keep-glob", CONFIGSET_PROJ },
72 { "crnl-glob", CONFIGSET_PROJ },
73 { "empty-dirs", CONFIGSET_PROJ },
74
+4 -16
--- src/vfile.c
+++ src/vfile.c
@@ -433,20 +433,10 @@
433433
** Any files or directories that match the glob pattern pIgnore are
434434
** excluded from the scan. Name matching occurs after the first
435435
** nPrefix characters are elided from the filename.
436436
*/
437437
void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
438
- vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0);
439
-}
440
-
441
-void vfile_scan2(
442
- Blob *pPath,
443
- int nPrefix,
444
- unsigned scanFlags,
445
- Glob *pIgnore1,
446
- Glob *pIgnore2
447
-){
448438
DIR *d;
449439
int origSize;
450440
const char *zDir;
451441
struct dirent *pEntry;
452442
int skipAll = 0;
@@ -453,14 +443,13 @@
453443
static Stmt ins;
454444
static int depth = 0;
455445
void *zNative;
456446
457447
origSize = blob_size(pPath);
458
- if( pIgnore1 || pIgnore2 ){
448
+ if( pIgnore ){
459449
blob_appendf(pPath, "/");
460
- if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
461
- if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
450
+ if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
462451
blob_resize(pPath, origSize);
463452
}
464453
if( skipAll ) return;
465454
466455
if( depth==0 ){
@@ -485,16 +474,15 @@
485474
if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
486475
}
487476
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
488477
blob_appendf(pPath, "/%s", zUtf8);
489478
zPath = blob_str(pPath);
490
- if( glob_match(pIgnore1, &zPath[nPrefix+1]) ||
491
- glob_match(pIgnore2, &zPath[nPrefix+1]) ){
479
+ if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
492480
/* do nothing */
493481
}else if( file_wd_isdir(zPath)==1 ){
494482
if( !vfile_top_of_checkout(zPath) ){
495
- vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2);
483
+ vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
496484
}
497485
}else if( file_wd_isfile_or_link(zPath) ){
498486
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
499487
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
500488
db_step(&ins);
501489
--- src/vfile.c
+++ src/vfile.c
@@ -433,20 +433,10 @@
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
438 vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0);
439 }
440
441 void vfile_scan2(
442 Blob *pPath,
443 int nPrefix,
444 unsigned scanFlags,
445 Glob *pIgnore1,
446 Glob *pIgnore2
447 ){
448 DIR *d;
449 int origSize;
450 const char *zDir;
451 struct dirent *pEntry;
452 int skipAll = 0;
@@ -453,14 +443,13 @@
453 static Stmt ins;
454 static int depth = 0;
455 void *zNative;
456
457 origSize = blob_size(pPath);
458 if( pIgnore1 || pIgnore2 ){
459 blob_appendf(pPath, "/");
460 if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
461 if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
462 blob_resize(pPath, origSize);
463 }
464 if( skipAll ) return;
465
466 if( depth==0 ){
@@ -485,16 +474,15 @@
485 if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
486 }
487 zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
488 blob_appendf(pPath, "/%s", zUtf8);
489 zPath = blob_str(pPath);
490 if( glob_match(pIgnore1, &zPath[nPrefix+1]) ||
491 glob_match(pIgnore2, &zPath[nPrefix+1]) ){
492 /* do nothing */
493 }else if( file_wd_isdir(zPath)==1 ){
494 if( !vfile_top_of_checkout(zPath) ){
495 vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2);
496 }
497 }else if( file_wd_isfile_or_link(zPath) ){
498 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
499 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
500 db_step(&ins);
501
--- src/vfile.c
+++ src/vfile.c
@@ -433,20 +433,10 @@
433 ** Any files or directories that match the glob pattern pIgnore are
434 ** excluded from the scan. Name matching occurs after the first
435 ** nPrefix characters are elided from the filename.
436 */
437 void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){
 
 
 
 
 
 
 
 
 
 
438 DIR *d;
439 int origSize;
440 const char *zDir;
441 struct dirent *pEntry;
442 int skipAll = 0;
@@ -453,14 +443,13 @@
443 static Stmt ins;
444 static int depth = 0;
445 void *zNative;
446
447 origSize = blob_size(pPath);
448 if( pIgnore ){
449 blob_appendf(pPath, "/");
450 if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
 
451 blob_resize(pPath, origSize);
452 }
453 if( skipAll ) return;
454
455 if( depth==0 ){
@@ -485,16 +474,15 @@
474 if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
475 }
476 zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
477 blob_appendf(pPath, "/%s", zUtf8);
478 zPath = blob_str(pPath);
479 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
 
480 /* do nothing */
481 }else if( file_wd_isdir(zPath)==1 ){
482 if( !vfile_top_of_checkout(zPath) ){
483 vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
484 }
485 }else if( file_wd_isfile_or_link(zPath) ){
486 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
487 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
488 db_step(&ins);
489

Keyboard Shortcuts

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