Fossil SCM

rebase

jan.nijtmans 2013-06-21 09:27 trunk merge
Commit dfb47a2a2e0f5dacf10ad8e1f1e5d3845df4593a
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
--- .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
@@ -326,12 +326,11 @@
326326
*/
327327
static void locate_unmanaged_files(
328328
int argc, /* Number of command-line arguments to examine */
329329
char **argv, /* values of command-line arguments */
330330
unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331
- Glob *pIgnore1, /* Do not add files that match this GLOB */
332
- Glob *pIgnore2 /* Omit files matching this GLOB too */
331
+ Glob *pIgnore /* Do not add files that match this GLOB */
333332
){
334333
Blob name; /* Name of a candidate file or directory */
335334
char *zName; /* Name of a candidate file or directory */
336335
int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
337336
int i; /* Loop counter */
@@ -340,19 +339,19 @@
340339
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341340
filename_collation());
342341
nRoot = (int)strlen(g.zLocalRoot);
343342
if( argc==0 ){
344343
blob_init(&name, g.zLocalRoot, nRoot - 1);
345
- vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
344
+ vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
346345
blob_reset(&name);
347346
}else{
348347
for(i=0; i<argc; i++){
349348
file_canonical_name(argv[i], &name, 0);
350349
zName = blob_str(&name);
351350
isDir = file_wd_isdir(zName);
352351
if( isDir==1 ){
353
- vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
352
+ vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
354353
}else if( isDir==0 ){
355354
fossil_warning("not found: %s", zName);
356355
}else if( file_access(zName, R_OK) ){
357356
fossil_fatal("cannot open %s", zName);
358357
}else{
@@ -409,11 +408,11 @@
409408
cwdRelative = determine_cwd_relative_option();
410409
if( zIgnoreFlag==0 ){
411410
zIgnoreFlag = db_get("ignore-glob", 0);
412411
}
413412
pIgnore = glob_create(zIgnoreFlag);
414
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
413
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
415414
glob_free(pIgnore);
416415
db_prepare(&q,
417416
"SELECT x FROM sfile"
418417
" WHERE x NOT IN (%s)"
419418
" ORDER BY 1",
@@ -444,79 +443,100 @@
444443
**
445444
** Delete all "extra" files in the source tree. "Extra" files are
446445
** files that are not officially part of the checkout. This operation
447446
** cannot be undone. If paths are specified, only the directories or
448447
** files specified will be considered for cleaning.
448
+**
449
+** WARNING: Normally, only the files unknown to Fossil are removed;
450
+** however, if the --extreme option is specified, all files that are
451
+** not part of the current checkout will be removed as well, without
452
+** regard for the files which are normally ignored.
449453
**
450454
** You will be prompted before removing each eligible file unless the
451
-** --force flag is in use or it matches the --clean option. The
455
+** --force flag is in use or it matches the --ignore option. The
452456
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
453
-** --ignore option is omitted, the same with "clean-glob" and --clean
454
-** as well as "keep-glob" and --keep. If you are sure you wish to
455
-** remove all "extra" files except the ones specified with --ignore
456
-** and --keep, you can specify the optional -f|--force flag and no
457
-** prompts will be issued. If a file matches both --keep and --clean,
458
-** --keep takes precedence.
457
+** --ignore option is omitted, the same with "keep-glob" and --keep.
458
+** If you are sure you wish to remove all "extra" files except the
459
+** ones specified with --ignore and --keep, you can specify the
460
+** optional -f|--force flag and no prompts will be issued. If a
461
+** file matches both --keep and --ignore, --keep takes precedence.
459462
**
460463
** Files and subdirectories whose names begin with "." are
461464
** normally kept. They are handled if the "--dotfiles" option
462465
** is used.
463466
**
464467
** Options:
465468
** --case-sensitive <BOOL> override case-sensitive setting
466469
** --dotfiles Include files beginning with a dot (".").
467470
** -f|--force Remove files without prompting.
468
-** --clean <CSG> Never prompt for files matching this
469
-** comma separated list of glob patterns.
470471
** --ignore <CSG> Ignore files matching patterns from the
471472
** comma separated list of glob patterns.
472473
** --keep <CSG> Keep files matching this comma separated
473474
** list of glob patterns.
474475
** -n|--dry-run If given, display instead of run actions.
475476
** --temp Remove only Fossil-generated temporary files.
476477
** -v|--verbose Show all files as they are removed.
478
+** -x|--extreme Remove all files not part of the current
479
+** checkout, without taking into consideration
480
+** the "ignore-glob" setting and the --ignore
481
+** command line option.
482
+** Compatibile with "git clean -x".
477483
**
478484
** See also: addremove, extra, status
479485
*/
480486
void clean_cmd(void){
481
- int allFlag, dryRunFlag, verboseFlag;
487
+ int allFlag, dryRunFlag, verboseFlag, extremeFlag;
482488
unsigned scanFlags = 0;
483
- const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
489
+ const char *zIgnoreFlag, *zKeepFlag;
484490
Blob repo;
485491
Stmt q;
486
- Glob *pIgnore, *pKeep, *pClean;
492
+ Glob *pIgnore, *pKeep;
487493
int nRoot;
488494
489495
dryRunFlag = find_option("dry-run","n",0)!=0;
490496
if( !dryRunFlag ){
491497
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
492498
}
499
+ extremeFlag = find_option("extreme","x",0)!=0;
493500
allFlag = find_option("force","f",0)!=0;
494501
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
495502
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
496503
zIgnoreFlag = find_option("ignore",0,1);
497504
verboseFlag = find_option("verbose","v",0)!=0;
498505
zKeepFlag = find_option("keep",0,1);
499
- zCleanFlag = find_option("clean",0,1);
500506
capture_case_sensitive_option();
501507
db_must_be_within_tree();
502508
if( zIgnoreFlag==0 ){
503509
zIgnoreFlag = db_get("ignore-glob", 0);
504510
}
505511
if( zKeepFlag==0 ){
506512
zKeepFlag = db_get("keep-glob", 0);
507513
}
508
- if( zCleanFlag==0 ){
509
- zCleanFlag = db_get("clean-glob", 0);
510
- }
511514
verify_all_options();
515
+ if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
516
+ Blob extremeAnswer;
517
+ char *extremePrompt =
518
+ "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
519
+ "that would otherwise be left alone will be deleted (i.e. those\n"
520
+ "matching the \"ignore-glob\" settings and the --ignore command\n"
521
+ "line option). As a precaution, in order to proceed with this\n"
522
+ "clean operation, the string \"YES\" must be entered in all upper\n"
523
+ "case; any other response will cancel the clean operation.\n\n"
524
+ "Do you still wish to proceed with the clean operation? ";
525
+ blob_zero(&extremeAnswer);
526
+ prompt_user(extremePrompt, &extremeAnswer);
527
+ if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
528
+ fossil_print("Extreme clean operation canceled.\n");
529
+ blob_reset(&extremeAnswer);
530
+ return;
531
+ }
532
+ blob_reset(&extremeAnswer);
533
+ }
534
+ nRoot = (int)strlen(g.zLocalRoot);
512535
pIgnore = glob_create(zIgnoreFlag);
513536
pKeep = glob_create(zKeepFlag);
514
- pClean = glob_create(zCleanFlag);
515
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
516
- glob_free(pKeep);
517
- glob_free(pIgnore);
537
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
518538
db_prepare(&q,
519539
"SELECT %Q || x FROM sfile"
520540
" WHERE x NOT IN (%s)"
521541
" ORDER BY 1",
522542
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
523543
);
524544
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
525545
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
526546
}
527547
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
528
- nRoot = (int)strlen(g.zLocalRoot);
529548
while( db_step(&q)==SQLITE_ROW ){
530549
const char *zName = db_column_text(&q, 0);
531
- if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
550
+ if( glob_match(pKeep, zName+nRoot) ){
551
+ fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
552
+ continue;
553
+ }
554
+ if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
532555
Blob ans;
533556
char cReply;
534557
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
535558
zName+nRoot);
536559
blob_zero(&ans);
@@ -549,11 +572,12 @@
549572
}
550573
if( !dryRunFlag ){
551574
file_delete(zName);
552575
}
553576
}
554
- glob_free(pClean);
577
+ glob_free(pKeep);
578
+ glob_free(pIgnore);
555579
db_finalize(&q);
556580
}
557581
558582
/*
559583
** Prompt the user for a check-in or stash comment (given in pPrompt),
560584
--- src/checkin.c
+++ src/checkin.c
@@ -326,12 +326,11 @@
326 */
327 static void locate_unmanaged_files(
328 int argc, /* Number of command-line arguments to examine */
329 char **argv, /* values of command-line arguments */
330 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331 Glob *pIgnore1, /* Do not add files that match this GLOB */
332 Glob *pIgnore2 /* Omit files matching this GLOB too */
333 ){
334 Blob name; /* Name of a candidate file or directory */
335 char *zName; /* Name of a candidate file or directory */
336 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
337 int i; /* Loop counter */
@@ -340,19 +339,19 @@
340 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341 filename_collation());
342 nRoot = (int)strlen(g.zLocalRoot);
343 if( argc==0 ){
344 blob_init(&name, g.zLocalRoot, nRoot - 1);
345 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
346 blob_reset(&name);
347 }else{
348 for(i=0; i<argc; i++){
349 file_canonical_name(argv[i], &name, 0);
350 zName = blob_str(&name);
351 isDir = file_wd_isdir(zName);
352 if( isDir==1 ){
353 vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
354 }else if( isDir==0 ){
355 fossil_warning("not found: %s", zName);
356 }else if( file_access(zName, R_OK) ){
357 fossil_fatal("cannot open %s", zName);
358 }else{
@@ -409,11 +408,11 @@
409 cwdRelative = determine_cwd_relative_option();
410 if( zIgnoreFlag==0 ){
411 zIgnoreFlag = db_get("ignore-glob", 0);
412 }
413 pIgnore = glob_create(zIgnoreFlag);
414 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
415 glob_free(pIgnore);
416 db_prepare(&q,
417 "SELECT x FROM sfile"
418 " WHERE x NOT IN (%s)"
419 " ORDER BY 1",
@@ -444,79 +443,100 @@
444 **
445 ** Delete all "extra" files in the source tree. "Extra" files are
446 ** files that are not officially part of the checkout. This operation
447 ** cannot be undone. If paths are specified, only the directories or
448 ** files specified will be considered for cleaning.
 
 
 
 
 
449 **
450 ** You will be prompted before removing each eligible file unless the
451 ** --force flag is in use or it matches the --clean option. The
452 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
453 ** --ignore option is omitted, the same with "clean-glob" and --clean
454 ** as well as "keep-glob" and --keep. If you are sure you wish to
455 ** remove all "extra" files except the ones specified with --ignore
456 ** and --keep, you can specify the optional -f|--force flag and no
457 ** prompts will be issued. If a file matches both --keep and --clean,
458 ** --keep takes precedence.
459 **
460 ** Files and subdirectories whose names begin with "." are
461 ** normally kept. They are handled if the "--dotfiles" option
462 ** is used.
463 **
464 ** Options:
465 ** --case-sensitive <BOOL> override case-sensitive setting
466 ** --dotfiles Include files beginning with a dot (".").
467 ** -f|--force Remove files without prompting.
468 ** --clean <CSG> Never prompt for files matching this
469 ** comma separated list of glob patterns.
470 ** --ignore <CSG> Ignore files matching patterns from the
471 ** comma separated list of glob patterns.
472 ** --keep <CSG> Keep files matching this comma separated
473 ** list of glob patterns.
474 ** -n|--dry-run If given, display instead of run actions.
475 ** --temp Remove only Fossil-generated temporary files.
476 ** -v|--verbose Show all files as they are removed.
 
 
 
 
 
477 **
478 ** See also: addremove, extra, status
479 */
480 void clean_cmd(void){
481 int allFlag, dryRunFlag, verboseFlag;
482 unsigned scanFlags = 0;
483 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
484 Blob repo;
485 Stmt q;
486 Glob *pIgnore, *pKeep, *pClean;
487 int nRoot;
488
489 dryRunFlag = find_option("dry-run","n",0)!=0;
490 if( !dryRunFlag ){
491 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
492 }
 
493 allFlag = find_option("force","f",0)!=0;
494 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
495 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
496 zIgnoreFlag = find_option("ignore",0,1);
497 verboseFlag = find_option("verbose","v",0)!=0;
498 zKeepFlag = find_option("keep",0,1);
499 zCleanFlag = find_option("clean",0,1);
500 capture_case_sensitive_option();
501 db_must_be_within_tree();
502 if( zIgnoreFlag==0 ){
503 zIgnoreFlag = db_get("ignore-glob", 0);
504 }
505 if( zKeepFlag==0 ){
506 zKeepFlag = db_get("keep-glob", 0);
507 }
508 if( zCleanFlag==0 ){
509 zCleanFlag = db_get("clean-glob", 0);
510 }
511 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512 pIgnore = glob_create(zIgnoreFlag);
513 pKeep = glob_create(zKeepFlag);
514 pClean = glob_create(zCleanFlag);
515 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
516 glob_free(pKeep);
517 glob_free(pIgnore);
518 db_prepare(&q,
519 "SELECT %Q || x FROM sfile"
520 " WHERE x NOT IN (%s)"
521 " ORDER BY 1",
522 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
523 );
524 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
525 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
526 }
527 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
528 nRoot = (int)strlen(g.zLocalRoot);
529 while( db_step(&q)==SQLITE_ROW ){
530 const char *zName = db_column_text(&q, 0);
531 if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
 
 
 
 
532 Blob ans;
533 char cReply;
534 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
535 zName+nRoot);
536 blob_zero(&ans);
@@ -549,11 +572,12 @@
549 }
550 if( !dryRunFlag ){
551 file_delete(zName);
552 }
553 }
554 glob_free(pClean);
 
555 db_finalize(&q);
556 }
557
558 /*
559 ** Prompt the user for a check-in or stash comment (given in pPrompt),
560
--- src/checkin.c
+++ src/checkin.c
@@ -326,12 +326,11 @@
326 */
327 static void locate_unmanaged_files(
328 int argc, /* Number of command-line arguments to examine */
329 char **argv, /* values of command-line arguments */
330 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331 Glob *pIgnore /* Do not add files that match this GLOB */
 
332 ){
333 Blob name; /* Name of a candidate file or directory */
334 char *zName; /* Name of a candidate file or directory */
335 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
336 int i; /* Loop counter */
@@ -340,19 +339,19 @@
339 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
340 filename_collation());
341 nRoot = (int)strlen(g.zLocalRoot);
342 if( argc==0 ){
343 blob_init(&name, g.zLocalRoot, nRoot - 1);
344 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
345 blob_reset(&name);
346 }else{
347 for(i=0; i<argc; i++){
348 file_canonical_name(argv[i], &name, 0);
349 zName = blob_str(&name);
350 isDir = file_wd_isdir(zName);
351 if( isDir==1 ){
352 vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
353 }else if( isDir==0 ){
354 fossil_warning("not found: %s", zName);
355 }else if( file_access(zName, R_OK) ){
356 fossil_fatal("cannot open %s", zName);
357 }else{
@@ -409,11 +408,11 @@
408 cwdRelative = determine_cwd_relative_option();
409 if( zIgnoreFlag==0 ){
410 zIgnoreFlag = db_get("ignore-glob", 0);
411 }
412 pIgnore = glob_create(zIgnoreFlag);
413 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
414 glob_free(pIgnore);
415 db_prepare(&q,
416 "SELECT x FROM sfile"
417 " WHERE x NOT IN (%s)"
418 " ORDER BY 1",
@@ -444,79 +443,100 @@
443 **
444 ** Delete all "extra" files in the source tree. "Extra" files are
445 ** files that are not officially part of the checkout. This operation
446 ** cannot be undone. If paths are specified, only the directories or
447 ** files specified will be considered for cleaning.
448 **
449 ** WARNING: Normally, only the files unknown to Fossil are removed;
450 ** however, if the --extreme option is specified, all files that are
451 ** not part of the current checkout will be removed as well, without
452 ** regard for the files which are normally ignored.
453 **
454 ** You will be prompted before removing each eligible file unless the
455 ** --force flag is in use or it matches the --ignore option. The
456 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
457 ** --ignore option is omitted, the same with "keep-glob" and --keep.
458 ** If you are sure you wish to remove all "extra" files except the
459 ** ones specified with --ignore and --keep, you can specify the
460 ** optional -f|--force flag and no prompts will be issued. If a
461 ** file matches both --keep and --ignore, --keep takes precedence.
 
462 **
463 ** Files and subdirectories whose names begin with "." are
464 ** normally kept. They are handled if the "--dotfiles" option
465 ** is used.
466 **
467 ** Options:
468 ** --case-sensitive <BOOL> override case-sensitive setting
469 ** --dotfiles Include files beginning with a dot (".").
470 ** -f|--force Remove files without prompting.
 
 
471 ** --ignore <CSG> Ignore files matching patterns from the
472 ** comma separated list of glob patterns.
473 ** --keep <CSG> Keep files matching this comma separated
474 ** list of glob patterns.
475 ** -n|--dry-run If given, display instead of run actions.
476 ** --temp Remove only Fossil-generated temporary files.
477 ** -v|--verbose Show all files as they are removed.
478 ** -x|--extreme Remove all files not part of the current
479 ** checkout, without taking into consideration
480 ** the "ignore-glob" setting and the --ignore
481 ** command line option.
482 ** Compatibile with "git clean -x".
483 **
484 ** See also: addremove, extra, status
485 */
486 void clean_cmd(void){
487 int allFlag, dryRunFlag, verboseFlag, extremeFlag;
488 unsigned scanFlags = 0;
489 const char *zIgnoreFlag, *zKeepFlag;
490 Blob repo;
491 Stmt q;
492 Glob *pIgnore, *pKeep;
493 int nRoot;
494
495 dryRunFlag = find_option("dry-run","n",0)!=0;
496 if( !dryRunFlag ){
497 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
498 }
499 extremeFlag = find_option("extreme","x",0)!=0;
500 allFlag = find_option("force","f",0)!=0;
501 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
502 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
503 zIgnoreFlag = find_option("ignore",0,1);
504 verboseFlag = find_option("verbose","v",0)!=0;
505 zKeepFlag = find_option("keep",0,1);
 
506 capture_case_sensitive_option();
507 db_must_be_within_tree();
508 if( zIgnoreFlag==0 ){
509 zIgnoreFlag = db_get("ignore-glob", 0);
510 }
511 if( zKeepFlag==0 ){
512 zKeepFlag = db_get("keep-glob", 0);
513 }
 
 
 
514 verify_all_options();
515 if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
516 Blob extremeAnswer;
517 char *extremePrompt =
518 "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
519 "that would otherwise be left alone will be deleted (i.e. those\n"
520 "matching the \"ignore-glob\" settings and the --ignore command\n"
521 "line option). As a precaution, in order to proceed with this\n"
522 "clean operation, the string \"YES\" must be entered in all upper\n"
523 "case; any other response will cancel the clean operation.\n\n"
524 "Do you still wish to proceed with the clean operation? ";
525 blob_zero(&extremeAnswer);
526 prompt_user(extremePrompt, &extremeAnswer);
527 if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
528 fossil_print("Extreme clean operation canceled.\n");
529 blob_reset(&extremeAnswer);
530 return;
531 }
532 blob_reset(&extremeAnswer);
533 }
534 nRoot = (int)strlen(g.zLocalRoot);
535 pIgnore = glob_create(zIgnoreFlag);
536 pKeep = glob_create(zKeepFlag);
537 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
 
 
 
538 db_prepare(&q,
539 "SELECT %Q || x FROM sfile"
540 " WHERE x NOT IN (%s)"
541 " ORDER BY 1",
542 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
543 );
544 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
545 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
546 }
547 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
 
548 while( db_step(&q)==SQLITE_ROW ){
549 const char *zName = db_column_text(&q, 0);
550 if( glob_match(pKeep, zName+nRoot) ){
551 fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
552 continue;
553 }
554 if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
555 Blob ans;
556 char cReply;
557 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
558 zName+nRoot);
559 blob_zero(&ans);
@@ -549,11 +572,12 @@
572 }
573 if( !dryRunFlag ){
574 file_delete(zName);
575 }
576 }
577 glob_free(pKeep);
578 glob_free(pIgnore);
579 db_finalize(&q);
580 }
581
582 /*
583 ** Prompt the user for a check-in or stash comment (given in pPrompt),
584
+52 -28
--- src/checkin.c
+++ src/checkin.c
@@ -326,12 +326,11 @@
326326
*/
327327
static void locate_unmanaged_files(
328328
int argc, /* Number of command-line arguments to examine */
329329
char **argv, /* values of command-line arguments */
330330
unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331
- Glob *pIgnore1, /* Do not add files that match this GLOB */
332
- Glob *pIgnore2 /* Omit files matching this GLOB too */
331
+ Glob *pIgnore /* Do not add files that match this GLOB */
333332
){
334333
Blob name; /* Name of a candidate file or directory */
335334
char *zName; /* Name of a candidate file or directory */
336335
int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
337336
int i; /* Loop counter */
@@ -340,19 +339,19 @@
340339
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341340
filename_collation());
342341
nRoot = (int)strlen(g.zLocalRoot);
343342
if( argc==0 ){
344343
blob_init(&name, g.zLocalRoot, nRoot - 1);
345
- vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
344
+ vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
346345
blob_reset(&name);
347346
}else{
348347
for(i=0; i<argc; i++){
349348
file_canonical_name(argv[i], &name, 0);
350349
zName = blob_str(&name);
351350
isDir = file_wd_isdir(zName);
352351
if( isDir==1 ){
353
- vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
352
+ vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
354353
}else if( isDir==0 ){
355354
fossil_warning("not found: %s", zName);
356355
}else if( file_access(zName, R_OK) ){
357356
fossil_fatal("cannot open %s", zName);
358357
}else{
@@ -409,11 +408,11 @@
409408
cwdRelative = determine_cwd_relative_option();
410409
if( zIgnoreFlag==0 ){
411410
zIgnoreFlag = db_get("ignore-glob", 0);
412411
}
413412
pIgnore = glob_create(zIgnoreFlag);
414
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
413
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
415414
glob_free(pIgnore);
416415
db_prepare(&q,
417416
"SELECT x FROM sfile"
418417
" WHERE x NOT IN (%s)"
419418
" ORDER BY 1",
@@ -444,79 +443,100 @@
444443
**
445444
** Delete all "extra" files in the source tree. "Extra" files are
446445
** files that are not officially part of the checkout. This operation
447446
** cannot be undone. If paths are specified, only the directories or
448447
** files specified will be considered for cleaning.
448
+**
449
+** WARNING: Normally, only the files unknown to Fossil are removed;
450
+** however, if the --extreme option is specified, all files that are
451
+** not part of the current checkout will be removed as well, without
452
+** regard for the files which are normally ignored.
449453
**
450454
** You will be prompted before removing each eligible file unless the
451
-** --force flag is in use or it matches the --clean option. The
455
+** --force flag is in use or it matches the --ignore option. The
452456
** GLOBPATTERN specified by the "ignore-glob" setting is used if the
453
-** --ignore option is omitted, the same with "clean-glob" and --clean
454
-** as well as "keep-glob" and --keep. If you are sure you wish to
455
-** remove all "extra" files except the ones specified with --ignore
456
-** and --keep, you can specify the optional -f|--force flag and no
457
-** prompts will be issued. If a file matches both --keep and --clean,
458
-** --keep takes precedence.
457
+** --ignore option is omitted, the same with "keep-glob" and --keep.
458
+** If you are sure you wish to remove all "extra" files except the
459
+** ones specified with --ignore and --keep, you can specify the
460
+** optional -f|--force flag and no prompts will be issued. If a
461
+** file matches both --keep and --ignore, --keep takes precedence.
459462
**
460463
** Files and subdirectories whose names begin with "." are
461464
** normally kept. They are handled if the "--dotfiles" option
462465
** is used.
463466
**
464467
** Options:
465468
** --case-sensitive <BOOL> override case-sensitive setting
466469
** --dotfiles Include files beginning with a dot (".").
467470
** -f|--force Remove files without prompting.
468
-** --clean <CSG> Never prompt for files matching this
469
-** comma separated list of glob patterns.
470471
** --ignore <CSG> Ignore files matching patterns from the
471472
** comma separated list of glob patterns.
472473
** --keep <CSG> Keep files matching this comma separated
473474
** list of glob patterns.
474475
** -n|--dry-run If given, display instead of run actions.
475476
** --temp Remove only Fossil-generated temporary files.
476477
** -v|--verbose Show all files as they are removed.
478
+** -x|--extreme Remove all files not part of the current
479
+** checkout, without taking into consideration
480
+** the "ignore-glob" setting and the --ignore
481
+** command line option.
482
+** Compatibile with "git clean -x".
477483
**
478484
** See also: addremove, extra, status
479485
*/
480486
void clean_cmd(void){
481
- int allFlag, dryRunFlag, verboseFlag;
487
+ int allFlag, dryRunFlag, verboseFlag, extremeFlag;
482488
unsigned scanFlags = 0;
483
- const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
489
+ const char *zIgnoreFlag, *zKeepFlag;
484490
Blob repo;
485491
Stmt q;
486
- Glob *pIgnore, *pKeep, *pClean;
492
+ Glob *pIgnore, *pKeep;
487493
int nRoot;
488494
489495
dryRunFlag = find_option("dry-run","n",0)!=0;
490496
if( !dryRunFlag ){
491497
dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
492498
}
499
+ extremeFlag = find_option("extreme","x",0)!=0;
493500
allFlag = find_option("force","f",0)!=0;
494501
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
495502
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
496503
zIgnoreFlag = find_option("ignore",0,1);
497504
verboseFlag = find_option("verbose","v",0)!=0;
498505
zKeepFlag = find_option("keep",0,1);
499
- zCleanFlag = find_option("clean",0,1);
500506
capture_case_sensitive_option();
501507
db_must_be_within_tree();
502508
if( zIgnoreFlag==0 ){
503509
zIgnoreFlag = db_get("ignore-glob", 0);
504510
}
505511
if( zKeepFlag==0 ){
506512
zKeepFlag = db_get("keep-glob", 0);
507513
}
508
- if( zCleanFlag==0 ){
509
- zCleanFlag = db_get("clean-glob", 0);
510
- }
511514
verify_all_options();
515
+ if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
516
+ Blob extremeAnswer;
517
+ char *extremePrompt =
518
+ "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
519
+ "that would otherwise be left alone will be deleted (i.e. those\n"
520
+ "matching the \"ignore-glob\" settings and the --ignore command\n"
521
+ "line option). As a precaution, in order to proceed with this\n"
522
+ "clean operation, the string \"YES\" must be entered in all upper\n"
523
+ "case; any other response will cancel the clean operation.\n\n"
524
+ "Do you still wish to proceed with the clean operation? ";
525
+ blob_zero(&extremeAnswer);
526
+ prompt_user(extremePrompt, &extremeAnswer);
527
+ if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
528
+ fossil_print("Extreme clean operation canceled.\n");
529
+ blob_reset(&extremeAnswer);
530
+ return;
531
+ }
532
+ blob_reset(&extremeAnswer);
533
+ }
534
+ nRoot = (int)strlen(g.zLocalRoot);
512535
pIgnore = glob_create(zIgnoreFlag);
513536
pKeep = glob_create(zKeepFlag);
514
- pClean = glob_create(zCleanFlag);
515
- locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
516
- glob_free(pKeep);
517
- glob_free(pIgnore);
537
+ locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
518538
db_prepare(&q,
519539
"SELECT %Q || x FROM sfile"
520540
" WHERE x NOT IN (%s)"
521541
" ORDER BY 1",
522542
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
523543
);
524544
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
525545
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
526546
}
527547
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
528
- nRoot = (int)strlen(g.zLocalRoot);
529548
while( db_step(&q)==SQLITE_ROW ){
530549
const char *zName = db_column_text(&q, 0);
531
- if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
550
+ if( glob_match(pKeep, zName+nRoot) ){
551
+ fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
552
+ continue;
553
+ }
554
+ if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
532555
Blob ans;
533556
char cReply;
534557
char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
535558
zName+nRoot);
536559
blob_zero(&ans);
@@ -549,11 +572,12 @@
549572
}
550573
if( !dryRunFlag ){
551574
file_delete(zName);
552575
}
553576
}
554
- glob_free(pClean);
577
+ glob_free(pKeep);
578
+ glob_free(pIgnore);
555579
db_finalize(&q);
556580
}
557581
558582
/*
559583
** Prompt the user for a check-in or stash comment (given in pPrompt),
560584
--- src/checkin.c
+++ src/checkin.c
@@ -326,12 +326,11 @@
326 */
327 static void locate_unmanaged_files(
328 int argc, /* Number of command-line arguments to examine */
329 char **argv, /* values of command-line arguments */
330 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331 Glob *pIgnore1, /* Do not add files that match this GLOB */
332 Glob *pIgnore2 /* Omit files matching this GLOB too */
333 ){
334 Blob name; /* Name of a candidate file or directory */
335 char *zName; /* Name of a candidate file or directory */
336 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
337 int i; /* Loop counter */
@@ -340,19 +339,19 @@
340 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
341 filename_collation());
342 nRoot = (int)strlen(g.zLocalRoot);
343 if( argc==0 ){
344 blob_init(&name, g.zLocalRoot, nRoot - 1);
345 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore1, pIgnore2);
346 blob_reset(&name);
347 }else{
348 for(i=0; i<argc; i++){
349 file_canonical_name(argv[i], &name, 0);
350 zName = blob_str(&name);
351 isDir = file_wd_isdir(zName);
352 if( isDir==1 ){
353 vfile_scan(&name, nRoot-1, scanFlags, pIgnore1, pIgnore2);
354 }else if( isDir==0 ){
355 fossil_warning("not found: %s", zName);
356 }else if( file_access(zName, R_OK) ){
357 fossil_fatal("cannot open %s", zName);
358 }else{
@@ -409,11 +408,11 @@
409 cwdRelative = determine_cwd_relative_option();
410 if( zIgnoreFlag==0 ){
411 zIgnoreFlag = db_get("ignore-glob", 0);
412 }
413 pIgnore = glob_create(zIgnoreFlag);
414 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, 0);
415 glob_free(pIgnore);
416 db_prepare(&q,
417 "SELECT x FROM sfile"
418 " WHERE x NOT IN (%s)"
419 " ORDER BY 1",
@@ -444,79 +443,100 @@
444 **
445 ** Delete all "extra" files in the source tree. "Extra" files are
446 ** files that are not officially part of the checkout. This operation
447 ** cannot be undone. If paths are specified, only the directories or
448 ** files specified will be considered for cleaning.
 
 
 
 
 
449 **
450 ** You will be prompted before removing each eligible file unless the
451 ** --force flag is in use or it matches the --clean option. The
452 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
453 ** --ignore option is omitted, the same with "clean-glob" and --clean
454 ** as well as "keep-glob" and --keep. If you are sure you wish to
455 ** remove all "extra" files except the ones specified with --ignore
456 ** and --keep, you can specify the optional -f|--force flag and no
457 ** prompts will be issued. If a file matches both --keep and --clean,
458 ** --keep takes precedence.
459 **
460 ** Files and subdirectories whose names begin with "." are
461 ** normally kept. They are handled if the "--dotfiles" option
462 ** is used.
463 **
464 ** Options:
465 ** --case-sensitive <BOOL> override case-sensitive setting
466 ** --dotfiles Include files beginning with a dot (".").
467 ** -f|--force Remove files without prompting.
468 ** --clean <CSG> Never prompt for files matching this
469 ** comma separated list of glob patterns.
470 ** --ignore <CSG> Ignore files matching patterns from the
471 ** comma separated list of glob patterns.
472 ** --keep <CSG> Keep files matching this comma separated
473 ** list of glob patterns.
474 ** -n|--dry-run If given, display instead of run actions.
475 ** --temp Remove only Fossil-generated temporary files.
476 ** -v|--verbose Show all files as they are removed.
 
 
 
 
 
477 **
478 ** See also: addremove, extra, status
479 */
480 void clean_cmd(void){
481 int allFlag, dryRunFlag, verboseFlag;
482 unsigned scanFlags = 0;
483 const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag;
484 Blob repo;
485 Stmt q;
486 Glob *pIgnore, *pKeep, *pClean;
487 int nRoot;
488
489 dryRunFlag = find_option("dry-run","n",0)!=0;
490 if( !dryRunFlag ){
491 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
492 }
 
493 allFlag = find_option("force","f",0)!=0;
494 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
495 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
496 zIgnoreFlag = find_option("ignore",0,1);
497 verboseFlag = find_option("verbose","v",0)!=0;
498 zKeepFlag = find_option("keep",0,1);
499 zCleanFlag = find_option("clean",0,1);
500 capture_case_sensitive_option();
501 db_must_be_within_tree();
502 if( zIgnoreFlag==0 ){
503 zIgnoreFlag = db_get("ignore-glob", 0);
504 }
505 if( zKeepFlag==0 ){
506 zKeepFlag = db_get("keep-glob", 0);
507 }
508 if( zCleanFlag==0 ){
509 zCleanFlag = db_get("clean-glob", 0);
510 }
511 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512 pIgnore = glob_create(zIgnoreFlag);
513 pKeep = glob_create(zKeepFlag);
514 pClean = glob_create(zCleanFlag);
515 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore, pKeep);
516 glob_free(pKeep);
517 glob_free(pIgnore);
518 db_prepare(&q,
519 "SELECT %Q || x FROM sfile"
520 " WHERE x NOT IN (%s)"
521 " ORDER BY 1",
522 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
523 );
524 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
525 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
526 }
527 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
528 nRoot = (int)strlen(g.zLocalRoot);
529 while( db_step(&q)==SQLITE_ROW ){
530 const char *zName = db_column_text(&q, 0);
531 if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){
 
 
 
 
532 Blob ans;
533 char cReply;
534 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
535 zName+nRoot);
536 blob_zero(&ans);
@@ -549,11 +572,12 @@
549 }
550 if( !dryRunFlag ){
551 file_delete(zName);
552 }
553 }
554 glob_free(pClean);
 
555 db_finalize(&q);
556 }
557
558 /*
559 ** Prompt the user for a check-in or stash comment (given in pPrompt),
560
--- src/checkin.c
+++ src/checkin.c
@@ -326,12 +326,11 @@
326 */
327 static void locate_unmanaged_files(
328 int argc, /* Number of command-line arguments to examine */
329 char **argv, /* values of command-line arguments */
330 unsigned scanFlags, /* Zero or more SCAN_xxx flags */
331 Glob *pIgnore /* Do not add files that match this GLOB */
 
332 ){
333 Blob name; /* Name of a candidate file or directory */
334 char *zName; /* Name of a candidate file or directory */
335 int isDir; /* 1 for a directory, 0 if doesn't exist, 2 for anything else */
336 int i; /* Loop counter */
@@ -340,19 +339,19 @@
339 db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
340 filename_collation());
341 nRoot = (int)strlen(g.zLocalRoot);
342 if( argc==0 ){
343 blob_init(&name, g.zLocalRoot, nRoot - 1);
344 vfile_scan(&name, blob_size(&name), scanFlags, pIgnore);
345 blob_reset(&name);
346 }else{
347 for(i=0; i<argc; i++){
348 file_canonical_name(argv[i], &name, 0);
349 zName = blob_str(&name);
350 isDir = file_wd_isdir(zName);
351 if( isDir==1 ){
352 vfile_scan(&name, nRoot-1, scanFlags, pIgnore);
353 }else if( isDir==0 ){
354 fossil_warning("not found: %s", zName);
355 }else if( file_access(zName, R_OK) ){
356 fossil_fatal("cannot open %s", zName);
357 }else{
@@ -409,11 +408,11 @@
408 cwdRelative = determine_cwd_relative_option();
409 if( zIgnoreFlag==0 ){
410 zIgnoreFlag = db_get("ignore-glob", 0);
411 }
412 pIgnore = glob_create(zIgnoreFlag);
413 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
414 glob_free(pIgnore);
415 db_prepare(&q,
416 "SELECT x FROM sfile"
417 " WHERE x NOT IN (%s)"
418 " ORDER BY 1",
@@ -444,79 +443,100 @@
443 **
444 ** Delete all "extra" files in the source tree. "Extra" files are
445 ** files that are not officially part of the checkout. This operation
446 ** cannot be undone. If paths are specified, only the directories or
447 ** files specified will be considered for cleaning.
448 **
449 ** WARNING: Normally, only the files unknown to Fossil are removed;
450 ** however, if the --extreme option is specified, all files that are
451 ** not part of the current checkout will be removed as well, without
452 ** regard for the files which are normally ignored.
453 **
454 ** You will be prompted before removing each eligible file unless the
455 ** --force flag is in use or it matches the --ignore option. The
456 ** GLOBPATTERN specified by the "ignore-glob" setting is used if the
457 ** --ignore option is omitted, the same with "keep-glob" and --keep.
458 ** If you are sure you wish to remove all "extra" files except the
459 ** ones specified with --ignore and --keep, you can specify the
460 ** optional -f|--force flag and no prompts will be issued. If a
461 ** file matches both --keep and --ignore, --keep takes precedence.
 
462 **
463 ** Files and subdirectories whose names begin with "." are
464 ** normally kept. They are handled if the "--dotfiles" option
465 ** is used.
466 **
467 ** Options:
468 ** --case-sensitive <BOOL> override case-sensitive setting
469 ** --dotfiles Include files beginning with a dot (".").
470 ** -f|--force Remove files without prompting.
 
 
471 ** --ignore <CSG> Ignore files matching patterns from the
472 ** comma separated list of glob patterns.
473 ** --keep <CSG> Keep files matching this comma separated
474 ** list of glob patterns.
475 ** -n|--dry-run If given, display instead of run actions.
476 ** --temp Remove only Fossil-generated temporary files.
477 ** -v|--verbose Show all files as they are removed.
478 ** -x|--extreme Remove all files not part of the current
479 ** checkout, without taking into consideration
480 ** the "ignore-glob" setting and the --ignore
481 ** command line option.
482 ** Compatibile with "git clean -x".
483 **
484 ** See also: addremove, extra, status
485 */
486 void clean_cmd(void){
487 int allFlag, dryRunFlag, verboseFlag, extremeFlag;
488 unsigned scanFlags = 0;
489 const char *zIgnoreFlag, *zKeepFlag;
490 Blob repo;
491 Stmt q;
492 Glob *pIgnore, *pKeep;
493 int nRoot;
494
495 dryRunFlag = find_option("dry-run","n",0)!=0;
496 if( !dryRunFlag ){
497 dryRunFlag = find_option("test",0,0)!=0; /* deprecated */
498 }
499 extremeFlag = find_option("extreme","x",0)!=0;
500 allFlag = find_option("force","f",0)!=0;
501 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
502 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
503 zIgnoreFlag = find_option("ignore",0,1);
504 verboseFlag = find_option("verbose","v",0)!=0;
505 zKeepFlag = find_option("keep",0,1);
 
506 capture_case_sensitive_option();
507 db_must_be_within_tree();
508 if( zIgnoreFlag==0 ){
509 zIgnoreFlag = db_get("ignore-glob", 0);
510 }
511 if( zKeepFlag==0 ){
512 zKeepFlag = db_get("keep-glob", 0);
513 }
 
 
 
514 verify_all_options();
515 if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){
516 Blob extremeAnswer;
517 char *extremePrompt =
518 "\n\nWARNING: The --extreme option is enabled and all untracked files\n"
519 "that would otherwise be left alone will be deleted (i.e. those\n"
520 "matching the \"ignore-glob\" settings and the --ignore command\n"
521 "line option). As a precaution, in order to proceed with this\n"
522 "clean operation, the string \"YES\" must be entered in all upper\n"
523 "case; any other response will cancel the clean operation.\n\n"
524 "Do you still wish to proceed with the clean operation? ";
525 blob_zero(&extremeAnswer);
526 prompt_user(extremePrompt, &extremeAnswer);
527 if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){
528 fossil_print("Extreme clean operation canceled.\n");
529 blob_reset(&extremeAnswer);
530 return;
531 }
532 blob_reset(&extremeAnswer);
533 }
534 nRoot = (int)strlen(g.zLocalRoot);
535 pIgnore = glob_create(zIgnoreFlag);
536 pKeep = glob_create(zKeepFlag);
537 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, extremeFlag ? 0 : pIgnore);
 
 
 
538 db_prepare(&q,
539 "SELECT %Q || x FROM sfile"
540 " WHERE x NOT IN (%s)"
541 " ORDER BY 1",
542 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -523,14 +543,17 @@
543 );
544 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
545 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
546 }
547 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
 
548 while( db_step(&q)==SQLITE_ROW ){
549 const char *zName = db_column_text(&q, 0);
550 if( glob_match(pKeep, zName+nRoot) ){
551 fossil_print("WARNING: KEPT file \"%s\" not removed\n", zName+nRoot);
552 continue;
553 }
554 if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+nRoot)) ){
555 Blob ans;
556 char cReply;
557 char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ",
558 zName+nRoot);
559 blob_zero(&ans);
@@ -549,11 +572,12 @@
572 }
573 if( !dryRunFlag ){
574 file_delete(zName);
575 }
576 }
577 glob_free(pKeep);
578 glob_free(pIgnore);
579 db_finalize(&q);
580 }
581
582 /*
583 ** Prompt the user for a check-in or stash comment (given in pPrompt),
584
--- 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
+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