Fossil SCM

rebase

jan.nijtmans 2013-07-21 16:29 trunk merge
Commit 54aef599168d3e129ff146714227c0fc936eacff
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*
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
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
1 compat/openssl*
2 compat/tcl*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3 fossil
4 fossil.exe
5
--- .fossil-settings/ignore-glob
+++ .fossil-settings/ignore-glob
@@ -1,4 +1,21 @@
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
+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_scan(&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_scan(&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_scan(&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_scan(&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
+52 -28
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355355
*/
356356
static void locate_unmanaged_files(
357357
int argc, /* Number of command-line arguments to examine */
358358
char **argv, /* values of command-line arguments */
359359
unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360
- Glob *pIgnore1, /* Do not add files that match this GLOB */
361
- Glob *pIgnore2 /* Omit files matching this GLOB too */
360
+ Glob *pIgnore /* Do not add files that match this GLOB */
362361
){
363362
Blob name; /* Name of a candidate file or directory */
364363
char *zName; /* Name of a candidate file or directory */
365364
int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
366365
int i; /* Loop counter */
@@ -369,19 +368,19 @@
369368
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
370369
filename_collation());
371370
nRoot = (int)strlen(g.zLocalRoot);
372371
if( argc==0 ){
373372
blob_init(&name, g.zLocalRoot, nRoot - 1);
374
- vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
373
+ vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
375374
blob_reset(&name);
376375
}else{
377376
for(i=0; i<argc; i++){
378377
file_canonical_name(argv[i], &name, 0);
379378
zName = blob_str(&name);
380379
isDir = file_wd_isdir(zName);
381380
if( isDir==1 ){
382
- vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
381
+ vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
383382
}else if( isDir==0 ){
384383
fossil_warning("not found: %s", &zName[nRoot]);
385384
}else if( file_access(zName, R_OK) ){
386385
fossil_fatal("cannot open %s", &zName[nRoot]);
387386
}else{
@@ -438,11 +437,11 @@
438437
cwdRelative = determine_cwd_relative_option();
439438
if( zIgnoreFlag==0 ){
440439
zIgnoreFlag = db_get("ignore-glob", 0);
441440
}
442441
pIgnore = glob_create(zIgnoreFlag);
443
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
442
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
444443
glob_free(pIgnore);
445444
db_prepare(&q,
446445
"SELECT x FROM sfile"
447446
" WHERE x NOT IN (%s)"
448447
" ORDER BY 1",
@@ -473,79 +472,100 @@
473472
**
474473
** Delete all "extra" files in the source tree. "Extra" files are
475474
** files that are not officially part of the checkout. This operation
476475
** cannot be undone. If paths are specified, only the directories or
477476
** files specified will be considered for cleaning.
477
+**
478
+** WARNING: Normally, only the files unknown to Fossil are removed;
479
+** however, if the --extreme option is specified, all files that are
480
+** not part of the current checkout will be removed as well, without
481
+** regard for the files which are normally ignored.
478482
**
479483
** You will be prompted before removing each eligible file unless the
480
-** --force flag is in use or it matches the --clean option. The
484
+** --force flag is in use or it matches the --ignore option. The
481485
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
482
-** --ignore option is omitted, the same with "clean-glob" and --clean
483
-** as well as "keep-glob" and --keep. If you are sure you wish to
484
-** remove all "extra" files except the ones specified with --ignore
485
-** and --keep, you can specify the optional -f|--force flag and no
486
-** prompts will be issued. If a file matches both --keep and --clean,
487
-** --keep takes precedence.
486
+** --ignore option is omitted, the same with "keep-glob" and --keep.
487
+** If you are sure you wish to remove all "extra" files except the
488
+** ones specified with --ignore and --keep, you can specify the
489
+** optional -f|--force flag and no prompts will be issued. If a
490
+** file matches both --keep and --ignore, --keep takes precedence.
488491
**
489492
** Files and subdirectories whose names begin with "." are
490493
** normally kept. They are handled if the "--dotfiles" option
491494
** is used.
492495
**
493496
** Options:
494497
** --case-sensitive <BOOL> override case-sensitive setting
495498
** --dotfiles Include files beginning with a dot (".").
496499
** -f|--force Remove files without prompting.
497
-** --clean <CSG> Never prompt for files matching this
498
-** comma separated list of glob patterns.
499500
** --ignore <CSG> Ignore files matching patterns from the
500501
** comma separated list of glob patterns.
501502
** --keep <CSG> Keep files matching this comma separated
502503
** list of glob patterns.
503504
** -n|--dry-run If given, display instead of run actions.
504505
** --temp Remove only Fossil-generated temporary files.
505506
** -v|--verbose Show all files as they are removed.
507
+** -x|--extreme Remove all files not part of the current
508
+** checkout, without taking into consideration
509
+** the "ignore-glob" setting and the --ignore
510
+** command line option.
511
+** Compatibile with "git clean -x".
506512
**
507513
** See also: addremove, extra, status
508514
*/
509515
void clean_cmd(void){
510
- int allFlag, dryRunFlag, verboseFlag;
516
+ int allFlag, dryRunFlag, verboseFlag, extremeFlag;
511517
unsigned scanFlags = 0;
512
- const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
518
+ const char *zIgnoreFlag, *zKeepFlag;
513519
Blob repo;
514520
Stmt q;
515
- Glob *pIgnore, *pKeep, *pClean;
521
+ Glob *pIgnore, *pKeep;
516522
int nRoot;
517523
518524
dryRunFlag = find_option("dry-run","n",0)!=0;
519525
if( !dryRunFlag ){
520526
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
521527
}
528
+ extremeFlag = find_option("extreme","x",0)!=0;
522529
allFlag = find_option("force","f",0)!=0;
523530
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
524531
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
525532
zIgnoreFlag = find_option("ignore",0,1);
526533
verboseFlag = find_option("verbose","v",0)!=0;
527534
zKeepFlag = find_option("keep",0,1);
528
- zCleanFlag = find_option("clean",0,1);
529535
capture_case_sensitive_option();
530536
db_must_be_within_tree();
531537
if( zIgnoreFlag==0 ){
532538
zIgnoreFlag = db_get("ignore-glob", 0);
533539
}
534540
if( zKeepFlag==0 ){
535541
zKeepFlag = db_get("keep-glob", 0);
536542
}
537
- if( zCleanFlag==0 ){
538
- zCleanFlag = db_get("clean-glob", 0);
539
- }
540543
verify_all_options();
544
+ if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
545
+ Blob extremeAnswer;
546
+ char *extremePrompt =
547
+ "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
548
+ "that would otherwise be left alone will be deleted (i.e. those\n"
549
+ "matching the \"ignore-glob\" settings and the --ignore command\n"
550
+ "line option). As a precaution, in order to proceed with this\n"
551
+ "clean operation, the string \"YES\" must be entered in all upper\n"
552
+ "case; any other response will cancel the clean operation.\n\n"
553
+ "Do you still wish to proceed with the clean operation? ";
554
+ blob_zero(&extremeAnswer);
555
+ prompt_user(extremePrompt, &extremeAnswer);
556
+ if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
557
+ fossil_print("Extreme clean operation canceled.\n");
558
+ blob_reset(&extremeAnswer);
559
+ return;
560
+ }
561
+ blob_reset(&extremeAnswer);
562
+ }
563
+ nRoot = (int)strlen(g.zLocalRoot);
541564
pIgnore = glob_create(zIgnoreFlag);
542565
pKeep = glob_create(zKeepFlag);
543
- pClean = glob_create(zCleanFlag);
544
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
545
- glob_free(pKeep);
546
- glob_free(pIgnore);
566
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
547567
db_prepare(&q,
548568
"SELECT %Q || x FROM sfile"
549569
" WHERE x NOT IN (%s)"
550570
" ORDER BY 1",
551571
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
552572
);
553573
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
554574
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
555575
}
556576
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
557
- nRoot = (int)strlen(g.zLocalRoot);
558577
while( db_step(&q)==SQLITE_ROW ){
559578
const char *zName = db_column_text(&q, 0);
560
- if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
579
+ if( glob_match(pKeep, zName+nRoot) ){
580
+ fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
581
+ continue;
582
+ }
583
+ if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
561584
Blob ans;
562585
char cReply;
563586
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
564587
zName+nRoot);
565588
blob_zero(&ans);
@@ -578,11 +601,12 @@
578601
}
579602
if( !dryRunFlag ){
580603
file_delete(zName);
581604
}
582605
}
583
- glob_free(pClean);
606
+ glob_free(pKeep);
607
+ glob_free(pIgnore);
584608
db_finalize(&q);
585609
}
586610
587611
/*
588612
** Prompt the user for a check-in or stash comment (given in pPrompt),
589613
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355 */
356 static void locate_unmanaged_files(
357 int argc, /* Number of command-line arguments to examine */
358 char **argv, /* values of command-line arguments */
359 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360 Glob *pIgnore1, /* Do not add files that match this GLOB */
361 Glob *pIgnore2 /* Omit files matching this GLOB too */
362 ){
363 Blob name; /* Name of a candidate file or directory */
364 char *zName; /* Name of a candidate file or directory */
365 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
366 int i; /* Loop counter */
@@ -369,19 +368,19 @@
369 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
370 filename_collation());
371 nRoot = (int)strlen(g.zLocalRoot);
372 if( argc==0 ){
373 blob_init(&name, g.zLocalRoot, nRoot - 1);
374 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
375 blob_reset(&name);
376 }else{
377 for(i=0; i<argc; i++){
378 file_canonical_name(argv[i], &name, 0);
379 zName = blob_str(&name);
380 isDir = file_wd_isdir(zName);
381 if( isDir==1 ){
382 vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
383 }else if( isDir==0 ){
384 fossil_warning("not found: %s", &zName[nRoot]);
385 }else if( file_access(zName, R_OK) ){
386 fossil_fatal("cannot open %s", &zName[nRoot]);
387 }else{
@@ -438,11 +437,11 @@
438 cwdRelative = determine_cwd_relative_option();
439 if( zIgnoreFlag==0 ){
440 zIgnoreFlag = db_get("ignore-glob", 0);
441 }
442 pIgnore = glob_create(zIgnoreFlag);
443 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
444 glob_free(pIgnore);
445 db_prepare(&q,
446 "SELECT x FROM sfile"
447 " WHERE x NOT IN (%s)"
448 " ORDER BY 1",
@@ -473,79 +472,100 @@
473 **
474 ** Delete all "extra" files in the source tree. "Extra" files are
475 ** files that are not officially part of the checkout. This operation
476 ** cannot be undone. If paths are specified, only the directories or
477 ** files specified will be considered for cleaning.
 
 
 
 
 
478 **
479 ** You will be prompted before removing each eligible file unless the
480 ** --force flag is in use or it matches the --clean option. The
481 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
482 ** --ignore option is omitted, the same with "clean-glob" and --clean
483 ** as well as "keep-glob" and --keep. If you are sure you wish to
484 ** remove all "extra" files except the ones specified with --ignore
485 ** and --keep, you can specify the optional -f|--force flag and no
486 ** prompts will be issued. If a file matches both --keep and --clean,
487 ** --keep takes precedence.
488 **
489 ** Files and subdirectories whose names begin with "." are
490 ** normally kept. They are handled if the "--dotfiles" option
491 ** is used.
492 **
493 ** Options:
494 ** --case-sensitive <BOOL> override case-sensitive setting
495 ** --dotfiles Include files beginning with a dot (".").
496 ** -f|--force Remove files without prompting.
497 ** --clean <CSG> Never prompt for files matching this
498 ** comma separated list of glob patterns.
499 ** --ignore <CSG> Ignore files matching patterns from the
500 ** comma separated list of glob patterns.
501 ** --keep <CSG> Keep files matching this comma separated
502 ** list of glob patterns.
503 ** -n|--dry-run If given, display instead of run actions.
504 ** --temp Remove only Fossil-generated temporary files.
505 ** -v|--verbose Show all files as they are removed.
 
 
 
 
 
506 **
507 ** See also: addremove, extra, status
508 */
509 void clean_cmd(void){
510 int allFlag, dryRunFlag, verboseFlag;
511 unsigned scanFlags = 0;
512 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
513 Blob repo;
514 Stmt q;
515 Glob *pIgnore, *pKeep, *pClean;
516 int nRoot;
517
518 dryRunFlag = find_option("dry-run","n",0)!=0;
519 if( !dryRunFlag ){
520 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
521 }
 
522 allFlag = find_option("force","f",0)!=0;
523 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
524 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
525 zIgnoreFlag = find_option("ignore",0,1);
526 verboseFlag = find_option("verbose","v",0)!=0;
527 zKeepFlag = find_option("keep",0,1);
528 zCleanFlag = find_option("clean",0,1);
529 capture_case_sensitive_option();
530 db_must_be_within_tree();
531 if( zIgnoreFlag==0 ){
532 zIgnoreFlag = db_get("ignore-glob", 0);
533 }
534 if( zKeepFlag==0 ){
535 zKeepFlag = db_get("keep-glob", 0);
536 }
537 if( zCleanFlag==0 ){
538 zCleanFlag = db_get("clean-glob", 0);
539 }
540 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541 pIgnore = glob_create(zIgnoreFlag);
542 pKeep = glob_create(zKeepFlag);
543 pClean = glob_create(zCleanFlag);
544 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
545 glob_free(pKeep);
546 glob_free(pIgnore);
547 db_prepare(&q,
548 "SELECT %Q || x FROM sfile"
549 " WHERE x NOT IN (%s)"
550 " ORDER BY 1",
551 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
552 );
553 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
554 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
555 }
556 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
557 nRoot = (int)strlen(g.zLocalRoot);
558 while( db_step(&q)==SQLITE_ROW ){
559 const char *zName = db_column_text(&q, 0);
560 if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
 
 
 
 
561 Blob ans;
562 char cReply;
563 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
564 zName+nRoot);
565 blob_zero(&ans);
@@ -578,11 +601,12 @@
578 }
579 if( !dryRunFlag ){
580 file_delete(zName);
581 }
582 }
583 glob_free(pClean);
 
584 db_finalize(&q);
585 }
586
587 /*
588 ** Prompt the user for a check-in or stash comment (given in pPrompt),
589
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355 */
356 static void locate_unmanaged_files(
357 int argc, /* Number of command-line arguments to examine */
358 char **argv, /* values of command-line arguments */
359 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360 Glob *pIgnore /* Do not add files that match this GLOB */
 
361 ){
362 Blob name; /* Name of a candidate file or directory */
363 char *zName; /* Name of a candidate file or directory */
364 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
365 int i; /* Loop counter */
@@ -369,19 +368,19 @@
368 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
369 filename_collation());
370 nRoot = (int)strlen(g.zLocalRoot);
371 if( argc==0 ){
372 blob_init(&name, g.zLocalRoot, nRoot - 1);
373 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
374 blob_reset(&name);
375 }else{
376 for(i=0; i<argc; i++){
377 file_canonical_name(argv[i], &name, 0);
378 zName = blob_str(&name);
379 isDir = file_wd_isdir(zName);
380 if( isDir==1 ){
381 vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
382 }else if( isDir==0 ){
383 fossil_warning("not found: %s", &zName[nRoot]);
384 }else if( file_access(zName, R_OK) ){
385 fossil_fatal("cannot open %s", &zName[nRoot]);
386 }else{
@@ -438,11 +437,11 @@
437 cwdRelative = determine_cwd_relative_option();
438 if( zIgnoreFlag==0 ){
439 zIgnoreFlag = db_get("ignore-glob", 0);
440 }
441 pIgnore = glob_create(zIgnoreFlag);
442 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
443 glob_free(pIgnore);
444 db_prepare(&q,
445 "SELECT x FROM sfile"
446 " WHERE x NOT IN (%s)"
447 " ORDER BY 1",
@@ -473,79 +472,100 @@
472 **
473 ** Delete all "extra" files in the source tree. "Extra" files are
474 ** files that are not officially part of the checkout. This operation
475 ** cannot be undone. If paths are specified, only the directories or
476 ** files specified will be considered for cleaning.
477 **
478 ** WARNING: Normally, only the files unknown to Fossil are removed;
479 ** however, if the --extreme option is specified, all files that are
480 ** not part of the current checkout will be removed as well, without
481 ** regard for the files which are normally ignored.
482 **
483 ** You will be prompted before removing each eligible file unless the
484 ** --force flag is in use or it matches the --ignore option. The
485 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
486 ** --ignore option is omitted, the same with "keep-glob" and --keep.
487 ** If you are sure you wish to remove all "extra" files except the
488 ** ones specified with --ignore and --keep, you can specify the
489 ** optional -f|--force flag and no prompts will be issued. If a
490 ** file matches both --keep and --ignore, --keep takes precedence.
 
491 **
492 ** Files and subdirectories whose names begin with "." are
493 ** normally kept. They are handled if the "--dotfiles" option
494 ** is used.
495 **
496 ** Options:
497 ** --case-sensitive <BOOL> override case-sensitive setting
498 ** --dotfiles Include files beginning with a dot (".").
499 ** -f|--force Remove files without prompting.
 
 
500 ** --ignore <CSG> Ignore files matching patterns from the
501 ** comma separated list of glob patterns.
502 ** --keep <CSG> Keep files matching this comma separated
503 ** list of glob patterns.
504 ** -n|--dry-run If given, display instead of run actions.
505 ** --temp Remove only Fossil-generated temporary files.
506 ** -v|--verbose Show all files as they are removed.
507 ** -x|--extreme Remove all files not part of the current
508 ** checkout, without taking into consideration
509 ** the "ignore-glob" setting and the --ignore
510 ** command line option.
511 ** Compatibile with "git clean -x".
512 **
513 ** See also: addremove, extra, status
514 */
515 void clean_cmd(void){
516 int allFlag, dryRunFlag, verboseFlag, extremeFlag;
517 unsigned scanFlags = 0;
518 const char *zIgnoreFlag, *zKeepFlag;
519 Blob repo;
520 Stmt q;
521 Glob *pIgnore, *pKeep;
522 int nRoot;
523
524 dryRunFlag = find_option("dry-run","n",0)!=0;
525 if( !dryRunFlag ){
526 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
527 }
528 extremeFlag = find_option("extreme","x",0)!=0;
529 allFlag = find_option("force","f",0)!=0;
530 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
531 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
532 zIgnoreFlag = find_option("ignore",0,1);
533 verboseFlag = find_option("verbose","v",0)!=0;
534 zKeepFlag = find_option("keep",0,1);
 
535 capture_case_sensitive_option();
536 db_must_be_within_tree();
537 if( zIgnoreFlag==0 ){
538 zIgnoreFlag = db_get("ignore-glob", 0);
539 }
540 if( zKeepFlag==0 ){
541 zKeepFlag = db_get("keep-glob", 0);
542 }
 
 
 
543 verify_all_options();
544 if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
545 Blob extremeAnswer;
546 char *extremePrompt =
547 "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
548 "that would otherwise be left alone will be deleted (i.e. those\n"
549 "matching the \"ignore-glob\" settings and the --ignore command\n"
550 "line option). As a precaution, in order to proceed with this\n"
551 "clean operation, the string \"YES\" must be entered in all upper\n"
552 "case; any other response will cancel the clean operation.\n\n"
553 "Do you still wish to proceed with the clean operation? ";
554 blob_zero(&extremeAnswer);
555 prompt_user(extremePrompt, &extremeAnswer);
556 if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
557 fossil_print("Extreme clean operation canceled.\n");
558 blob_reset(&extremeAnswer);
559 return;
560 }
561 blob_reset(&extremeAnswer);
562 }
563 nRoot = (int)strlen(g.zLocalRoot);
564 pIgnore = glob_create(zIgnoreFlag);
565 pKeep = glob_create(zKeepFlag);
566 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
 
 
 
567 db_prepare(&q,
568 "SELECT %Q || x FROM sfile"
569 " WHERE x NOT IN (%s)"
570 " ORDER BY 1",
571 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
572 );
573 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
574 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
575 }
576 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
 
577 while( db_step(&q)==SQLITE_ROW ){
578 const char *zName = db_column_text(&q, 0);
579 if( glob_match(pKeep, zName+nRoot) ){
580 fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
581 continue;
582 }
583 if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
584 Blob ans;
585 char cReply;
586 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
587 zName+nRoot);
588 blob_zero(&ans);
@@ -578,11 +601,12 @@
601 }
602 if( !dryRunFlag ){
603 file_delete(zName);
604 }
605 }
606 glob_free(pKeep);
607 glob_free(pIgnore);
608 db_finalize(&q);
609 }
610
611 /*
612 ** Prompt the user for a check-in or stash comment (given in pPrompt),
613
+52 -28
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355355
*/
356356
static void locate_unmanaged_files(
357357
int argc, /* Number of command-line arguments to examine */
358358
char **argv, /* values of command-line arguments */
359359
unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360
- Glob *pIgnore1, /* Do not add files that match this GLOB */
361
- Glob *pIgnore2 /* Omit files matching this GLOB too */
360
+ Glob *pIgnore /* Do not add files that match this GLOB */
362361
){
363362
Blob name; /* Name of a candidate file or directory */
364363
char *zName; /* Name of a candidate file or directory */
365364
int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
366365
int i; /* Loop counter */
@@ -369,19 +368,19 @@
369368
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
370369
filename_collation());
371370
nRoot = (int)strlen(g.zLocalRoot);
372371
if( argc==0 ){
373372
blob_init(&name, g.zLocalRoot, nRoot - 1);
374
- vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
373
+ vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
375374
blob_reset(&name);
376375
}else{
377376
for(i=0; i<argc; i++){
378377
file_canonical_name(argv[i], &name, 0);
379378
zName = blob_str(&name);
380379
isDir = file_wd_isdir(zName);
381380
if( isDir==1 ){
382
- vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
381
+ vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
383382
}else if( isDir==0 ){
384383
fossil_warning("not found: %s", &zName[nRoot]);
385384
}else if( file_access(zName, R_OK) ){
386385
fossil_fatal("cannot open %s", &zName[nRoot]);
387386
}else{
@@ -438,11 +437,11 @@
438437
cwdRelative = determine_cwd_relative_option();
439438
if( zIgnoreFlag==0 ){
440439
zIgnoreFlag = db_get("ignore-glob", 0);
441440
}
442441
pIgnore = glob_create(zIgnoreFlag);
443
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
442
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
444443
glob_free(pIgnore);
445444
db_prepare(&q,
446445
"SELECT x FROM sfile"
447446
" WHERE x NOT IN (%s)"
448447
" ORDER BY 1",
@@ -473,79 +472,100 @@
473472
**
474473
** Delete all "extra" files in the source tree. "Extra" files are
475474
** files that are not officially part of the checkout. This operation
476475
** cannot be undone. If paths are specified, only the directories or
477476
** files specified will be considered for cleaning.
477
+**
478
+** WARNING: Normally, only the files unknown to Fossil are removed;
479
+** however, if the --extreme option is specified, all files that are
480
+** not part of the current checkout will be removed as well, without
481
+** regard for the files which are normally ignored.
478482
**
479483
** You will be prompted before removing each eligible file unless the
480
-** --force flag is in use or it matches the --clean option. The
484
+** --force flag is in use or it matches the --ignore option. The
481485
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
482
-** --ignore option is omitted, the same with "clean-glob" and --clean
483
-** as well as "keep-glob" and --keep. If you are sure you wish to
484
-** remove all "extra" files except the ones specified with --ignore
485
-** and --keep, you can specify the optional -f|--force flag and no
486
-** prompts will be issued. If a file matches both --keep and --clean,
487
-** --keep takes precedence.
486
+** --ignore option is omitted, the same with "keep-glob" and --keep.
487
+** If you are sure you wish to remove all "extra" files except the
488
+** ones specified with --ignore and --keep, you can specify the
489
+** optional -f|--force flag and no prompts will be issued. If a
490
+** file matches both --keep and --ignore, --keep takes precedence.
488491
**
489492
** Files and subdirectories whose names begin with "." are
490493
** normally kept. They are handled if the "--dotfiles" option
491494
** is used.
492495
**
493496
** Options:
494497
** --case-sensitive <BOOL> override case-sensitive setting
495498
** --dotfiles Include files beginning with a dot (".").
496499
** -f|--force Remove files without prompting.
497
-** --clean <CSG> Never prompt for files matching this
498
-** comma separated list of glob patterns.
499500
** --ignore <CSG> Ignore files matching patterns from the
500501
** comma separated list of glob patterns.
501502
** --keep <CSG> Keep files matching this comma separated
502503
** list of glob patterns.
503504
** -n|--dry-run If given, display instead of run actions.
504505
** --temp Remove only Fossil-generated temporary files.
505506
** -v|--verbose Show all files as they are removed.
507
+** -x|--extreme Remove all files not part of the current
508
+** checkout, without taking into consideration
509
+** the "ignore-glob" setting and the --ignore
510
+** command line option.
511
+** Compatibile with "git clean -x".
506512
**
507513
** See also: addremove, extra, status
508514
*/
509515
void clean_cmd(void){
510
- int allFlag, dryRunFlag, verboseFlag;
516
+ int allFlag, dryRunFlag, verboseFlag, extremeFlag;
511517
unsigned scanFlags = 0;
512
- const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
518
+ const char *zIgnoreFlag, *zKeepFlag;
513519
Blob repo;
514520
Stmt q;
515
- Glob *pIgnore, *pKeep, *pClean;
521
+ Glob *pIgnore, *pKeep;
516522
int nRoot;
517523
518524
dryRunFlag = find_option("dry-run","n",0)!=0;
519525
if( !dryRunFlag ){
520526
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
521527
}
528
+ extremeFlag = find_option("extreme","x",0)!=0;
522529
allFlag = find_option("force","f",0)!=0;
523530
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
524531
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
525532
zIgnoreFlag = find_option("ignore",0,1);
526533
verboseFlag = find_option("verbose","v",0)!=0;
527534
zKeepFlag = find_option("keep",0,1);
528
- zCleanFlag = find_option("clean",0,1);
529535
capture_case_sensitive_option();
530536
db_must_be_within_tree();
531537
if( zIgnoreFlag==0 ){
532538
zIgnoreFlag = db_get("ignore-glob", 0);
533539
}
534540
if( zKeepFlag==0 ){
535541
zKeepFlag = db_get("keep-glob", 0);
536542
}
537
- if( zCleanFlag==0 ){
538
- zCleanFlag = db_get("clean-glob", 0);
539
- }
540543
verify_all_options();
544
+ if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
545
+ Blob extremeAnswer;
546
+ char *extremePrompt =
547
+ "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
548
+ "that would otherwise be left alone will be deleted (i.e. those\n"
549
+ "matching the \"ignore-glob\" settings and the --ignore command\n"
550
+ "line option). As a precaution, in order to proceed with this\n"
551
+ "clean operation, the string \"YES\" must be entered in all upper\n"
552
+ "case; any other response will cancel the clean operation.\n\n"
553
+ "Do you still wish to proceed with the clean operation? ";
554
+ blob_zero(&extremeAnswer);
555
+ prompt_user(extremePrompt, &extremeAnswer);
556
+ if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
557
+ fossil_print("Extreme clean operation canceled.\n");
558
+ blob_reset(&extremeAnswer);
559
+ return;
560
+ }
561
+ blob_reset(&extremeAnswer);
562
+ }
563
+ nRoot = (int)strlen(g.zLocalRoot);
541564
pIgnore = glob_create(zIgnoreFlag);
542565
pKeep = glob_create(zKeepFlag);
543
- pClean = glob_create(zCleanFlag);
544
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
545
- glob_free(pKeep);
546
- glob_free(pIgnore);
566
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
547567
db_prepare(&q,
548568
"SELECT %Q || x FROM sfile"
549569
" WHERE x NOT IN (%s)"
550570
" ORDER BY 1",
551571
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
552572
);
553573
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
554574
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
555575
}
556576
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
557
- nRoot = (int)strlen(g.zLocalRoot);
558577
while( db_step(&q)==SQLITE_ROW ){
559578
const char *zName = db_column_text(&q, 0);
560
- if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
579
+ if( glob_match(pKeep, zName+nRoot) ){
580
+ fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
581
+ continue;
582
+ }
583
+ if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
561584
Blob ans;
562585
char cReply;
563586
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
564587
zName+nRoot);
565588
blob_zero(&ans);
@@ -578,11 +601,12 @@
578601
}
579602
if( !dryRunFlag ){
580603
file_delete(zName);
581604
}
582605
}
583
- glob_free(pClean);
606
+ glob_free(pKeep);
607
+ glob_free(pIgnore);
584608
db_finalize(&q);
585609
}
586610
587611
/*
588612
** Prompt the user for a check-in or stash comment (given in pPrompt),
589613
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355 */
356 static void locate_unmanaged_files(
357 int argc, /* Number of command-line arguments to examine */
358 char **argv, /* values of command-line arguments */
359 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360 Glob *pIgnore1, /* Do not add files that match this GLOB */
361 Glob *pIgnore2 /* Omit files matching this GLOB too */
362 ){
363 Blob name; /* Name of a candidate file or directory */
364 char *zName; /* Name of a candidate file or directory */
365 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
366 int i; /* Loop counter */
@@ -369,19 +368,19 @@
369 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
370 filename_collation());
371 nRoot = (int)strlen(g.zLocalRoot);
372 if( argc==0 ){
373 blob_init(&name, g.zLocalRoot, nRoot - 1);
374 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
375 blob_reset(&name);
376 }else{
377 for(i=0; i<argc; i++){
378 file_canonical_name(argv[i], &name, 0);
379 zName = blob_str(&name);
380 isDir = file_wd_isdir(zName);
381 if( isDir==1 ){
382 vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
383 }else if( isDir==0 ){
384 fossil_warning("not found: %s", &zName[nRoot]);
385 }else if( file_access(zName, R_OK) ){
386 fossil_fatal("cannot open %s", &zName[nRoot]);
387 }else{
@@ -438,11 +437,11 @@
438 cwdRelative = determine_cwd_relative_option();
439 if( zIgnoreFlag==0 ){
440 zIgnoreFlag = db_get("ignore-glob", 0);
441 }
442 pIgnore = glob_create(zIgnoreFlag);
443 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
444 glob_free(pIgnore);
445 db_prepare(&q,
446 "SELECT x FROM sfile"
447 " WHERE x NOT IN (%s)"
448 " ORDER BY 1",
@@ -473,79 +472,100 @@
473 **
474 ** Delete all "extra" files in the source tree. "Extra" files are
475 ** files that are not officially part of the checkout. This operation
476 ** cannot be undone. If paths are specified, only the directories or
477 ** files specified will be considered for cleaning.
 
 
 
 
 
478 **
479 ** You will be prompted before removing each eligible file unless the
480 ** --force flag is in use or it matches the --clean option. The
481 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
482 ** --ignore option is omitted, the same with "clean-glob" and --clean
483 ** as well as "keep-glob" and --keep. If you are sure you wish to
484 ** remove all "extra" files except the ones specified with --ignore
485 ** and --keep, you can specify the optional -f|--force flag and no
486 ** prompts will be issued. If a file matches both --keep and --clean,
487 ** --keep takes precedence.
488 **
489 ** Files and subdirectories whose names begin with "." are
490 ** normally kept. They are handled if the "--dotfiles" option
491 ** is used.
492 **
493 ** Options:
494 ** --case-sensitive <BOOL> override case-sensitive setting
495 ** --dotfiles Include files beginning with a dot (".").
496 ** -f|--force Remove files without prompting.
497 ** --clean <CSG> Never prompt for files matching this
498 ** comma separated list of glob patterns.
499 ** --ignore <CSG> Ignore files matching patterns from the
500 ** comma separated list of glob patterns.
501 ** --keep <CSG> Keep files matching this comma separated
502 ** list of glob patterns.
503 ** -n|--dry-run If given, display instead of run actions.
504 ** --temp Remove only Fossil-generated temporary files.
505 ** -v|--verbose Show all files as they are removed.
 
 
 
 
 
506 **
507 ** See also: addremove, extra, status
508 */
509 void clean_cmd(void){
510 int allFlag, dryRunFlag, verboseFlag;
511 unsigned scanFlags = 0;
512 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
513 Blob repo;
514 Stmt q;
515 Glob *pIgnore, *pKeep, *pClean;
516 int nRoot;
517
518 dryRunFlag = find_option("dry-run","n",0)!=0;
519 if( !dryRunFlag ){
520 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
521 }
 
522 allFlag = find_option("force","f",0)!=0;
523 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
524 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
525 zIgnoreFlag = find_option("ignore",0,1);
526 verboseFlag = find_option("verbose","v",0)!=0;
527 zKeepFlag = find_option("keep",0,1);
528 zCleanFlag = find_option("clean",0,1);
529 capture_case_sensitive_option();
530 db_must_be_within_tree();
531 if( zIgnoreFlag==0 ){
532 zIgnoreFlag = db_get("ignore-glob", 0);
533 }
534 if( zKeepFlag==0 ){
535 zKeepFlag = db_get("keep-glob", 0);
536 }
537 if( zCleanFlag==0 ){
538 zCleanFlag = db_get("clean-glob", 0);
539 }
540 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541 pIgnore = glob_create(zIgnoreFlag);
542 pKeep = glob_create(zKeepFlag);
543 pClean = glob_create(zCleanFlag);
544 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
545 glob_free(pKeep);
546 glob_free(pIgnore);
547 db_prepare(&q,
548 "SELECT %Q || x FROM sfile"
549 " WHERE x NOT IN (%s)"
550 " ORDER BY 1",
551 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
552 );
553 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
554 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
555 }
556 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
557 nRoot = (int)strlen(g.zLocalRoot);
558 while( db_step(&q)==SQLITE_ROW ){
559 const char *zName = db_column_text(&q, 0);
560 if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
 
 
 
 
561 Blob ans;
562 char cReply;
563 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
564 zName+nRoot);
565 blob_zero(&ans);
@@ -578,11 +601,12 @@
578 }
579 if( !dryRunFlag ){
580 file_delete(zName);
581 }
582 }
583 glob_free(pClean);
 
584 db_finalize(&q);
585 }
586
587 /*
588 ** Prompt the user for a check-in or stash comment (given in pPrompt),
589
--- src/checkin.c
+++ src/checkin.c
@@ -355,12 +355,11 @@
355 */
356 static void locate_unmanaged_files(
357 int argc, /* Number of command-line arguments to examine */
358 char **argv, /* values of command-line arguments */
359 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
360 Glob *pIgnore /* Do not add files that match this GLOB */
 
361 ){
362 Blob name; /* Name of a candidate file or directory */
363 char *zName; /* Name of a candidate file or directory */
364 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
365 int i; /* Loop counter */
@@ -369,19 +368,19 @@
368 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
369 filename_collation());
370 nRoot = (int)strlen(g.zLocalRoot);
371 if( argc==0 ){
372 blob_init(&name, g.zLocalRoot, nRoot - 1);
373 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
374 blob_reset(&name);
375 }else{
376 for(i=0; i<argc; i++){
377 file_canonical_name(argv[i], &name, 0);
378 zName = blob_str(&name);
379 isDir = file_wd_isdir(zName);
380 if( isDir==1 ){
381 vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
382 }else if( isDir==0 ){
383 fossil_warning("not found: %s", &zName[nRoot]);
384 }else if( file_access(zName, R_OK) ){
385 fossil_fatal("cannot open %s", &zName[nRoot]);
386 }else{
@@ -438,11 +437,11 @@
437 cwdRelative = determine_cwd_relative_option();
438 if( zIgnoreFlag==0 ){
439 zIgnoreFlag = db_get("ignore-glob", 0);
440 }
441 pIgnore = glob_create(zIgnoreFlag);
442 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
443 glob_free(pIgnore);
444 db_prepare(&q,
445 "SELECT x FROM sfile"
446 " WHERE x NOT IN (%s)"
447 " ORDER BY 1",
@@ -473,79 +472,100 @@
472 **
473 ** Delete all "extra" files in the source tree. "Extra" files are
474 ** files that are not officially part of the checkout. This operation
475 ** cannot be undone. If paths are specified, only the directories or
476 ** files specified will be considered for cleaning.
477 **
478 ** WARNING: Normally, only the files unknown to Fossil are removed;
479 ** however, if the --extreme option is specified, all files that are
480 ** not part of the current checkout will be removed as well, without
481 ** regard for the files which are normally ignored.
482 **
483 ** You will be prompted before removing each eligible file unless the
484 ** --force flag is in use or it matches the --ignore option. The
485 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
486 ** --ignore option is omitted, the same with "keep-glob" and --keep.
487 ** If you are sure you wish to remove all "extra" files except the
488 ** ones specified with --ignore and --keep, you can specify the
489 ** optional -f|--force flag and no prompts will be issued. If a
490 ** file matches both --keep and --ignore, --keep takes precedence.
 
491 **
492 ** Files and subdirectories whose names begin with "." are
493 ** normally kept. They are handled if the "--dotfiles" option
494 ** is used.
495 **
496 ** Options:
497 ** --case-sensitive <BOOL> override case-sensitive setting
498 ** --dotfiles Include files beginning with a dot (".").
499 ** -f|--force Remove files without prompting.
 
 
500 ** --ignore <CSG> Ignore files matching patterns from the
501 ** comma separated list of glob patterns.
502 ** --keep <CSG> Keep files matching this comma separated
503 ** list of glob patterns.
504 ** -n|--dry-run If given, display instead of run actions.
505 ** --temp Remove only Fossil-generated temporary files.
506 ** -v|--verbose Show all files as they are removed.
507 ** -x|--extreme Remove all files not part of the current
508 ** checkout, without taking into consideration
509 ** the "ignore-glob" setting and the --ignore
510 ** command line option.
511 ** Compatibile with "git clean -x".
512 **
513 ** See also: addremove, extra, status
514 */
515 void clean_cmd(void){
516 int allFlag, dryRunFlag, verboseFlag, extremeFlag;
517 unsigned scanFlags = 0;
518 const char *zIgnoreFlag, *zKeepFlag;
519 Blob repo;
520 Stmt q;
521 Glob *pIgnore, *pKeep;
522 int nRoot;
523
524 dryRunFlag = find_option("dry-run","n",0)!=0;
525 if( !dryRunFlag ){
526 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
527 }
528 extremeFlag = find_option("extreme","x",0)!=0;
529 allFlag = find_option("force","f",0)!=0;
530 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
531 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
532 zIgnoreFlag = find_option("ignore",0,1);
533 verboseFlag = find_option("verbose","v",0)!=0;
534 zKeepFlag = find_option("keep",0,1);
 
535 capture_case_sensitive_option();
536 db_must_be_within_tree();
537 if( zIgnoreFlag==0 ){
538 zIgnoreFlag = db_get("ignore-glob", 0);
539 }
540 if( zKeepFlag==0 ){
541 zKeepFlag = db_get("keep-glob", 0);
542 }
 
 
 
543 verify_all_options();
544 if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
545 Blob extremeAnswer;
546 char *extremePrompt =
547 "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
548 "that would otherwise be left alone will be deleted (i.e. those\n"
549 "matching the \"ignore-glob\" settings and the --ignore command\n"
550 "line option). As a precaution, in order to proceed with this\n"
551 "clean operation, the string \"YES\" must be entered in all upper\n"
552 "case; any other response will cancel the clean operation.\n\n"
553 "Do you still wish to proceed with the clean operation? ";
554 blob_zero(&extremeAnswer);
555 prompt_user(extremePrompt, &extremeAnswer);
556 if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
557 fossil_print("Extreme clean operation canceled.\n");
558 blob_reset(&extremeAnswer);
559 return;
560 }
561 blob_reset(&extremeAnswer);
562 }
563 nRoot = (int)strlen(g.zLocalRoot);
564 pIgnore = glob_create(zIgnoreFlag);
565 pKeep = glob_create(zKeepFlag);
566 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
 
 
 
567 db_prepare(&q,
568 "SELECT %Q || x FROM sfile"
569 " WHERE x NOT IN (%s)"
570 " ORDER BY 1",
571 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -552,14 +572,17 @@
572 );
573 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
574 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
575 }
576 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
 
577 while( db_step(&q)==SQLITE_ROW ){
578 const char *zName = db_column_text(&q, 0);
579 if( glob_match(pKeep, zName+nRoot) ){
580 fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
581 continue;
582 }
583 if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
584 Blob ans;
585 char cReply;
586 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
587 zName+nRoot);
588 blob_zero(&ans);
@@ -578,11 +601,12 @@
601 }
602 if( !dryRunFlag ){
603 file_delete(zName);
604 }
605 }
606 glob_free(pKeep);
607 glob_free(pIgnore);
608 db_finalize(&q);
609 }
610
611 /*
612 ** Prompt the user for a check-in or stash comment (given in pPrompt),
613
--- 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
@@ -2089,10 +2089,11 @@
20892089
char const *def; /* Default value */
20902090
};
20912091
#endif /* INTERFACE */
20922092
struct stControlSettings const ctrlSettings[] = {
20932093
{ "access-log", 0, 0, 0, "off" },
2094
+ { "allow-clean-x", 0, 0, 0, "off" },
20942095
{ "allow-symlinks",0, 0, 1, "off" },
20952096
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
20962097
{ "auto-hyperlink",0, 0, 0, "on", },
20972098
{ "auto-shun", 0, 0, 0, "on" },
20982099
{ "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
21012102
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
21022103
{ "case-sensitive",0, 0, 0, "off" },
21032104
#else
21042105
{ "case-sensitive",0, 0, 0, "on" },
21052106
#endif
2106
- { "clean-glob", 0, 40, 1, "" },
21072107
{ "crnl-glob", 0, 40, 1, "" },
21082108
{ "default-perms", 0, 16, 0, "u" },
21092109
{ "diff-binary", 0, 0, 0, "on" },
21102110
{ "diff-command", 0, 40, 0, "" },
21112111
{ "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
21652165
** allow-symlinks If enabled, don't follow symlinks, and instead treat
21662166
** (versionable) them as symlinks on Unix. Has no effect on Windows
21672167
** (existing links in repository created on Unix become
21682168
** plain-text files with link destination path inside).
21692169
** Default: off
2170
+**
2171
+** allow-clean-x If enabled, allow the --extreme option to be used in
2172
+** the clean command.
2173
+** Default: off
21702174
**
21712175
** auto-captcha If enabled, the Login page provides a button to
21722176
** fill in the captcha password. Default: on
21732177
**
21742178
** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2193,15 +2197,10 @@
21932197
** case-sensitive If TRUE, the files whose names differ only in case
21942198
** care considered distinct. If FALSE files whose names
21952199
** differ only in case are the same file. Defaults to
21962200
** TRUE for unix and FALSE for Cygwin, Mac and Windows.
21972201
**
2198
-** clean-glob The VALUE is a comma or newline-separated list of GLOB
2199
-** (versionable) patterns specifying files that the "clean" command will
2200
-** delete without prompting even when the -force flag has
2201
-** not been used. Example: *.a *.lib *.o
2202
-**
22032202
** clearsign When enabled, fossil will attempt to sign all commits
22042203
** with gpg. When disabled (the default), commits will
22052204
** be unsigned. Default: off
22062205
**
22072206
** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
22512250
** even if the login page request came via HTTP.
22522251
**
22532252
** ignore-glob The VALUE is a comma or newline-separated list of GLOB
22542253
** (versionable) patterns specifying files that the "add", "addremove",
22552254
** "clean", and "extra" commands will ignore.
2256
-** Example: *.log customCode.c notes.txt
2255
+** Example: *.log *.a *.lib *.o
22572256
**
22582257
** keep-glob The VALUE is a comma or newline-separated list of GLOB
22592258
** (versionable) patterns specifying files that the "clean" command will
2260
-** keep.
2259
+** keep. Example: *.log customCode.c notes.txt
22612260
**
22622261
** localauth If enabled, require that HTTP connections from
22632262
** 127.0.0.1 be authenticated by password. If
22642263
** false, all HTTP requests from localhost have
22652264
** unrestricted access to the repository.
22662265
--- src/db.c
+++ src/db.c
@@ -2089,10 +2089,11 @@
2089 char const *def; /* Default value */
2090 };
2091 #endif /* INTERFACE */
2092 struct stControlSettings const ctrlSettings[] = {
2093 { "access-log", 0, 0, 0, "off" },
 
2094 { "allow-symlinks",0, 0, 1, "off" },
2095 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2096 { "auto-hyperlink",0, 0, 0, "on", },
2097 { "auto-shun", 0, 0, 0, "on" },
2098 { "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
2101 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2102 { "case-sensitive",0, 0, 0, "off" },
2103 #else
2104 { "case-sensitive",0, 0, 0, "on" },
2105 #endif
2106 { "clean-glob", 0, 40, 1, "" },
2107 { "crnl-glob", 0, 40, 1, "" },
2108 { "default-perms", 0, 16, 0, "u" },
2109 { "diff-binary", 0, 0, 0, "on" },
2110 { "diff-command", 0, 40, 0, "" },
2111 { "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
2165 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2166 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2167 ** (existing links in repository created on Unix become
2168 ** plain-text files with link destination path inside).
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
@@ -2193,15 +2197,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 ** clean-glob The VALUE is a comma or newline-separated list of GLOB
2199 ** (versionable) patterns specifying files that the "clean" command will
2200 ** delete without prompting even when the -force flag has
2201 ** not been used. Example: *.a *.lib *.o
2202 **
2203 ** clearsign When enabled, fossil will attempt to sign all commits
2204 ** with gpg. When disabled (the default), commits will
2205 ** be unsigned. Default: off
2206 **
2207 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
2251 ** even if the login page request came via HTTP.
2252 **
2253 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2254 ** (versionable) patterns specifying files that the "add", "addremove",
2255 ** "clean", and "extra" commands will ignore.
2256 ** Example: *.log customCode.c notes.txt
2257 **
2258 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2259 ** (versionable) patterns specifying files that the "clean" command will
2260 ** keep.
2261 **
2262 ** localauth If enabled, require that HTTP connections from
2263 ** 127.0.0.1 be authenticated by password. If
2264 ** false, all HTTP requests from localhost have
2265 ** unrestricted access to the repository.
2266
--- src/db.c
+++ src/db.c
@@ -2089,10 +2089,11 @@
2089 char const *def; /* Default value */
2090 };
2091 #endif /* INTERFACE */
2092 struct stControlSettings const ctrlSettings[] = {
2093 { "access-log", 0, 0, 0, "off" },
2094 { "allow-clean-x", 0, 0, 0, "off" },
2095 { "allow-symlinks",0, 0, 1, "off" },
2096 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2097 { "auto-hyperlink",0, 0, 0, "on", },
2098 { "auto-shun", 0, 0, 0, "on" },
2099 { "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
2102 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2103 { "case-sensitive",0, 0, 0, "off" },
2104 #else
2105 { "case-sensitive",0, 0, 0, "on" },
2106 #endif
 
2107 { "crnl-glob", 0, 40, 1, "" },
2108 { "default-perms", 0, 16, 0, "u" },
2109 { "diff-binary", 0, 0, 0, "on" },
2110 { "diff-command", 0, 40, 0, "" },
2111 { "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
2165 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2166 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2167 ** (existing links in repository created on Unix become
2168 ** plain-text files with link destination path inside).
2169 ** Default: off
2170 **
2171 ** allow-clean-x If enabled, allow the --extreme option to be used in
2172 ** the clean command.
2173 ** Default: off
2174 **
2175 ** auto-captcha If enabled, the Login page provides a button to
2176 ** fill in the captcha password. Default: on
2177 **
2178 ** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2193,15 +2197,10 @@
2197 ** case-sensitive If TRUE, the files whose names differ only in case
2198 ** care considered distinct. If FALSE files whose names
2199 ** differ only in case are the same file. Defaults to
2200 ** TRUE for unix and FALSE for Cygwin, Mac and Windows.
2201 **
 
 
 
 
 
2202 ** clearsign When enabled, fossil will attempt to sign all commits
2203 ** with gpg. When disabled (the default), commits will
2204 ** be unsigned. Default: off
2205 **
2206 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
2250 ** even if the login page request came via HTTP.
2251 **
2252 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2253 ** (versionable) patterns specifying files that the "add", "addremove",
2254 ** "clean", and "extra" commands will ignore.
2255 ** Example: *.log *.a *.lib *.o
2256 **
2257 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2258 ** (versionable) patterns specifying files that the "clean" command will
2259 ** keep. Example: *.log customCode.c notes.txt
2260 **
2261 ** localauth If enabled, require that HTTP connections from
2262 ** 127.0.0.1 be authenticated by password. If
2263 ** false, all HTTP requests from localhost have
2264 ** unrestricted access to the repository.
2265
+7 -8
--- src/db.c
+++ src/db.c
@@ -2089,10 +2089,11 @@
20892089
char const *def; /* Default value */
20902090
};
20912091
#endif /* INTERFACE */
20922092
struct stControlSettings const ctrlSettings[] = {
20932093
{ "access-log", 0, 0, 0, "off" },
2094
+ { "allow-clean-x", 0, 0, 0, "off" },
20942095
{ "allow-symlinks",0, 0, 1, "off" },
20952096
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
20962097
{ "auto-hyperlink",0, 0, 0, "on", },
20972098
{ "auto-shun", 0, 0, 0, "on" },
20982099
{ "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
21012102
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
21022103
{ "case-sensitive",0, 0, 0, "off" },
21032104
#else
21042105
{ "case-sensitive",0, 0, 0, "on" },
21052106
#endif
2106
- { "clean-glob", 0, 40, 1, "" },
21072107
{ "crnl-glob", 0, 40, 1, "" },
21082108
{ "default-perms", 0, 16, 0, "u" },
21092109
{ "diff-binary", 0, 0, 0, "on" },
21102110
{ "diff-command", 0, 40, 0, "" },
21112111
{ "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
21652165
** allow-symlinks If enabled, don't follow symlinks, and instead treat
21662166
** (versionable) them as symlinks on Unix. Has no effect on Windows
21672167
** (existing links in repository created on Unix become
21682168
** plain-text files with link destination path inside).
21692169
** Default: off
2170
+**
2171
+** allow-clean-x If enabled, allow the --extreme option to be used in
2172
+** the clean command.
2173
+** Default: off
21702174
**
21712175
** auto-captcha If enabled, the Login page provides a button to
21722176
** fill in the captcha password. Default: on
21732177
**
21742178
** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2193,15 +2197,10 @@
21932197
** case-sensitive If TRUE, the files whose names differ only in case
21942198
** care considered distinct. If FALSE files whose names
21952199
** differ only in case are the same file. Defaults to
21962200
** TRUE for unix and FALSE for Cygwin, Mac and Windows.
21972201
**
2198
-** clean-glob The VALUE is a comma or newline-separated list of GLOB
2199
-** (versionable) patterns specifying files that the "clean" command will
2200
-** delete without prompting even when the -force flag has
2201
-** not been used. Example: *.a *.lib *.o
2202
-**
22032202
** clearsign When enabled, fossil will attempt to sign all commits
22042203
** with gpg. When disabled (the default), commits will
22052204
** be unsigned. Default: off
22062205
**
22072206
** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
22512250
** even if the login page request came via HTTP.
22522251
**
22532252
** ignore-glob The VALUE is a comma or newline-separated list of GLOB
22542253
** (versionable) patterns specifying files that the "add", "addremove",
22552254
** "clean", and "extra" commands will ignore.
2256
-** Example: *.log customCode.c notes.txt
2255
+** Example: *.log *.a *.lib *.o
22572256
**
22582257
** keep-glob The VALUE is a comma or newline-separated list of GLOB
22592258
** (versionable) patterns specifying files that the "clean" command will
2260
-** keep.
2259
+** keep. Example: *.log customCode.c notes.txt
22612260
**
22622261
** localauth If enabled, require that HTTP connections from
22632262
** 127.0.0.1 be authenticated by password. If
22642263
** false, all HTTP requests from localhost have
22652264
** unrestricted access to the repository.
22662265
--- src/db.c
+++ src/db.c
@@ -2089,10 +2089,11 @@
2089 char const *def; /* Default value */
2090 };
2091 #endif /* INTERFACE */
2092 struct stControlSettings const ctrlSettings[] = {
2093 { "access-log", 0, 0, 0, "off" },
 
2094 { "allow-symlinks",0, 0, 1, "off" },
2095 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2096 { "auto-hyperlink",0, 0, 0, "on", },
2097 { "auto-shun", 0, 0, 0, "on" },
2098 { "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
2101 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2102 { "case-sensitive",0, 0, 0, "off" },
2103 #else
2104 { "case-sensitive",0, 0, 0, "on" },
2105 #endif
2106 { "clean-glob", 0, 40, 1, "" },
2107 { "crnl-glob", 0, 40, 1, "" },
2108 { "default-perms", 0, 16, 0, "u" },
2109 { "diff-binary", 0, 0, 0, "on" },
2110 { "diff-command", 0, 40, 0, "" },
2111 { "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
2165 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2166 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2167 ** (existing links in repository created on Unix become
2168 ** plain-text files with link destination path inside).
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
@@ -2193,15 +2197,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 ** clean-glob The VALUE is a comma or newline-separated list of GLOB
2199 ** (versionable) patterns specifying files that the "clean" command will
2200 ** delete without prompting even when the -force flag has
2201 ** not been used. Example: *.a *.lib *.o
2202 **
2203 ** clearsign When enabled, fossil will attempt to sign all commits
2204 ** with gpg. When disabled (the default), commits will
2205 ** be unsigned. Default: off
2206 **
2207 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
2251 ** even if the login page request came via HTTP.
2252 **
2253 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2254 ** (versionable) patterns specifying files that the "add", "addremove",
2255 ** "clean", and "extra" commands will ignore.
2256 ** Example: *.log customCode.c notes.txt
2257 **
2258 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2259 ** (versionable) patterns specifying files that the "clean" command will
2260 ** keep.
2261 **
2262 ** localauth If enabled, require that HTTP connections from
2263 ** 127.0.0.1 be authenticated by password. If
2264 ** false, all HTTP requests from localhost have
2265 ** unrestricted access to the repository.
2266
--- src/db.c
+++ src/db.c
@@ -2089,10 +2089,11 @@
2089 char const *def; /* Default value */
2090 };
2091 #endif /* INTERFACE */
2092 struct stControlSettings const ctrlSettings[] = {
2093 { "access-log", 0, 0, 0, "off" },
2094 { "allow-clean-x", 0, 0, 0, "off" },
2095 { "allow-symlinks",0, 0, 1, "off" },
2096 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2097 { "auto-hyperlink",0, 0, 0, "on", },
2098 { "auto-shun", 0, 0, 0, "on" },
2099 { "autosync", 0, 0, 0, "on" },
@@ -2101,11 +2102,10 @@
2102 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__)
2103 { "case-sensitive",0, 0, 0, "off" },
2104 #else
2105 { "case-sensitive",0, 0, 0, "on" },
2106 #endif
 
2107 { "crnl-glob", 0, 40, 1, "" },
2108 { "default-perms", 0, 16, 0, "u" },
2109 { "diff-binary", 0, 0, 0, "on" },
2110 { "diff-command", 0, 40, 0, "" },
2111 { "dont-push", 0, 0, 0, "off" },
@@ -2165,10 +2165,14 @@
2165 ** allow-symlinks If enabled, don't follow symlinks, and instead treat
2166 ** (versionable) them as symlinks on Unix. Has no effect on Windows
2167 ** (existing links in repository created on Unix become
2168 ** plain-text files with link destination path inside).
2169 ** Default: off
2170 **
2171 ** allow-clean-x If enabled, allow the --extreme option to be used in
2172 ** the clean command.
2173 ** Default: off
2174 **
2175 ** auto-captcha If enabled, the Login page provides a button to
2176 ** fill in the captcha password. Default: on
2177 **
2178 ** auto-hyperlink Use javascript to enable hyperlinks on web pages
@@ -2193,15 +2197,10 @@
2197 ** case-sensitive If TRUE, the files whose names differ only in case
2198 ** care considered distinct. If FALSE files whose names
2199 ** differ only in case are the same file. Defaults to
2200 ** TRUE for unix and FALSE for Cygwin, Mac and Windows.
2201 **
 
 
 
 
 
2202 ** clearsign When enabled, fossil will attempt to sign all commits
2203 ** with gpg. When disabled (the default), commits will
2204 ** be unsigned. Default: off
2205 **
2206 ** crnl-glob A comma or newline-separated list of GLOB patterns for
@@ -2251,15 +2250,15 @@
2250 ** even if the login page request came via HTTP.
2251 **
2252 ** ignore-glob The VALUE is a comma or newline-separated list of GLOB
2253 ** (versionable) patterns specifying files that the "add", "addremove",
2254 ** "clean", and "extra" commands will ignore.
2255 ** Example: *.log *.a *.lib *.o
2256 **
2257 ** keep-glob The VALUE is a comma or newline-separated list of GLOB
2258 ** (versionable) patterns specifying files that the "clean" command will
2259 ** keep. Example: *.log customCode.c notes.txt
2260 **
2261 ** localauth If enabled, require that HTTP connections from
2262 ** 127.0.0.1 be authenticated by password. If
2263 ** false, all HTTP requests from localhost have
2264 ** unrestricted access to the repository.
2265
--- 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
+5 -8
--- src/vfile.c
+++ src/vfile.c
@@ -436,12 +436,11 @@
436436
*/
437437
void vfile_scan(
438438
Blob *pPath, /* Directory to be scanned */
439439
int nPrefix, /* Number of bytes in directory name */
440440
unsigned scanFlags, /* Zero or more SCAN_xxx flags */
441
- Glob *pIgnore1, /* Do not add files that match this GLOB */
442
- Glob *pIgnore2 /* Omit files matching this GLOB too */
441
+ Glob *pIgnore /* Do not add files that match this GLOB */
443442
){
444443
DIR *d;
445444
int origSize;
446445
const char *zDir;
447446
struct dirent *pEntry;
@@ -449,14 +448,13 @@
449448
static Stmt ins;
450449
static int depth = 0;
451450
void *zNative;
452451
453452
origSize = blob_size(pPath);
454
- if( pIgnore1 || pIgnore2 ){
453
+ if( pIgnore ){
455454
blob_appendf(pPath, "/");
456
- if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
457
- if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
455
+ if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
458456
blob_resize(pPath, origSize);
459457
}
460458
if( skipAll ) return;
461459
462460
if( depth==0 ){
@@ -481,16 +479,15 @@
481479
if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
482480
}
483481
zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
484482
blob_appendf(pPath, "/%s", zUtf8);
485483
zPath = blob_str(pPath);
486
- if( glob_match(pIgnore1, &zPath[nPrefix+1]) ||
487
- glob_match(pIgnore2, &zPath[nPrefix+1]) ){
484
+ if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
488485
/* do nothing */
489486
}else if( file_wd_isdir(zPath)==1 ){
490487
if( !vfile_top_of_checkout(zPath) ){
491
- vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2);
488
+ vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
492489
}
493490
}else if( file_wd_isfile_or_link(zPath) ){
494491
if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
495492
db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
496493
db_step(&ins);
497494
--- src/vfile.c
+++ src/vfile.c
@@ -436,12 +436,11 @@
436 */
437 void vfile_scan(
438 Blob *pPath, /* Directory to be scanned */
439 int nPrefix, /* Number of bytes in directory name */
440 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
441 Glob *pIgnore1, /* Do not add files that match this GLOB */
442 Glob *pIgnore2 /* Omit files matching this GLOB too */
443 ){
444 DIR *d;
445 int origSize;
446 const char *zDir;
447 struct dirent *pEntry;
@@ -449,14 +448,13 @@
449 static Stmt ins;
450 static int depth = 0;
451 void *zNative;
452
453 origSize = blob_size(pPath);
454 if( pIgnore1 || pIgnore2 ){
455 blob_appendf(pPath, "/");
456 if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
457 if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
458 blob_resize(pPath, origSize);
459 }
460 if( skipAll ) return;
461
462 if( depth==0 ){
@@ -481,16 +479,15 @@
481 if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
482 }
483 zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
484 blob_appendf(pPath, "/%s", zUtf8);
485 zPath = blob_str(pPath);
486 if( glob_match(pIgnore1, &zPath[nPrefix+1]) ||
487 glob_match(pIgnore2, &zPath[nPrefix+1]) ){
488 /* do nothing */
489 }else if( file_wd_isdir(zPath)==1 ){
490 if( !vfile_top_of_checkout(zPath) ){
491 vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2);
492 }
493 }else if( file_wd_isfile_or_link(zPath) ){
494 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
495 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
496 db_step(&ins);
497
--- src/vfile.c
+++ src/vfile.c
@@ -436,12 +436,11 @@
436 */
437 void vfile_scan(
438 Blob *pPath, /* Directory to be scanned */
439 int nPrefix, /* Number of bytes in directory name */
440 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
441 Glob *pIgnore /* Do not add files that match this GLOB */
 
442 ){
443 DIR *d;
444 int origSize;
445 const char *zDir;
446 struct dirent *pEntry;
@@ -449,14 +448,13 @@
448 static Stmt ins;
449 static int depth = 0;
450 void *zNative;
451
452 origSize = blob_size(pPath);
453 if( pIgnore ){
454 blob_appendf(pPath, "/");
455 if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
 
456 blob_resize(pPath, origSize);
457 }
458 if( skipAll ) return;
459
460 if( depth==0 ){
@@ -481,16 +479,15 @@
479 if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue;
480 }
481 zUtf8 = fossil_filename_to_utf8(pEntry->d_name);
482 blob_appendf(pPath, "/%s", zUtf8);
483 zPath = blob_str(pPath);
484 if( glob_match(pIgnore, &zPath[nPrefix+1]) ){
 
485 /* do nothing */
486 }else if( file_wd_isdir(zPath)==1 ){
487 if( !vfile_top_of_checkout(zPath) ){
488 vfile_scan(pPath, nPrefix, scanFlags, pIgnore);
489 }
490 }else if( file_wd_isfile_or_link(zPath) ){
491 if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){
492 db_bind_text(&ins, ":file", &zPath[nPrefix+1]);
493 db_step(&ins);
494

Keyboard Shortcuts

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