Fossil SCM
Rebase. Remove --clean option and "clean-glob" setting. Implement new "allow-clean-x" setting.
Commit
b3201c91110e66c56738ea984cb3d612dd3479d5
Parent
878f7008ab86e24…
16 files changed
-14
-14
+17
+17
+7
-25
+7
-25
+48
-22
+48
-22
-1
-1
+7
-8
+7
-8
-1
-1
+4
-16
+4
-16
-
.fossil-settings/clean-glob
-
.fossil-settings/clean-glob
~
.fossil-settings/ignore-glob
~
.fossil-settings/ignore-glob
~
src/add.c
~
src/add.c
~
src/checkin.c
~
src/checkin.c
~
src/configure.c
~
src/configure.c
~
src/db.c
~
src/db.c
~
src/json_config.c
~
src/json_config.c
~
src/vfile.c
~
src/vfile.c
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 @@ | |
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,2 +1,19 @@ | ||
| 1 | +*.a | |
| 2 | +*.lib | |
| 3 | +*.manifest | |
| 4 | +*.o | |
| 5 | +*.obj | |
| 6 | +*.pdb | |
| 7 | +*.res | |
| 8 | +Makefile | |
| 9 | +bld/* | |
| 10 | +wbld/* | |
| 11 | +win/*.c | |
| 12 | +win/*.h | |
| 13 | +win/*.exe | |
| 14 | +win/headers | |
| 15 | +win/linkopts | |
| 16 | +autoconfig.h | |
| 17 | +config.log | |
| 1 | 18 | fossil |
| 2 | 19 | fossil.exe |
| 3 | 20 |
| --- .fossil-settings/ignore-glob | |
| +++ .fossil-settings/ignore-glob | |
| @@ -1,2 +1,19 @@ | |
| 1 | fossil |
| 2 | fossil.exe |
| 3 |
| --- .fossil-settings/ignore-glob | |
| +++ .fossil-settings/ignore-glob | |
| @@ -1,2 +1,19 @@ | |
| 1 | *.a |
| 2 | *.lib |
| 3 | *.manifest |
| 4 | *.o |
| 5 | *.obj |
| 6 | *.pdb |
| 7 | *.res |
| 8 | Makefile |
| 9 | bld/* |
| 10 | wbld/* |
| 11 | win/*.c |
| 12 | win/*.h |
| 13 | win/*.exe |
| 14 | win/headers |
| 15 | win/linkopts |
| 16 | autoconfig.h |
| 17 | config.log |
| 18 | fossil |
| 19 | fossil.exe |
| 20 |
| --- .fossil-settings/ignore-glob | ||
| +++ .fossil-settings/ignore-glob | ||
| @@ -1,2 +1,19 @@ | ||
| 1 | +*.a | |
| 2 | +*.lib | |
| 3 | +*.manifest | |
| 4 | +*.o | |
| 5 | +*.obj | |
| 6 | +*.pdb | |
| 7 | +*.res | |
| 8 | +Makefile | |
| 9 | +bld/* | |
| 10 | +wbld/* | |
| 11 | +win/*.c | |
| 12 | +win/*.h | |
| 13 | +win/*.exe | |
| 14 | +win/headers | |
| 15 | +win/linkopts | |
| 16 | +autoconfig.h | |
| 17 | +config.log | |
| 1 | 18 | fossil |
| 2 | 19 | fossil.exe |
| 3 | 20 |
| --- .fossil-settings/ignore-glob | |
| +++ .fossil-settings/ignore-glob | |
| @@ -1,2 +1,19 @@ | |
| 1 | fossil |
| 2 | fossil.exe |
| 3 |
| --- .fossil-settings/ignore-glob | |
| +++ .fossil-settings/ignore-glob | |
| @@ -1,2 +1,19 @@ | |
| 1 | *.a |
| 2 | *.lib |
| 3 | *.manifest |
| 4 | *.o |
| 5 | *.obj |
| 6 | *.pdb |
| 7 | *.res |
| 8 | Makefile |
| 9 | bld/* |
| 10 | wbld/* |
| 11 | win/*.c |
| 12 | win/*.h |
| 13 | win/*.exe |
| 14 | win/headers |
| 15 | win/linkopts |
| 16 | autoconfig.h |
| 17 | config.log |
| 18 | fossil |
| 19 | fossil.exe |
| 20 |
+7
-25
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -221,15 +221,14 @@ | ||
| 221 | 221 | ** |
| 222 | 222 | ** When adding files or directories recursively, filenames that begin |
| 223 | 223 | ** with "." are excluded by default. To include such files, add |
| 224 | 224 | ** the "--dotfiles" option to the command-line. |
| 225 | 225 | ** |
| 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 | |
| 227 | 227 | ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore |
| 228 | 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. | |
| 229 | +** is used. | |
| 231 | 230 | ** |
| 232 | 231 | ** The --case-sensitive option determines whether or not filenames should |
| 233 | 232 | ** be treated case sensitive or not. If the option is not given, the default |
| 234 | 233 | ** depends on the global setting, or the operating system default, if not set. |
| 235 | 234 | ** |
| @@ -237,32 +236,25 @@ | ||
| 237 | 236 | ** |
| 238 | 237 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 239 | 238 | ** --dotfiles include files beginning with a dot (".") |
| 240 | 239 | ** --ignore <CSG> ignore files matching patterns from the |
| 241 | 240 | ** comma separated list of glob patterns. |
| 242 | -** --clean <CSG> also ignore files matching patterns from | |
| 243 | -** the comma separated list of glob patterns. | |
| 244 | 241 | ** |
| 245 | 242 | ** See also: addremove, rm |
| 246 | 243 | */ |
| 247 | 244 | void add_cmd(void){ |
| 248 | 245 | int i; /* Loop counter */ |
| 249 | 246 | int vid; /* Currently checked out version */ |
| 250 | 247 | int nRoot; /* Full path characters in g.zLocalRoot */ |
| 251 | - const char *zCleanFlag; /* The --clean option or clean-glob setting */ | |
| 252 | 248 | 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 */ | |
| 254 | 250 | unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ |
| 255 | 251 | |
| 256 | - zCleanFlag = find_option("clean",0,1); | |
| 257 | 252 | zIgnoreFlag = find_option("ignore",0,1); |
| 258 | 253 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 259 | 254 | capture_case_sensitive_option(); |
| 260 | 255 | db_must_be_within_tree(); |
| 261 | - if( zCleanFlag==0 ){ | |
| 262 | - zCleanFlag = db_get("clean-glob", 0); | |
| 263 | - } | |
| 264 | 256 | if( zIgnoreFlag==0 ){ |
| 265 | 257 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | 258 | } |
| 267 | 259 | vid = db_lget_int("checkout",0); |
| 268 | 260 | if( vid==0 ){ |
| @@ -269,11 +261,10 @@ | ||
| 269 | 261 | fossil_panic("no checkout to add to"); |
| 270 | 262 | } |
| 271 | 263 | db_begin_transaction(); |
| 272 | 264 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | 265 | filename_collation()); |
| 274 | - pClean = glob_create(zCleanFlag); | |
| 275 | 266 | pIgnore = glob_create(zIgnoreFlag); |
| 276 | 267 | nRoot = strlen(g.zLocalRoot); |
| 277 | 268 | |
| 278 | 269 | /* Load the names of all files that are to be added into sfile temp table */ |
| 279 | 270 | for(i=2; i<g.argc; i++){ |
| @@ -283,11 +274,11 @@ | ||
| 283 | 274 | |
| 284 | 275 | file_canonical_name(g.argv[i], &fullName, 0); |
| 285 | 276 | zName = blob_str(&fullName); |
| 286 | 277 | isDir = file_wd_isdir(zName); |
| 287 | 278 | if( isDir==1 ){ |
| 288 | - vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore); | |
| 279 | + vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore); | |
| 289 | 280 | }else if( isDir==0 ){ |
| 290 | 281 | fossil_warning("not found: %s", zName); |
| 291 | 282 | }else if( file_access(zName, R_OK) ){ |
| 292 | 283 | fossil_fatal("cannot open %s", zName); |
| 293 | 284 | }else{ |
| @@ -298,11 +289,10 @@ | ||
| 298 | 289 | ); |
| 299 | 290 | } |
| 300 | 291 | blob_reset(&fullName); |
| 301 | 292 | } |
| 302 | 293 | glob_free(pIgnore); |
| 303 | - glob_free(pClean); | |
| 304 | 294 | |
| 305 | 295 | add_files_in_sfile(vid); |
| 306 | 296 | db_end_transaction(0); |
| 307 | 297 | } |
| 308 | 298 | |
| @@ -460,13 +450,12 @@ | ||
| 460 | 450 | ** |
| 461 | 451 | ** Files and directories whose names begin with "." are ignored unless |
| 462 | 452 | ** the --dotfiles option is used. |
| 463 | 453 | ** |
| 464 | 454 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 465 | -** --case-sensitive option with the "case-sensitive" setting and the | |
| 466 | -** --clean option with the "clean-glob" setting. See the documentation | |
| 467 | -** on the "settings" command for further information. | |
| 455 | +** --case-sensitive option with the "case-sensitive" setting. See the | |
| 456 | +** documentation on the "settings" command for further information. | |
| 468 | 457 | ** |
| 469 | 458 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 470 | 459 | ** |
| 471 | 460 | ** This command can be used to track third party software. |
| 472 | 461 | ** |
| @@ -473,12 +462,10 @@ | ||
| 473 | 462 | ** Options: |
| 474 | 463 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 475 | 464 | ** --dotfiles include files beginning with a dot (".") |
| 476 | 465 | ** --ignore <CSG> ignore files matching patterns from the |
| 477 | 466 | ** comma separated list of glob patterns. |
| 478 | -** --clean <CSG> also ignore files matching patterns from | |
| 479 | -** the comma separated list of glob patterns. | |
| 480 | 467 | ** -n|--dry-run If given, display instead of run actions |
| 481 | 468 | ** |
| 482 | 469 | ** See also: add, rm |
| 483 | 470 | */ |
| 484 | 471 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | ||
| 497 | 484 | if( !dryRunFlag ){ |
| 498 | 485 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 499 | 486 | } |
| 500 | 487 | capture_case_sensitive_option(); |
| 501 | 488 | db_must_be_within_tree(); |
| 502 | - if( zCleanFlag==0 ){ | |
| 503 | - zCleanFlag = db_get("clean-glob", 0); | |
| 504 | - } | |
| 505 | 489 | if( zIgnoreFlag==0 ){ |
| 506 | 490 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 507 | 491 | } |
| 508 | 492 | vid = db_lget_int("checkout",0); |
| 509 | 493 | if( vid==0 ){ |
| @@ -520,15 +504,13 @@ | ||
| 520 | 504 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 521 | 505 | filename_collation()); |
| 522 | 506 | n = strlen(g.zLocalRoot); |
| 523 | 507 | blob_init(&path, g.zLocalRoot, n-1); |
| 524 | 508 | /* now we read the complete file structure into a temp table */ |
| 525 | - pClean = glob_create(zCleanFlag); | |
| 526 | 509 | pIgnore = glob_create(zIgnoreFlag); |
| 527 | - vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore); | |
| 510 | + vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); | |
| 528 | 511 | glob_free(pIgnore); |
| 529 | - glob_free(pClean); | |
| 530 | 512 | nAdd = add_files_in_sfile(vid); |
| 531 | 513 | |
| 532 | 514 | /* step 2: search for missing files */ |
| 533 | 515 | db_prepare(&q, |
| 534 | 516 | "SELECT pathname, %Q || pathname, deleted FROM vfile" |
| 535 | 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -221,15 +221,14 @@ | |
| 221 | ** |
| 222 | ** When adding files or directories recursively, filenames that begin |
| 223 | ** with "." are excluded by default. To include such files, add |
| 224 | ** the "--dotfiles" option to the command-line. |
| 225 | ** |
| 226 | ** The --ignore and --clean options are comma-separate lists of glob patterns |
| 227 | ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore |
| 228 | ** option does not appear on the command line then the "ignore-glob" setting |
| 229 | ** is used. If the --clean option does not appear on the command line then |
| 230 | ** the "clean-glob" setting is used. |
| 231 | ** |
| 232 | ** The --case-sensitive option determines whether or not filenames should |
| 233 | ** be treated case sensitive or not. If the option is not given, the default |
| 234 | ** depends on the global setting, or the operating system default, if not set. |
| 235 | ** |
| @@ -237,32 +236,25 @@ | |
| 237 | ** |
| 238 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 239 | ** --dotfiles include files beginning with a dot (".") |
| 240 | ** --ignore <CSG> ignore files matching patterns from the |
| 241 | ** comma separated list of glob patterns. |
| 242 | ** --clean <CSG> also ignore files matching patterns from |
| 243 | ** the comma separated list of glob patterns. |
| 244 | ** |
| 245 | ** See also: addremove, rm |
| 246 | */ |
| 247 | void add_cmd(void){ |
| 248 | int i; /* Loop counter */ |
| 249 | int vid; /* Currently checked out version */ |
| 250 | int nRoot; /* Full path characters in g.zLocalRoot */ |
| 251 | const char *zCleanFlag; /* The --clean option or clean-glob setting */ |
| 252 | const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */ |
| 253 | Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */ |
| 254 | unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ |
| 255 | |
| 256 | zCleanFlag = find_option("clean",0,1); |
| 257 | zIgnoreFlag = find_option("ignore",0,1); |
| 258 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 259 | capture_case_sensitive_option(); |
| 260 | db_must_be_within_tree(); |
| 261 | if( zCleanFlag==0 ){ |
| 262 | zCleanFlag = db_get("clean-glob", 0); |
| 263 | } |
| 264 | if( zIgnoreFlag==0 ){ |
| 265 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | } |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| @@ -269,11 +261,10 @@ | |
| 269 | fossil_panic("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | filename_collation()); |
| 274 | pClean = glob_create(zCleanFlag); |
| 275 | pIgnore = glob_create(zIgnoreFlag); |
| 276 | nRoot = strlen(g.zLocalRoot); |
| 277 | |
| 278 | /* Load the names of all files that are to be added into sfile temp table */ |
| 279 | for(i=2; i<g.argc; i++){ |
| @@ -283,11 +274,11 @@ | |
| 283 | |
| 284 | file_canonical_name(g.argv[i], &fullName, 0); |
| 285 | zName = blob_str(&fullName); |
| 286 | isDir = file_wd_isdir(zName); |
| 287 | if( isDir==1 ){ |
| 288 | vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore); |
| 289 | }else if( isDir==0 ){ |
| 290 | fossil_warning("not found: %s", zName); |
| 291 | }else if( file_access(zName, R_OK) ){ |
| 292 | fossil_fatal("cannot open %s", zName); |
| 293 | }else{ |
| @@ -298,11 +289,10 @@ | |
| 298 | ); |
| 299 | } |
| 300 | blob_reset(&fullName); |
| 301 | } |
| 302 | glob_free(pIgnore); |
| 303 | glob_free(pClean); |
| 304 | |
| 305 | add_files_in_sfile(vid); |
| 306 | db_end_transaction(0); |
| 307 | } |
| 308 | |
| @@ -460,13 +450,12 @@ | |
| 460 | ** |
| 461 | ** Files and directories whose names begin with "." are ignored unless |
| 462 | ** the --dotfiles option is used. |
| 463 | ** |
| 464 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 465 | ** --case-sensitive option with the "case-sensitive" setting and the |
| 466 | ** --clean option with the "clean-glob" setting. See the documentation |
| 467 | ** on the "settings" command for further information. |
| 468 | ** |
| 469 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 470 | ** |
| 471 | ** This command can be used to track third party software. |
| 472 | ** |
| @@ -473,12 +462,10 @@ | |
| 473 | ** Options: |
| 474 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 475 | ** --dotfiles include files beginning with a dot (".") |
| 476 | ** --ignore <CSG> ignore files matching patterns from the |
| 477 | ** comma separated list of glob patterns. |
| 478 | ** --clean <CSG> also ignore files matching patterns from |
| 479 | ** the comma separated list of glob patterns. |
| 480 | ** -n|--dry-run If given, display instead of run actions |
| 481 | ** |
| 482 | ** See also: add, rm |
| 483 | */ |
| 484 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | |
| 497 | if( !dryRunFlag ){ |
| 498 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 499 | } |
| 500 | capture_case_sensitive_option(); |
| 501 | db_must_be_within_tree(); |
| 502 | if( zCleanFlag==0 ){ |
| 503 | zCleanFlag = db_get("clean-glob", 0); |
| 504 | } |
| 505 | if( zIgnoreFlag==0 ){ |
| 506 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 507 | } |
| 508 | vid = db_lget_int("checkout",0); |
| 509 | if( vid==0 ){ |
| @@ -520,15 +504,13 @@ | |
| 520 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 521 | filename_collation()); |
| 522 | n = strlen(g.zLocalRoot); |
| 523 | blob_init(&path, g.zLocalRoot, n-1); |
| 524 | /* now we read the complete file structure into a temp table */ |
| 525 | pClean = glob_create(zCleanFlag); |
| 526 | pIgnore = glob_create(zIgnoreFlag); |
| 527 | vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore); |
| 528 | glob_free(pIgnore); |
| 529 | glob_free(pClean); |
| 530 | nAdd = add_files_in_sfile(vid); |
| 531 | |
| 532 | /* step 2: search for missing files */ |
| 533 | db_prepare(&q, |
| 534 | "SELECT pathname, %Q || pathname, deleted FROM vfile" |
| 535 |
| --- 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 | |
| @@ -460,13 +450,12 @@ | |
| 450 | ** |
| 451 | ** Files and directories whose names begin with "." are ignored unless |
| 452 | ** the --dotfiles option is used. |
| 453 | ** |
| 454 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 455 | ** --case-sensitive option with the "case-sensitive" setting. See the |
| 456 | ** documentation on the "settings" command for further information. |
| 457 | ** |
| 458 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 459 | ** |
| 460 | ** This command can be used to track third party software. |
| 461 | ** |
| @@ -473,12 +462,10 @@ | |
| 462 | ** Options: |
| 463 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 464 | ** --dotfiles include files beginning with a dot (".") |
| 465 | ** --ignore <CSG> ignore files matching patterns from the |
| 466 | ** comma separated list of glob patterns. |
| 467 | ** -n|--dry-run If given, display instead of run actions |
| 468 | ** |
| 469 | ** See also: add, rm |
| 470 | */ |
| 471 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | |
| 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 ){ |
| @@ -520,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 |
+7
-25
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -221,15 +221,14 @@ | ||
| 221 | 221 | ** |
| 222 | 222 | ** When adding files or directories recursively, filenames that begin |
| 223 | 223 | ** with "." are excluded by default. To include such files, add |
| 224 | 224 | ** the "--dotfiles" option to the command-line. |
| 225 | 225 | ** |
| 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 | |
| 227 | 227 | ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore |
| 228 | 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. | |
| 229 | +** is used. | |
| 231 | 230 | ** |
| 232 | 231 | ** The --case-sensitive option determines whether or not filenames should |
| 233 | 232 | ** be treated case sensitive or not. If the option is not given, the default |
| 234 | 233 | ** depends on the global setting, or the operating system default, if not set. |
| 235 | 234 | ** |
| @@ -237,32 +236,25 @@ | ||
| 237 | 236 | ** |
| 238 | 237 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 239 | 238 | ** --dotfiles include files beginning with a dot (".") |
| 240 | 239 | ** --ignore <CSG> ignore files matching patterns from the |
| 241 | 240 | ** comma separated list of glob patterns. |
| 242 | -** --clean <CSG> also ignore files matching patterns from | |
| 243 | -** the comma separated list of glob patterns. | |
| 244 | 241 | ** |
| 245 | 242 | ** See also: addremove, rm |
| 246 | 243 | */ |
| 247 | 244 | void add_cmd(void){ |
| 248 | 245 | int i; /* Loop counter */ |
| 249 | 246 | int vid; /* Currently checked out version */ |
| 250 | 247 | int nRoot; /* Full path characters in g.zLocalRoot */ |
| 251 | - const char *zCleanFlag; /* The --clean option or clean-glob setting */ | |
| 252 | 248 | 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 */ | |
| 254 | 250 | unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ |
| 255 | 251 | |
| 256 | - zCleanFlag = find_option("clean",0,1); | |
| 257 | 252 | zIgnoreFlag = find_option("ignore",0,1); |
| 258 | 253 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 259 | 254 | capture_case_sensitive_option(); |
| 260 | 255 | db_must_be_within_tree(); |
| 261 | - if( zCleanFlag==0 ){ | |
| 262 | - zCleanFlag = db_get("clean-glob", 0); | |
| 263 | - } | |
| 264 | 256 | if( zIgnoreFlag==0 ){ |
| 265 | 257 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | 258 | } |
| 267 | 259 | vid = db_lget_int("checkout",0); |
| 268 | 260 | if( vid==0 ){ |
| @@ -269,11 +261,10 @@ | ||
| 269 | 261 | fossil_panic("no checkout to add to"); |
| 270 | 262 | } |
| 271 | 263 | db_begin_transaction(); |
| 272 | 264 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | 265 | filename_collation()); |
| 274 | - pClean = glob_create(zCleanFlag); | |
| 275 | 266 | pIgnore = glob_create(zIgnoreFlag); |
| 276 | 267 | nRoot = strlen(g.zLocalRoot); |
| 277 | 268 | |
| 278 | 269 | /* Load the names of all files that are to be added into sfile temp table */ |
| 279 | 270 | for(i=2; i<g.argc; i++){ |
| @@ -283,11 +274,11 @@ | ||
| 283 | 274 | |
| 284 | 275 | file_canonical_name(g.argv[i], &fullName, 0); |
| 285 | 276 | zName = blob_str(&fullName); |
| 286 | 277 | isDir = file_wd_isdir(zName); |
| 287 | 278 | if( isDir==1 ){ |
| 288 | - vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore); | |
| 279 | + vfile_scan(&fullName, nRoot-1, scanFlags, pIgnore); | |
| 289 | 280 | }else if( isDir==0 ){ |
| 290 | 281 | fossil_warning("not found: %s", zName); |
| 291 | 282 | }else if( file_access(zName, R_OK) ){ |
| 292 | 283 | fossil_fatal("cannot open %s", zName); |
| 293 | 284 | }else{ |
| @@ -298,11 +289,10 @@ | ||
| 298 | 289 | ); |
| 299 | 290 | } |
| 300 | 291 | blob_reset(&fullName); |
| 301 | 292 | } |
| 302 | 293 | glob_free(pIgnore); |
| 303 | - glob_free(pClean); | |
| 304 | 294 | |
| 305 | 295 | add_files_in_sfile(vid); |
| 306 | 296 | db_end_transaction(0); |
| 307 | 297 | } |
| 308 | 298 | |
| @@ -460,13 +450,12 @@ | ||
| 460 | 450 | ** |
| 461 | 451 | ** Files and directories whose names begin with "." are ignored unless |
| 462 | 452 | ** the --dotfiles option is used. |
| 463 | 453 | ** |
| 464 | 454 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 465 | -** --case-sensitive option with the "case-sensitive" setting and the | |
| 466 | -** --clean option with the "clean-glob" setting. See the documentation | |
| 467 | -** on the "settings" command for further information. | |
| 455 | +** --case-sensitive option with the "case-sensitive" setting. See the | |
| 456 | +** documentation on the "settings" command for further information. | |
| 468 | 457 | ** |
| 469 | 458 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 470 | 459 | ** |
| 471 | 460 | ** This command can be used to track third party software. |
| 472 | 461 | ** |
| @@ -473,12 +462,10 @@ | ||
| 473 | 462 | ** Options: |
| 474 | 463 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 475 | 464 | ** --dotfiles include files beginning with a dot (".") |
| 476 | 465 | ** --ignore <CSG> ignore files matching patterns from the |
| 477 | 466 | ** comma separated list of glob patterns. |
| 478 | -** --clean <CSG> also ignore files matching patterns from | |
| 479 | -** the comma separated list of glob patterns. | |
| 480 | 467 | ** -n|--dry-run If given, display instead of run actions |
| 481 | 468 | ** |
| 482 | 469 | ** See also: add, rm |
| 483 | 470 | */ |
| 484 | 471 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | ||
| 497 | 484 | if( !dryRunFlag ){ |
| 498 | 485 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 499 | 486 | } |
| 500 | 487 | capture_case_sensitive_option(); |
| 501 | 488 | db_must_be_within_tree(); |
| 502 | - if( zCleanFlag==0 ){ | |
| 503 | - zCleanFlag = db_get("clean-glob", 0); | |
| 504 | - } | |
| 505 | 489 | if( zIgnoreFlag==0 ){ |
| 506 | 490 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 507 | 491 | } |
| 508 | 492 | vid = db_lget_int("checkout",0); |
| 509 | 493 | if( vid==0 ){ |
| @@ -520,15 +504,13 @@ | ||
| 520 | 504 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 521 | 505 | filename_collation()); |
| 522 | 506 | n = strlen(g.zLocalRoot); |
| 523 | 507 | blob_init(&path, g.zLocalRoot, n-1); |
| 524 | 508 | /* now we read the complete file structure into a temp table */ |
| 525 | - pClean = glob_create(zCleanFlag); | |
| 526 | 509 | pIgnore = glob_create(zIgnoreFlag); |
| 527 | - vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore); | |
| 510 | + vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); | |
| 528 | 511 | glob_free(pIgnore); |
| 529 | - glob_free(pClean); | |
| 530 | 512 | nAdd = add_files_in_sfile(vid); |
| 531 | 513 | |
| 532 | 514 | /* step 2: search for missing files */ |
| 533 | 515 | db_prepare(&q, |
| 534 | 516 | "SELECT pathname, %Q || pathname, deleted FROM vfile" |
| 535 | 517 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -221,15 +221,14 @@ | |
| 221 | ** |
| 222 | ** When adding files or directories recursively, filenames that begin |
| 223 | ** with "." are excluded by default. To include such files, add |
| 224 | ** the "--dotfiles" option to the command-line. |
| 225 | ** |
| 226 | ** The --ignore and --clean options are comma-separate lists of glob patterns |
| 227 | ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore |
| 228 | ** option does not appear on the command line then the "ignore-glob" setting |
| 229 | ** is used. If the --clean option does not appear on the command line then |
| 230 | ** the "clean-glob" setting is used. |
| 231 | ** |
| 232 | ** The --case-sensitive option determines whether or not filenames should |
| 233 | ** be treated case sensitive or not. If the option is not given, the default |
| 234 | ** depends on the global setting, or the operating system default, if not set. |
| 235 | ** |
| @@ -237,32 +236,25 @@ | |
| 237 | ** |
| 238 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 239 | ** --dotfiles include files beginning with a dot (".") |
| 240 | ** --ignore <CSG> ignore files matching patterns from the |
| 241 | ** comma separated list of glob patterns. |
| 242 | ** --clean <CSG> also ignore files matching patterns from |
| 243 | ** the comma separated list of glob patterns. |
| 244 | ** |
| 245 | ** See also: addremove, rm |
| 246 | */ |
| 247 | void add_cmd(void){ |
| 248 | int i; /* Loop counter */ |
| 249 | int vid; /* Currently checked out version */ |
| 250 | int nRoot; /* Full path characters in g.zLocalRoot */ |
| 251 | const char *zCleanFlag; /* The --clean option or clean-glob setting */ |
| 252 | const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */ |
| 253 | Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */ |
| 254 | unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ |
| 255 | |
| 256 | zCleanFlag = find_option("clean",0,1); |
| 257 | zIgnoreFlag = find_option("ignore",0,1); |
| 258 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 259 | capture_case_sensitive_option(); |
| 260 | db_must_be_within_tree(); |
| 261 | if( zCleanFlag==0 ){ |
| 262 | zCleanFlag = db_get("clean-glob", 0); |
| 263 | } |
| 264 | if( zIgnoreFlag==0 ){ |
| 265 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 266 | } |
| 267 | vid = db_lget_int("checkout",0); |
| 268 | if( vid==0 ){ |
| @@ -269,11 +261,10 @@ | |
| 269 | fossil_panic("no checkout to add to"); |
| 270 | } |
| 271 | db_begin_transaction(); |
| 272 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 273 | filename_collation()); |
| 274 | pClean = glob_create(zCleanFlag); |
| 275 | pIgnore = glob_create(zIgnoreFlag); |
| 276 | nRoot = strlen(g.zLocalRoot); |
| 277 | |
| 278 | /* Load the names of all files that are to be added into sfile temp table */ |
| 279 | for(i=2; i<g.argc; i++){ |
| @@ -283,11 +274,11 @@ | |
| 283 | |
| 284 | file_canonical_name(g.argv[i], &fullName, 0); |
| 285 | zName = blob_str(&fullName); |
| 286 | isDir = file_wd_isdir(zName); |
| 287 | if( isDir==1 ){ |
| 288 | vfile_scan2(&fullName, nRoot-1, scanFlags, pClean, pIgnore); |
| 289 | }else if( isDir==0 ){ |
| 290 | fossil_warning("not found: %s", zName); |
| 291 | }else if( file_access(zName, R_OK) ){ |
| 292 | fossil_fatal("cannot open %s", zName); |
| 293 | }else{ |
| @@ -298,11 +289,10 @@ | |
| 298 | ); |
| 299 | } |
| 300 | blob_reset(&fullName); |
| 301 | } |
| 302 | glob_free(pIgnore); |
| 303 | glob_free(pClean); |
| 304 | |
| 305 | add_files_in_sfile(vid); |
| 306 | db_end_transaction(0); |
| 307 | } |
| 308 | |
| @@ -460,13 +450,12 @@ | |
| 460 | ** |
| 461 | ** Files and directories whose names begin with "." are ignored unless |
| 462 | ** the --dotfiles option is used. |
| 463 | ** |
| 464 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 465 | ** --case-sensitive option with the "case-sensitive" setting and the |
| 466 | ** --clean option with the "clean-glob" setting. See the documentation |
| 467 | ** on the "settings" command for further information. |
| 468 | ** |
| 469 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 470 | ** |
| 471 | ** This command can be used to track third party software. |
| 472 | ** |
| @@ -473,12 +462,10 @@ | |
| 473 | ** Options: |
| 474 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 475 | ** --dotfiles include files beginning with a dot (".") |
| 476 | ** --ignore <CSG> ignore files matching patterns from the |
| 477 | ** comma separated list of glob patterns. |
| 478 | ** --clean <CSG> also ignore files matching patterns from |
| 479 | ** the comma separated list of glob patterns. |
| 480 | ** -n|--dry-run If given, display instead of run actions |
| 481 | ** |
| 482 | ** See also: add, rm |
| 483 | */ |
| 484 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | |
| 497 | if( !dryRunFlag ){ |
| 498 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 499 | } |
| 500 | capture_case_sensitive_option(); |
| 501 | db_must_be_within_tree(); |
| 502 | if( zCleanFlag==0 ){ |
| 503 | zCleanFlag = db_get("clean-glob", 0); |
| 504 | } |
| 505 | if( zIgnoreFlag==0 ){ |
| 506 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 507 | } |
| 508 | vid = db_lget_int("checkout",0); |
| 509 | if( vid==0 ){ |
| @@ -520,15 +504,13 @@ | |
| 520 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 521 | filename_collation()); |
| 522 | n = strlen(g.zLocalRoot); |
| 523 | blob_init(&path, g.zLocalRoot, n-1); |
| 524 | /* now we read the complete file structure into a temp table */ |
| 525 | pClean = glob_create(zCleanFlag); |
| 526 | pIgnore = glob_create(zIgnoreFlag); |
| 527 | vfile_scan2(&path, blob_size(&path), scanFlags, pClean, pIgnore); |
| 528 | glob_free(pIgnore); |
| 529 | glob_free(pClean); |
| 530 | nAdd = add_files_in_sfile(vid); |
| 531 | |
| 532 | /* step 2: search for missing files */ |
| 533 | db_prepare(&q, |
| 534 | "SELECT pathname, %Q || pathname, deleted FROM vfile" |
| 535 |
| --- 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 | |
| @@ -460,13 +450,12 @@ | |
| 450 | ** |
| 451 | ** Files and directories whose names begin with "." are ignored unless |
| 452 | ** the --dotfiles option is used. |
| 453 | ** |
| 454 | ** The --ignore option overrides the "ignore-glob" setting, as do the |
| 455 | ** --case-sensitive option with the "case-sensitive" setting. See the |
| 456 | ** documentation on the "settings" command for further information. |
| 457 | ** |
| 458 | ** The -n|--dry-run option shows what would happen without actually doing anything. |
| 459 | ** |
| 460 | ** This command can be used to track third party software. |
| 461 | ** |
| @@ -473,12 +462,10 @@ | |
| 462 | ** Options: |
| 463 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 464 | ** --dotfiles include files beginning with a dot (".") |
| 465 | ** --ignore <CSG> ignore files matching patterns from the |
| 466 | ** comma separated list of glob patterns. |
| 467 | ** -n|--dry-run If given, display instead of run actions |
| 468 | ** |
| 469 | ** See also: add, rm |
| 470 | */ |
| 471 | void addremove_cmd(void){ |
| @@ -497,13 +484,10 @@ | |
| 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 ){ |
| @@ -520,15 +504,13 @@ | |
| 504 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 505 | filename_collation()); |
| 506 | n = strlen(g.zLocalRoot); |
| 507 | blob_init(&path, g.zLocalRoot, n-1); |
| 508 | /* now we read the complete file structure into a temp table */ |
| 509 | pIgnore = glob_create(zIgnoreFlag); |
| 510 | vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); |
| 511 | glob_free(pIgnore); |
| 512 | nAdd = add_files_in_sfile(vid); |
| 513 | |
| 514 | /* step 2: search for missing files */ |
| 515 | db_prepare(&q, |
| 516 | "SELECT pathname, %Q || pathname, deleted FROM vfile" |
| 517 |
+48
-22
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -382,83 +382,104 @@ | ||
| 382 | 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | 383 | ** |
| 384 | 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | 385 | ** files that are not officially part of the checkout. This operation |
| 386 | 386 | ** cannot be undone. |
| 387 | +** | |
| 388 | +** WARNING: Normally, only the files unknown to Fossil are removed; | |
| 389 | +** however, if the --extreme option is specified, all files that are | |
| 390 | +** not part of the current checkout will be removed as well, without | |
| 391 | +** regard for the files which are normally ignored. | |
| 387 | 392 | ** |
| 388 | 393 | ** You will be prompted before removing each eligible file unless the |
| 389 | -** --force flag is in use or it matches the --clean option. The | |
| 394 | +** --force flag is in use or it matches the --ignore option. The | |
| 390 | 395 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 391 | -** --ignore option is omitted, the same with "clean-glob" and --clean | |
| 392 | -** as well as "keep-glob" and --keep. If you are sure you wish to | |
| 393 | -** remove all "extra" files except the ones specified with --ignore | |
| 394 | -** and --keep, you can specify the optional -f|--force flag and no | |
| 395 | -** prompts will be issued. If a file matches both --keep and --clean, | |
| 396 | -** --keep takes precedence. | |
| 396 | +** --ignore option is omitted, the same with "keep-glob" and --keep. | |
| 397 | +** If you are sure you wish to remove all "extra" files except the | |
| 398 | +** ones specified with --ignore and --keep, you can specify the | |
| 399 | +** optional -f|--force flag and no prompts will be issued. If a | |
| 400 | +** file matches both --keep and --ignore, --keep takes precedence. | |
| 397 | 401 | ** |
| 398 | 402 | ** Files and subdirectories whose names begin with "." are |
| 399 | 403 | ** normally kept. They are handled if the "--dotfiles" option |
| 400 | 404 | ** is used. |
| 401 | 405 | ** |
| 402 | 406 | ** Options: |
| 403 | 407 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 404 | 408 | ** --dotfiles Include files beginning with a dot ("."). |
| 405 | 409 | ** -f|--force Remove files without prompting. |
| 406 | -** --clean <CSG> Never prompt for files matching this | |
| 407 | -** comma separated list of glob patterns. | |
| 408 | 410 | ** --ignore <CSG> Ignore files matching patterns from the |
| 409 | 411 | ** comma separated list of glob patterns. |
| 410 | 412 | ** --keep <CSG> Keep files matching this comma separated |
| 411 | 413 | ** list of glob patterns. |
| 412 | 414 | ** -n|--dry-run If given, display instead of run actions. |
| 413 | 415 | ** --temp Remove only Fossil-generated temporary files. |
| 414 | 416 | ** -v|--verbose Show all files as they are removed. |
| 417 | +** -x|--extreme Remove all files not part of the current | |
| 418 | +** checkout, without taking into consideration | |
| 419 | +** the "ignore-glob" setting and the --ignore | |
| 420 | +** command line option. | |
| 421 | +** Compatibile with "git clean -x". | |
| 415 | 422 | ** |
| 416 | 423 | ** See also: addremove, extra, status |
| 417 | 424 | */ |
| 418 | 425 | void clean_cmd(void){ |
| 419 | - int allFlag, dryRunFlag, verboseFlag; | |
| 426 | + int allFlag, dryRunFlag, verboseFlag, extremeFlag; | |
| 420 | 427 | unsigned scanFlags = 0; |
| 421 | - const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; | |
| 428 | + const char *zIgnoreFlag, *zKeepFlag; | |
| 422 | 429 | Blob path, repo; |
| 423 | 430 | Stmt q; |
| 424 | 431 | int n; |
| 425 | - Glob *pIgnore, *pKeep, *pClean; | |
| 432 | + Glob *pIgnore, *pKeep; | |
| 426 | 433 | |
| 427 | 434 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 428 | 435 | if( !dryRunFlag ){ |
| 429 | 436 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 430 | 437 | } |
| 438 | + extremeFlag = find_option("extreme","x",0)!=0; | |
| 431 | 439 | allFlag = find_option("force","f",0)!=0; |
| 432 | 440 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 433 | 441 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 434 | 442 | zIgnoreFlag = find_option("ignore",0,1); |
| 435 | 443 | verboseFlag = find_option("verbose","v",0)!=0; |
| 436 | 444 | zKeepFlag = find_option("keep",0,1); |
| 437 | - zCleanFlag = find_option("clean",0,1); | |
| 438 | 445 | capture_case_sensitive_option(); |
| 439 | 446 | db_must_be_within_tree(); |
| 440 | 447 | if( zIgnoreFlag==0 ){ |
| 441 | 448 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 442 | 449 | } |
| 443 | 450 | if( zKeepFlag==0 ){ |
| 444 | 451 | zKeepFlag = db_get("keep-glob", 0); |
| 445 | 452 | } |
| 446 | - if( zCleanFlag==0 ){ | |
| 447 | - zCleanFlag = db_get("clean-glob", 0); | |
| 448 | - } | |
| 449 | 453 | verify_all_options(); |
| 454 | + if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){ | |
| 455 | + Blob extremeAnswer; | |
| 456 | + char *extremePrompt = | |
| 457 | + "\n\nWARNING: The --extreme option is enabled and all untracked files\n" | |
| 458 | + "that would otherwise be left alone will be deleted (i.e. those\n" | |
| 459 | + "matching the \"ignore-glob\" settings and the --ignore command\n" | |
| 460 | + "line option). As a precaution, in order to proceed with this\n" | |
| 461 | + "clean operation, the string \"YES\" must be entered in all upper\n" | |
| 462 | + "case; any other response will cancel the clean operation.\n\n" | |
| 463 | + "Do you still wish to proceed with the clean operation? "; | |
| 464 | + blob_zero(&extremeAnswer); | |
| 465 | + prompt_user(extremePrompt, &extremeAnswer); | |
| 466 | + if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){ | |
| 467 | + fossil_print("Extreme clean operation canceled.\n"); | |
| 468 | + blob_reset(&extremeAnswer); | |
| 469 | + return; | |
| 470 | + } | |
| 471 | + blob_reset(&extremeAnswer); | |
| 472 | + } | |
| 450 | 473 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 451 | 474 | filename_collation()); |
| 452 | 475 | n = strlen(g.zLocalRoot); |
| 453 | 476 | blob_init(&path, g.zLocalRoot, n-1); |
| 454 | 477 | pIgnore = glob_create(zIgnoreFlag); |
| 455 | 478 | pKeep = glob_create(zKeepFlag); |
| 456 | - pClean = glob_create(zCleanFlag); | |
| 457 | - vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); | |
| 458 | - glob_free(pKeep); | |
| 459 | - glob_free(pIgnore); | |
| 479 | + vfile_scan(&path, blob_size(&path), scanFlags, | |
| 480 | + extremeFlag ? 0 : pIgnore); | |
| 460 | 481 | db_prepare(&q, |
| 461 | 482 | "SELECT %Q || x FROM sfile" |
| 462 | 483 | " WHERE x NOT IN (%s)" |
| 463 | 484 | " ORDER BY 1", |
| 464 | 485 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | ||
| 467 | 488 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 468 | 489 | } |
| 469 | 490 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 470 | 491 | while( db_step(&q)==SQLITE_ROW ){ |
| 471 | 492 | const char *zName = db_column_text(&q, 0); |
| 472 | - if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){ | |
| 493 | + if( glob_match(pKeep, zName+n) ){ | |
| 494 | + fossil_print("WARNING: KEPT file \"%s\" not removed\n"); | |
| 495 | + continue; | |
| 496 | + } | |
| 497 | + if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){ | |
| 473 | 498 | Blob ans; |
| 474 | 499 | char cReply; |
| 475 | 500 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 476 | 501 | zName+n); |
| 477 | 502 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | ||
| 490 | 515 | } |
| 491 | 516 | if( !dryRunFlag ){ |
| 492 | 517 | file_delete(zName); |
| 493 | 518 | } |
| 494 | 519 | } |
| 495 | - glob_free(pClean); | |
| 520 | + glob_free(pKeep); | |
| 521 | + glob_free(pIgnore); | |
| 496 | 522 | db_finalize(&q); |
| 497 | 523 | } |
| 498 | 524 | |
| 499 | 525 | /* |
| 500 | 526 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 501 | 527 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -382,83 +382,104 @@ | |
| 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | ** |
| 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | ** files that are not officially part of the checkout. This operation |
| 386 | ** cannot be undone. |
| 387 | ** |
| 388 | ** You will be prompted before removing each eligible file unless the |
| 389 | ** --force flag is in use or it matches the --clean option. The |
| 390 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 391 | ** --ignore option is omitted, the same with "clean-glob" and --clean |
| 392 | ** as well as "keep-glob" and --keep. If you are sure you wish to |
| 393 | ** remove all "extra" files except the ones specified with --ignore |
| 394 | ** and --keep, you can specify the optional -f|--force flag and no |
| 395 | ** prompts will be issued. If a file matches both --keep and --clean, |
| 396 | ** --keep takes precedence. |
| 397 | ** |
| 398 | ** Files and subdirectories whose names begin with "." are |
| 399 | ** normally kept. They are handled if the "--dotfiles" option |
| 400 | ** is used. |
| 401 | ** |
| 402 | ** Options: |
| 403 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 404 | ** --dotfiles Include files beginning with a dot ("."). |
| 405 | ** -f|--force Remove files without prompting. |
| 406 | ** --clean <CSG> Never prompt for files matching this |
| 407 | ** comma separated list of glob patterns. |
| 408 | ** --ignore <CSG> Ignore files matching patterns from the |
| 409 | ** comma separated list of glob patterns. |
| 410 | ** --keep <CSG> Keep files matching this comma separated |
| 411 | ** list of glob patterns. |
| 412 | ** -n|--dry-run If given, display instead of run actions. |
| 413 | ** --temp Remove only Fossil-generated temporary files. |
| 414 | ** -v|--verbose Show all files as they are removed. |
| 415 | ** |
| 416 | ** See also: addremove, extra, status |
| 417 | */ |
| 418 | void clean_cmd(void){ |
| 419 | int allFlag, dryRunFlag, verboseFlag; |
| 420 | unsigned scanFlags = 0; |
| 421 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 422 | Blob path, repo; |
| 423 | Stmt q; |
| 424 | int n; |
| 425 | Glob *pIgnore, *pKeep, *pClean; |
| 426 | |
| 427 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 428 | if( !dryRunFlag ){ |
| 429 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 430 | } |
| 431 | allFlag = find_option("force","f",0)!=0; |
| 432 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 433 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 434 | zIgnoreFlag = find_option("ignore",0,1); |
| 435 | verboseFlag = find_option("verbose","v",0)!=0; |
| 436 | zKeepFlag = find_option("keep",0,1); |
| 437 | zCleanFlag = find_option("clean",0,1); |
| 438 | capture_case_sensitive_option(); |
| 439 | db_must_be_within_tree(); |
| 440 | if( zIgnoreFlag==0 ){ |
| 441 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 442 | } |
| 443 | if( zKeepFlag==0 ){ |
| 444 | zKeepFlag = db_get("keep-glob", 0); |
| 445 | } |
| 446 | if( zCleanFlag==0 ){ |
| 447 | zCleanFlag = db_get("clean-glob", 0); |
| 448 | } |
| 449 | verify_all_options(); |
| 450 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 451 | filename_collation()); |
| 452 | n = strlen(g.zLocalRoot); |
| 453 | blob_init(&path, g.zLocalRoot, n-1); |
| 454 | pIgnore = glob_create(zIgnoreFlag); |
| 455 | pKeep = glob_create(zKeepFlag); |
| 456 | pClean = glob_create(zCleanFlag); |
| 457 | vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); |
| 458 | glob_free(pKeep); |
| 459 | glob_free(pIgnore); |
| 460 | db_prepare(&q, |
| 461 | "SELECT %Q || x FROM sfile" |
| 462 | " WHERE x NOT IN (%s)" |
| 463 | " ORDER BY 1", |
| 464 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | |
| 467 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 468 | } |
| 469 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 470 | while( db_step(&q)==SQLITE_ROW ){ |
| 471 | const char *zName = db_column_text(&q, 0); |
| 472 | if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){ |
| 473 | Blob ans; |
| 474 | char cReply; |
| 475 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 476 | zName+n); |
| 477 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | |
| 490 | } |
| 491 | if( !dryRunFlag ){ |
| 492 | file_delete(zName); |
| 493 | } |
| 494 | } |
| 495 | glob_free(pClean); |
| 496 | db_finalize(&q); |
| 497 | } |
| 498 | |
| 499 | /* |
| 500 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 501 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -382,83 +382,104 @@ | |
| 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | ** |
| 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | ** files that are not officially part of the checkout. This operation |
| 386 | ** cannot be undone. |
| 387 | ** |
| 388 | ** WARNING: Normally, only the files unknown to Fossil are removed; |
| 389 | ** however, if the --extreme option is specified, all files that are |
| 390 | ** not part of the current checkout will be removed as well, without |
| 391 | ** regard for the files which are normally ignored. |
| 392 | ** |
| 393 | ** You will be prompted before removing each eligible file unless the |
| 394 | ** --force flag is in use or it matches the --ignore option. The |
| 395 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 396 | ** --ignore option is omitted, the same with "keep-glob" and --keep. |
| 397 | ** If you are sure you wish to remove all "extra" files except the |
| 398 | ** ones specified with --ignore and --keep, you can specify the |
| 399 | ** optional -f|--force flag and no prompts will be issued. If a |
| 400 | ** file matches both --keep and --ignore, --keep takes precedence. |
| 401 | ** |
| 402 | ** Files and subdirectories whose names begin with "." are |
| 403 | ** normally kept. They are handled if the "--dotfiles" option |
| 404 | ** is used. |
| 405 | ** |
| 406 | ** Options: |
| 407 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 408 | ** --dotfiles Include files beginning with a dot ("."). |
| 409 | ** -f|--force Remove files without prompting. |
| 410 | ** --ignore <CSG> Ignore files matching patterns from the |
| 411 | ** comma separated list of glob patterns. |
| 412 | ** --keep <CSG> Keep files matching this comma separated |
| 413 | ** list of glob patterns. |
| 414 | ** -n|--dry-run If given, display instead of run actions. |
| 415 | ** --temp Remove only Fossil-generated temporary files. |
| 416 | ** -v|--verbose Show all files as they are removed. |
| 417 | ** -x|--extreme Remove all files not part of the current |
| 418 | ** checkout, without taking into consideration |
| 419 | ** the "ignore-glob" setting and the --ignore |
| 420 | ** command line option. |
| 421 | ** Compatibile with "git clean -x". |
| 422 | ** |
| 423 | ** See also: addremove, extra, status |
| 424 | */ |
| 425 | void clean_cmd(void){ |
| 426 | int allFlag, dryRunFlag, verboseFlag, extremeFlag; |
| 427 | unsigned scanFlags = 0; |
| 428 | const char *zIgnoreFlag, *zKeepFlag; |
| 429 | Blob path, repo; |
| 430 | Stmt q; |
| 431 | int n; |
| 432 | Glob *pIgnore, *pKeep; |
| 433 | |
| 434 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 435 | if( !dryRunFlag ){ |
| 436 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 437 | } |
| 438 | extremeFlag = find_option("extreme","x",0)!=0; |
| 439 | allFlag = find_option("force","f",0)!=0; |
| 440 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 441 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 442 | zIgnoreFlag = find_option("ignore",0,1); |
| 443 | verboseFlag = find_option("verbose","v",0)!=0; |
| 444 | zKeepFlag = find_option("keep",0,1); |
| 445 | capture_case_sensitive_option(); |
| 446 | db_must_be_within_tree(); |
| 447 | if( zIgnoreFlag==0 ){ |
| 448 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 449 | } |
| 450 | if( zKeepFlag==0 ){ |
| 451 | zKeepFlag = db_get("keep-glob", 0); |
| 452 | } |
| 453 | verify_all_options(); |
| 454 | if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){ |
| 455 | Blob extremeAnswer; |
| 456 | char *extremePrompt = |
| 457 | "\n\nWARNING: The --extreme option is enabled and all untracked files\n" |
| 458 | "that would otherwise be left alone will be deleted (i.e. those\n" |
| 459 | "matching the \"ignore-glob\" settings and the --ignore command\n" |
| 460 | "line option). As a precaution, in order to proceed with this\n" |
| 461 | "clean operation, the string \"YES\" must be entered in all upper\n" |
| 462 | "case; any other response will cancel the clean operation.\n\n" |
| 463 | "Do you still wish to proceed with the clean operation? "; |
| 464 | blob_zero(&extremeAnswer); |
| 465 | prompt_user(extremePrompt, &extremeAnswer); |
| 466 | if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){ |
| 467 | fossil_print("Extreme clean operation canceled.\n"); |
| 468 | blob_reset(&extremeAnswer); |
| 469 | return; |
| 470 | } |
| 471 | blob_reset(&extremeAnswer); |
| 472 | } |
| 473 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 474 | filename_collation()); |
| 475 | n = strlen(g.zLocalRoot); |
| 476 | blob_init(&path, g.zLocalRoot, n-1); |
| 477 | pIgnore = glob_create(zIgnoreFlag); |
| 478 | pKeep = glob_create(zKeepFlag); |
| 479 | vfile_scan(&path, blob_size(&path), scanFlags, |
| 480 | extremeFlag ? 0 : pIgnore); |
| 481 | db_prepare(&q, |
| 482 | "SELECT %Q || x FROM sfile" |
| 483 | " WHERE x NOT IN (%s)" |
| 484 | " ORDER BY 1", |
| 485 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | |
| 488 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 489 | } |
| 490 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 491 | while( db_step(&q)==SQLITE_ROW ){ |
| 492 | const char *zName = db_column_text(&q, 0); |
| 493 | if( glob_match(pKeep, zName+n) ){ |
| 494 | fossil_print("WARNING: KEPT file \"%s\" not removed\n"); |
| 495 | continue; |
| 496 | } |
| 497 | if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){ |
| 498 | Blob ans; |
| 499 | char cReply; |
| 500 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 501 | zName+n); |
| 502 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | |
| 515 | } |
| 516 | if( !dryRunFlag ){ |
| 517 | file_delete(zName); |
| 518 | } |
| 519 | } |
| 520 | glob_free(pKeep); |
| 521 | glob_free(pIgnore); |
| 522 | db_finalize(&q); |
| 523 | } |
| 524 | |
| 525 | /* |
| 526 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 527 |
+48
-22
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -382,83 +382,104 @@ | ||
| 382 | 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | 383 | ** |
| 384 | 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | 385 | ** files that are not officially part of the checkout. This operation |
| 386 | 386 | ** cannot be undone. |
| 387 | +** | |
| 388 | +** WARNING: Normally, only the files unknown to Fossil are removed; | |
| 389 | +** however, if the --extreme option is specified, all files that are | |
| 390 | +** not part of the current checkout will be removed as well, without | |
| 391 | +** regard for the files which are normally ignored. | |
| 387 | 392 | ** |
| 388 | 393 | ** You will be prompted before removing each eligible file unless the |
| 389 | -** --force flag is in use or it matches the --clean option. The | |
| 394 | +** --force flag is in use or it matches the --ignore option. The | |
| 390 | 395 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 391 | -** --ignore option is omitted, the same with "clean-glob" and --clean | |
| 392 | -** as well as "keep-glob" and --keep. If you are sure you wish to | |
| 393 | -** remove all "extra" files except the ones specified with --ignore | |
| 394 | -** and --keep, you can specify the optional -f|--force flag and no | |
| 395 | -** prompts will be issued. If a file matches both --keep and --clean, | |
| 396 | -** --keep takes precedence. | |
| 396 | +** --ignore option is omitted, the same with "keep-glob" and --keep. | |
| 397 | +** If you are sure you wish to remove all "extra" files except the | |
| 398 | +** ones specified with --ignore and --keep, you can specify the | |
| 399 | +** optional -f|--force flag and no prompts will be issued. If a | |
| 400 | +** file matches both --keep and --ignore, --keep takes precedence. | |
| 397 | 401 | ** |
| 398 | 402 | ** Files and subdirectories whose names begin with "." are |
| 399 | 403 | ** normally kept. They are handled if the "--dotfiles" option |
| 400 | 404 | ** is used. |
| 401 | 405 | ** |
| 402 | 406 | ** Options: |
| 403 | 407 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 404 | 408 | ** --dotfiles Include files beginning with a dot ("."). |
| 405 | 409 | ** -f|--force Remove files without prompting. |
| 406 | -** --clean <CSG> Never prompt for files matching this | |
| 407 | -** comma separated list of glob patterns. | |
| 408 | 410 | ** --ignore <CSG> Ignore files matching patterns from the |
| 409 | 411 | ** comma separated list of glob patterns. |
| 410 | 412 | ** --keep <CSG> Keep files matching this comma separated |
| 411 | 413 | ** list of glob patterns. |
| 412 | 414 | ** -n|--dry-run If given, display instead of run actions. |
| 413 | 415 | ** --temp Remove only Fossil-generated temporary files. |
| 414 | 416 | ** -v|--verbose Show all files as they are removed. |
| 417 | +** -x|--extreme Remove all files not part of the current | |
| 418 | +** checkout, without taking into consideration | |
| 419 | +** the "ignore-glob" setting and the --ignore | |
| 420 | +** command line option. | |
| 421 | +** Compatibile with "git clean -x". | |
| 415 | 422 | ** |
| 416 | 423 | ** See also: addremove, extra, status |
| 417 | 424 | */ |
| 418 | 425 | void clean_cmd(void){ |
| 419 | - int allFlag, dryRunFlag, verboseFlag; | |
| 426 | + int allFlag, dryRunFlag, verboseFlag, extremeFlag; | |
| 420 | 427 | unsigned scanFlags = 0; |
| 421 | - const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; | |
| 428 | + const char *zIgnoreFlag, *zKeepFlag; | |
| 422 | 429 | Blob path, repo; |
| 423 | 430 | Stmt q; |
| 424 | 431 | int n; |
| 425 | - Glob *pIgnore, *pKeep, *pClean; | |
| 432 | + Glob *pIgnore, *pKeep; | |
| 426 | 433 | |
| 427 | 434 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 428 | 435 | if( !dryRunFlag ){ |
| 429 | 436 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 430 | 437 | } |
| 438 | + extremeFlag = find_option("extreme","x",0)!=0; | |
| 431 | 439 | allFlag = find_option("force","f",0)!=0; |
| 432 | 440 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 433 | 441 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 434 | 442 | zIgnoreFlag = find_option("ignore",0,1); |
| 435 | 443 | verboseFlag = find_option("verbose","v",0)!=0; |
| 436 | 444 | zKeepFlag = find_option("keep",0,1); |
| 437 | - zCleanFlag = find_option("clean",0,1); | |
| 438 | 445 | capture_case_sensitive_option(); |
| 439 | 446 | db_must_be_within_tree(); |
| 440 | 447 | if( zIgnoreFlag==0 ){ |
| 441 | 448 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 442 | 449 | } |
| 443 | 450 | if( zKeepFlag==0 ){ |
| 444 | 451 | zKeepFlag = db_get("keep-glob", 0); |
| 445 | 452 | } |
| 446 | - if( zCleanFlag==0 ){ | |
| 447 | - zCleanFlag = db_get("clean-glob", 0); | |
| 448 | - } | |
| 449 | 453 | verify_all_options(); |
| 454 | + if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){ | |
| 455 | + Blob extremeAnswer; | |
| 456 | + char *extremePrompt = | |
| 457 | + "\n\nWARNING: The --extreme option is enabled and all untracked files\n" | |
| 458 | + "that would otherwise be left alone will be deleted (i.e. those\n" | |
| 459 | + "matching the \"ignore-glob\" settings and the --ignore command\n" | |
| 460 | + "line option). As a precaution, in order to proceed with this\n" | |
| 461 | + "clean operation, the string \"YES\" must be entered in all upper\n" | |
| 462 | + "case; any other response will cancel the clean operation.\n\n" | |
| 463 | + "Do you still wish to proceed with the clean operation? "; | |
| 464 | + blob_zero(&extremeAnswer); | |
| 465 | + prompt_user(extremePrompt, &extremeAnswer); | |
| 466 | + if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){ | |
| 467 | + fossil_print("Extreme clean operation canceled.\n"); | |
| 468 | + blob_reset(&extremeAnswer); | |
| 469 | + return; | |
| 470 | + } | |
| 471 | + blob_reset(&extremeAnswer); | |
| 472 | + } | |
| 450 | 473 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 451 | 474 | filename_collation()); |
| 452 | 475 | n = strlen(g.zLocalRoot); |
| 453 | 476 | blob_init(&path, g.zLocalRoot, n-1); |
| 454 | 477 | pIgnore = glob_create(zIgnoreFlag); |
| 455 | 478 | pKeep = glob_create(zKeepFlag); |
| 456 | - pClean = glob_create(zCleanFlag); | |
| 457 | - vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); | |
| 458 | - glob_free(pKeep); | |
| 459 | - glob_free(pIgnore); | |
| 479 | + vfile_scan(&path, blob_size(&path), scanFlags, | |
| 480 | + extremeFlag ? 0 : pIgnore); | |
| 460 | 481 | db_prepare(&q, |
| 461 | 482 | "SELECT %Q || x FROM sfile" |
| 462 | 483 | " WHERE x NOT IN (%s)" |
| 463 | 484 | " ORDER BY 1", |
| 464 | 485 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | ||
| 467 | 488 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 468 | 489 | } |
| 469 | 490 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 470 | 491 | while( db_step(&q)==SQLITE_ROW ){ |
| 471 | 492 | const char *zName = db_column_text(&q, 0); |
| 472 | - if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){ | |
| 493 | + if( glob_match(pKeep, zName+n) ){ | |
| 494 | + fossil_print("WARNING: KEPT file \"%s\" not removed\n"); | |
| 495 | + continue; | |
| 496 | + } | |
| 497 | + if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){ | |
| 473 | 498 | Blob ans; |
| 474 | 499 | char cReply; |
| 475 | 500 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 476 | 501 | zName+n); |
| 477 | 502 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | ||
| 490 | 515 | } |
| 491 | 516 | if( !dryRunFlag ){ |
| 492 | 517 | file_delete(zName); |
| 493 | 518 | } |
| 494 | 519 | } |
| 495 | - glob_free(pClean); | |
| 520 | + glob_free(pKeep); | |
| 521 | + glob_free(pIgnore); | |
| 496 | 522 | db_finalize(&q); |
| 497 | 523 | } |
| 498 | 524 | |
| 499 | 525 | /* |
| 500 | 526 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 501 | 527 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -382,83 +382,104 @@ | |
| 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | ** |
| 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | ** files that are not officially part of the checkout. This operation |
| 386 | ** cannot be undone. |
| 387 | ** |
| 388 | ** You will be prompted before removing each eligible file unless the |
| 389 | ** --force flag is in use or it matches the --clean option. The |
| 390 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 391 | ** --ignore option is omitted, the same with "clean-glob" and --clean |
| 392 | ** as well as "keep-glob" and --keep. If you are sure you wish to |
| 393 | ** remove all "extra" files except the ones specified with --ignore |
| 394 | ** and --keep, you can specify the optional -f|--force flag and no |
| 395 | ** prompts will be issued. If a file matches both --keep and --clean, |
| 396 | ** --keep takes precedence. |
| 397 | ** |
| 398 | ** Files and subdirectories whose names begin with "." are |
| 399 | ** normally kept. They are handled if the "--dotfiles" option |
| 400 | ** is used. |
| 401 | ** |
| 402 | ** Options: |
| 403 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 404 | ** --dotfiles Include files beginning with a dot ("."). |
| 405 | ** -f|--force Remove files without prompting. |
| 406 | ** --clean <CSG> Never prompt for files matching this |
| 407 | ** comma separated list of glob patterns. |
| 408 | ** --ignore <CSG> Ignore files matching patterns from the |
| 409 | ** comma separated list of glob patterns. |
| 410 | ** --keep <CSG> Keep files matching this comma separated |
| 411 | ** list of glob patterns. |
| 412 | ** -n|--dry-run If given, display instead of run actions. |
| 413 | ** --temp Remove only Fossil-generated temporary files. |
| 414 | ** -v|--verbose Show all files as they are removed. |
| 415 | ** |
| 416 | ** See also: addremove, extra, status |
| 417 | */ |
| 418 | void clean_cmd(void){ |
| 419 | int allFlag, dryRunFlag, verboseFlag; |
| 420 | unsigned scanFlags = 0; |
| 421 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 422 | Blob path, repo; |
| 423 | Stmt q; |
| 424 | int n; |
| 425 | Glob *pIgnore, *pKeep, *pClean; |
| 426 | |
| 427 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 428 | if( !dryRunFlag ){ |
| 429 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 430 | } |
| 431 | allFlag = find_option("force","f",0)!=0; |
| 432 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 433 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 434 | zIgnoreFlag = find_option("ignore",0,1); |
| 435 | verboseFlag = find_option("verbose","v",0)!=0; |
| 436 | zKeepFlag = find_option("keep",0,1); |
| 437 | zCleanFlag = find_option("clean",0,1); |
| 438 | capture_case_sensitive_option(); |
| 439 | db_must_be_within_tree(); |
| 440 | if( zIgnoreFlag==0 ){ |
| 441 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 442 | } |
| 443 | if( zKeepFlag==0 ){ |
| 444 | zKeepFlag = db_get("keep-glob", 0); |
| 445 | } |
| 446 | if( zCleanFlag==0 ){ |
| 447 | zCleanFlag = db_get("clean-glob", 0); |
| 448 | } |
| 449 | verify_all_options(); |
| 450 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 451 | filename_collation()); |
| 452 | n = strlen(g.zLocalRoot); |
| 453 | blob_init(&path, g.zLocalRoot, n-1); |
| 454 | pIgnore = glob_create(zIgnoreFlag); |
| 455 | pKeep = glob_create(zKeepFlag); |
| 456 | pClean = glob_create(zCleanFlag); |
| 457 | vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); |
| 458 | glob_free(pKeep); |
| 459 | glob_free(pIgnore); |
| 460 | db_prepare(&q, |
| 461 | "SELECT %Q || x FROM sfile" |
| 462 | " WHERE x NOT IN (%s)" |
| 463 | " ORDER BY 1", |
| 464 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | |
| 467 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 468 | } |
| 469 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 470 | while( db_step(&q)==SQLITE_ROW ){ |
| 471 | const char *zName = db_column_text(&q, 0); |
| 472 | if( !allFlag && !dryRunFlag && !glob_match(pClean, zName+n) ){ |
| 473 | Blob ans; |
| 474 | char cReply; |
| 475 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 476 | zName+n); |
| 477 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | |
| 490 | } |
| 491 | if( !dryRunFlag ){ |
| 492 | file_delete(zName); |
| 493 | } |
| 494 | } |
| 495 | glob_free(pClean); |
| 496 | db_finalize(&q); |
| 497 | } |
| 498 | |
| 499 | /* |
| 500 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 501 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -382,83 +382,104 @@ | |
| 382 | ** Usage: %fossil clean ?OPTIONS? |
| 383 | ** |
| 384 | ** Delete all "extra" files in the source tree. "Extra" files are |
| 385 | ** files that are not officially part of the checkout. This operation |
| 386 | ** cannot be undone. |
| 387 | ** |
| 388 | ** WARNING: Normally, only the files unknown to Fossil are removed; |
| 389 | ** however, if the --extreme option is specified, all files that are |
| 390 | ** not part of the current checkout will be removed as well, without |
| 391 | ** regard for the files which are normally ignored. |
| 392 | ** |
| 393 | ** You will be prompted before removing each eligible file unless the |
| 394 | ** --force flag is in use or it matches the --ignore option. The |
| 395 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 396 | ** --ignore option is omitted, the same with "keep-glob" and --keep. |
| 397 | ** If you are sure you wish to remove all "extra" files except the |
| 398 | ** ones specified with --ignore and --keep, you can specify the |
| 399 | ** optional -f|--force flag and no prompts will be issued. If a |
| 400 | ** file matches both --keep and --ignore, --keep takes precedence. |
| 401 | ** |
| 402 | ** Files and subdirectories whose names begin with "." are |
| 403 | ** normally kept. They are handled if the "--dotfiles" option |
| 404 | ** is used. |
| 405 | ** |
| 406 | ** Options: |
| 407 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 408 | ** --dotfiles Include files beginning with a dot ("."). |
| 409 | ** -f|--force Remove files without prompting. |
| 410 | ** --ignore <CSG> Ignore files matching patterns from the |
| 411 | ** comma separated list of glob patterns. |
| 412 | ** --keep <CSG> Keep files matching this comma separated |
| 413 | ** list of glob patterns. |
| 414 | ** -n|--dry-run If given, display instead of run actions. |
| 415 | ** --temp Remove only Fossil-generated temporary files. |
| 416 | ** -v|--verbose Show all files as they are removed. |
| 417 | ** -x|--extreme Remove all files not part of the current |
| 418 | ** checkout, without taking into consideration |
| 419 | ** the "ignore-glob" setting and the --ignore |
| 420 | ** command line option. |
| 421 | ** Compatibile with "git clean -x". |
| 422 | ** |
| 423 | ** See also: addremove, extra, status |
| 424 | */ |
| 425 | void clean_cmd(void){ |
| 426 | int allFlag, dryRunFlag, verboseFlag, extremeFlag; |
| 427 | unsigned scanFlags = 0; |
| 428 | const char *zIgnoreFlag, *zKeepFlag; |
| 429 | Blob path, repo; |
| 430 | Stmt q; |
| 431 | int n; |
| 432 | Glob *pIgnore, *pKeep; |
| 433 | |
| 434 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 435 | if( !dryRunFlag ){ |
| 436 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 437 | } |
| 438 | extremeFlag = find_option("extreme","x",0)!=0; |
| 439 | allFlag = find_option("force","f",0)!=0; |
| 440 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 441 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 442 | zIgnoreFlag = find_option("ignore",0,1); |
| 443 | verboseFlag = find_option("verbose","v",0)!=0; |
| 444 | zKeepFlag = find_option("keep",0,1); |
| 445 | capture_case_sensitive_option(); |
| 446 | db_must_be_within_tree(); |
| 447 | if( zIgnoreFlag==0 ){ |
| 448 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 449 | } |
| 450 | if( zKeepFlag==0 ){ |
| 451 | zKeepFlag = db_get("keep-glob", 0); |
| 452 | } |
| 453 | verify_all_options(); |
| 454 | if( extremeFlag && !dryRunFlag && db_get_boolean("allow-clean-x", 0)==0){ |
| 455 | Blob extremeAnswer; |
| 456 | char *extremePrompt = |
| 457 | "\n\nWARNING: The --extreme option is enabled and all untracked files\n" |
| 458 | "that would otherwise be left alone will be deleted (i.e. those\n" |
| 459 | "matching the \"ignore-glob\" settings and the --ignore command\n" |
| 460 | "line option). As a precaution, in order to proceed with this\n" |
| 461 | "clean operation, the string \"YES\" must be entered in all upper\n" |
| 462 | "case; any other response will cancel the clean operation.\n\n" |
| 463 | "Do you still wish to proceed with the clean operation? "; |
| 464 | blob_zero(&extremeAnswer); |
| 465 | prompt_user(extremePrompt, &extremeAnswer); |
| 466 | if( fossil_strcmp(blob_str(&extremeAnswer), "YES")!=0 ){ |
| 467 | fossil_print("Extreme clean operation canceled.\n"); |
| 468 | blob_reset(&extremeAnswer); |
| 469 | return; |
| 470 | } |
| 471 | blob_reset(&extremeAnswer); |
| 472 | } |
| 473 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 474 | filename_collation()); |
| 475 | n = strlen(g.zLocalRoot); |
| 476 | blob_init(&path, g.zLocalRoot, n-1); |
| 477 | pIgnore = glob_create(zIgnoreFlag); |
| 478 | pKeep = glob_create(zKeepFlag); |
| 479 | vfile_scan(&path, blob_size(&path), scanFlags, |
| 480 | extremeFlag ? 0 : pIgnore); |
| 481 | db_prepare(&q, |
| 482 | "SELECT %Q || x FROM sfile" |
| 483 | " WHERE x NOT IN (%s)" |
| 484 | " ORDER BY 1", |
| 485 | g.zLocalRoot, fossil_all_reserved_names(0) |
| @@ -467,11 +488,15 @@ | |
| 488 | db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo); |
| 489 | } |
| 490 | db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)"); |
| 491 | while( db_step(&q)==SQLITE_ROW ){ |
| 492 | const char *zName = db_column_text(&q, 0); |
| 493 | if( glob_match(pKeep, zName+n) ){ |
| 494 | fossil_print("WARNING: KEPT file \"%s\" not removed\n"); |
| 495 | continue; |
| 496 | } |
| 497 | if( !allFlag && (!extremeFlag || !glob_match(pIgnore, zName+n)) ){ |
| 498 | Blob ans; |
| 499 | char cReply; |
| 500 | char *prompt = mprintf("Remove unmanaged file \"%s\" (a=all/y/N)? ", |
| 501 | zName+n); |
| 502 | blob_zero(&ans); |
| @@ -490,11 +515,12 @@ | |
| 515 | } |
| 516 | if( !dryRunFlag ){ |
| 517 | file_delete(zName); |
| 518 | } |
| 519 | } |
| 520 | glob_free(pKeep); |
| 521 | glob_free(pIgnore); |
| 522 | db_finalize(&q); |
| 523 | } |
| 524 | |
| 525 | /* |
| 526 | ** Prompt the user for a check-in or stash comment (given in pPrompt), |
| 527 |
-1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -101,11 +101,10 @@ | ||
| 101 | 101 | |
| 102 | 102 | { "project-name", CONFIGSET_PROJ }, |
| 103 | 103 | { "project-description", CONFIGSET_PROJ }, |
| 104 | 104 | { "manifest", CONFIGSET_PROJ }, |
| 105 | 105 | { "binary-glob", CONFIGSET_PROJ }, |
| 106 | - { "clean-glob", CONFIGSET_PROJ }, | |
| 107 | 106 | { "ignore-glob", CONFIGSET_PROJ }, |
| 108 | 107 | { "keep-glob", CONFIGSET_PROJ }, |
| 109 | 108 | { "crnl-glob", CONFIGSET_PROJ }, |
| 110 | 109 | { "encoding-glob", CONFIGSET_PROJ }, |
| 111 | 110 | { "empty-dirs", CONFIGSET_PROJ }, |
| 112 | 111 |
| --- 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 |
-1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -101,11 +101,10 @@ | ||
| 101 | 101 | |
| 102 | 102 | { "project-name", CONFIGSET_PROJ }, |
| 103 | 103 | { "project-description", CONFIGSET_PROJ }, |
| 104 | 104 | { "manifest", CONFIGSET_PROJ }, |
| 105 | 105 | { "binary-glob", CONFIGSET_PROJ }, |
| 106 | - { "clean-glob", CONFIGSET_PROJ }, | |
| 107 | 106 | { "ignore-glob", CONFIGSET_PROJ }, |
| 108 | 107 | { "keep-glob", CONFIGSET_PROJ }, |
| 109 | 108 | { "crnl-glob", CONFIGSET_PROJ }, |
| 110 | 109 | { "encoding-glob", CONFIGSET_PROJ }, |
| 111 | 110 | { "empty-dirs", CONFIGSET_PROJ }, |
| 112 | 111 |
| --- 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 |
M
src/db.c
+7
-8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2085,10 +2085,11 @@ | ||
| 2085 | 2085 | char const *def; /* Default value */ |
| 2086 | 2086 | }; |
| 2087 | 2087 | #endif /* INTERFACE */ |
| 2088 | 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | + { "allow-clean-x", 0, 0, 0, "off" }, | |
| 2090 | 2091 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2091 | 2092 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2092 | 2093 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2093 | 2094 | { "auto-shun", 0, 0, 0, "on" }, |
| 2094 | 2095 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | ||
| 2097 | 2098 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2098 | 2099 | { "case-sensitive",0, 0, 0, "off" }, |
| 2099 | 2100 | #else |
| 2100 | 2101 | { "case-sensitive",0, 0, 0, "on" }, |
| 2101 | 2102 | #endif |
| 2102 | - { "clean-glob", 0, 40, 1, "" }, | |
| 2103 | 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | ||
| 2161 | 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | 2163 | ** (existing links in repository created on Unix become |
| 2164 | 2164 | ** plain-text files with link destination path inside). |
| 2165 | 2165 | ** Default: off |
| 2166 | +** | |
| 2167 | +** allow-clean-x If enabled, allow the --extreme option to be used in | |
| 2168 | +** the clean command. | |
| 2169 | +** Default: off | |
| 2166 | 2170 | ** |
| 2167 | 2171 | ** auto-captcha If enabled, the Login page provides a button to |
| 2168 | 2172 | ** fill in the captcha password. Default: on |
| 2169 | 2173 | ** |
| 2170 | 2174 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | ||
| 2189 | 2193 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2190 | 2194 | ** care considered distinct. If FALSE files whose names |
| 2191 | 2195 | ** differ only in case are the same file. Defaults to |
| 2192 | 2196 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2193 | 2197 | ** |
| 2194 | -** clean-glob The VALUE is a comma or newline-separated list of GLOB | |
| 2195 | -** (versionable) patterns specifying files that the "clean" command will | |
| 2196 | -** delete without prompting even when the -force flag has | |
| 2197 | -** not been used. Example: *.a *.lib *.o | |
| 2198 | -** | |
| 2199 | 2198 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2200 | 2199 | ** with gpg. When disabled (the default), commits will |
| 2201 | 2200 | ** be unsigned. Default: off |
| 2202 | 2201 | ** |
| 2203 | 2202 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | ||
| 2247 | 2246 | ** even if the login page request came via HTTP. |
| 2248 | 2247 | ** |
| 2249 | 2248 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2250 | 2249 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2251 | 2250 | ** "clean", and "extra" commands will ignore. |
| 2252 | -** Example: *.log customCode.c notes.txt | |
| 2251 | +** Example: *.log *.a *.lib *.o | |
| 2253 | 2252 | ** |
| 2254 | 2253 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2255 | 2254 | ** (versionable) patterns specifying files that the "clean" command will |
| 2256 | -** keep. | |
| 2255 | +** keep. Example: *.log customCode.c notes.txt | |
| 2257 | 2256 | ** |
| 2258 | 2257 | ** localauth If enabled, require that HTTP connections from |
| 2259 | 2258 | ** 127.0.0.1 be authenticated by password. If |
| 2260 | 2259 | ** false, all HTTP requests from localhost have |
| 2261 | 2260 | ** unrestricted access to the repository. |
| 2262 | 2261 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2085,10 +2085,11 @@ | |
| 2085 | char const *def; /* Default value */ |
| 2086 | }; |
| 2087 | #endif /* INTERFACE */ |
| 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2091 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2092 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2093 | { "auto-shun", 0, 0, 0, "on" }, |
| 2094 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | |
| 2097 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2098 | { "case-sensitive",0, 0, 0, "off" }, |
| 2099 | #else |
| 2100 | { "case-sensitive",0, 0, 0, "on" }, |
| 2101 | #endif |
| 2102 | { "clean-glob", 0, 40, 1, "" }, |
| 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | |
| 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | ** (existing links in repository created on Unix become |
| 2164 | ** plain-text files with link destination path inside). |
| 2165 | ** Default: off |
| 2166 | ** |
| 2167 | ** auto-captcha If enabled, the Login page provides a button to |
| 2168 | ** fill in the captcha password. Default: on |
| 2169 | ** |
| 2170 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | |
| 2189 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2190 | ** care considered distinct. If FALSE files whose names |
| 2191 | ** differ only in case are the same file. Defaults to |
| 2192 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2193 | ** |
| 2194 | ** clean-glob The VALUE is a comma or newline-separated list of GLOB |
| 2195 | ** (versionable) patterns specifying files that the "clean" command will |
| 2196 | ** delete without prompting even when the -force flag has |
| 2197 | ** not been used. Example: *.a *.lib *.o |
| 2198 | ** |
| 2199 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2200 | ** with gpg. When disabled (the default), commits will |
| 2201 | ** be unsigned. Default: off |
| 2202 | ** |
| 2203 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | |
| 2247 | ** even if the login page request came via HTTP. |
| 2248 | ** |
| 2249 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2250 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2251 | ** "clean", and "extra" commands will ignore. |
| 2252 | ** Example: *.log customCode.c notes.txt |
| 2253 | ** |
| 2254 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2255 | ** (versionable) patterns specifying files that the "clean" command will |
| 2256 | ** keep. |
| 2257 | ** |
| 2258 | ** localauth If enabled, require that HTTP connections from |
| 2259 | ** 127.0.0.1 be authenticated by password. If |
| 2260 | ** false, all HTTP requests from localhost have |
| 2261 | ** unrestricted access to the repository. |
| 2262 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2085,10 +2085,11 @@ | |
| 2085 | char const *def; /* Default value */ |
| 2086 | }; |
| 2087 | #endif /* INTERFACE */ |
| 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | { "allow-clean-x", 0, 0, 0, "off" }, |
| 2091 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2092 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2093 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2094 | { "auto-shun", 0, 0, 0, "on" }, |
| 2095 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | |
| 2098 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2099 | { "case-sensitive",0, 0, 0, "off" }, |
| 2100 | #else |
| 2101 | { "case-sensitive",0, 0, 0, "on" }, |
| 2102 | #endif |
| 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | |
| 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | ** (existing links in repository created on Unix become |
| 2164 | ** plain-text files with link destination path inside). |
| 2165 | ** Default: off |
| 2166 | ** |
| 2167 | ** allow-clean-x If enabled, allow the --extreme option to be used in |
| 2168 | ** the clean command. |
| 2169 | ** Default: off |
| 2170 | ** |
| 2171 | ** auto-captcha If enabled, the Login page provides a button to |
| 2172 | ** fill in the captcha password. Default: on |
| 2173 | ** |
| 2174 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | |
| 2193 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2194 | ** care considered distinct. If FALSE files whose names |
| 2195 | ** differ only in case are the same file. Defaults to |
| 2196 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2197 | ** |
| 2198 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2199 | ** with gpg. When disabled (the default), commits will |
| 2200 | ** be unsigned. Default: off |
| 2201 | ** |
| 2202 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | |
| 2246 | ** even if the login page request came via HTTP. |
| 2247 | ** |
| 2248 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2249 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2250 | ** "clean", and "extra" commands will ignore. |
| 2251 | ** Example: *.log *.a *.lib *.o |
| 2252 | ** |
| 2253 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2254 | ** (versionable) patterns specifying files that the "clean" command will |
| 2255 | ** keep. Example: *.log customCode.c notes.txt |
| 2256 | ** |
| 2257 | ** localauth If enabled, require that HTTP connections from |
| 2258 | ** 127.0.0.1 be authenticated by password. If |
| 2259 | ** false, all HTTP requests from localhost have |
| 2260 | ** unrestricted access to the repository. |
| 2261 |
M
src/db.c
+7
-8
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2085,10 +2085,11 @@ | ||
| 2085 | 2085 | char const *def; /* Default value */ |
| 2086 | 2086 | }; |
| 2087 | 2087 | #endif /* INTERFACE */ |
| 2088 | 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | + { "allow-clean-x", 0, 0, 0, "off" }, | |
| 2090 | 2091 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2091 | 2092 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2092 | 2093 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2093 | 2094 | { "auto-shun", 0, 0, 0, "on" }, |
| 2094 | 2095 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | ||
| 2097 | 2098 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2098 | 2099 | { "case-sensitive",0, 0, 0, "off" }, |
| 2099 | 2100 | #else |
| 2100 | 2101 | { "case-sensitive",0, 0, 0, "on" }, |
| 2101 | 2102 | #endif |
| 2102 | - { "clean-glob", 0, 40, 1, "" }, | |
| 2103 | 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | ||
| 2161 | 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | 2163 | ** (existing links in repository created on Unix become |
| 2164 | 2164 | ** plain-text files with link destination path inside). |
| 2165 | 2165 | ** Default: off |
| 2166 | +** | |
| 2167 | +** allow-clean-x If enabled, allow the --extreme option to be used in | |
| 2168 | +** the clean command. | |
| 2169 | +** Default: off | |
| 2166 | 2170 | ** |
| 2167 | 2171 | ** auto-captcha If enabled, the Login page provides a button to |
| 2168 | 2172 | ** fill in the captcha password. Default: on |
| 2169 | 2173 | ** |
| 2170 | 2174 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | ||
| 2189 | 2193 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2190 | 2194 | ** care considered distinct. If FALSE files whose names |
| 2191 | 2195 | ** differ only in case are the same file. Defaults to |
| 2192 | 2196 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2193 | 2197 | ** |
| 2194 | -** clean-glob The VALUE is a comma or newline-separated list of GLOB | |
| 2195 | -** (versionable) patterns specifying files that the "clean" command will | |
| 2196 | -** delete without prompting even when the -force flag has | |
| 2197 | -** not been used. Example: *.a *.lib *.o | |
| 2198 | -** | |
| 2199 | 2198 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2200 | 2199 | ** with gpg. When disabled (the default), commits will |
| 2201 | 2200 | ** be unsigned. Default: off |
| 2202 | 2201 | ** |
| 2203 | 2202 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | ||
| 2247 | 2246 | ** even if the login page request came via HTTP. |
| 2248 | 2247 | ** |
| 2249 | 2248 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2250 | 2249 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2251 | 2250 | ** "clean", and "extra" commands will ignore. |
| 2252 | -** Example: *.log customCode.c notes.txt | |
| 2251 | +** Example: *.log *.a *.lib *.o | |
| 2253 | 2252 | ** |
| 2254 | 2253 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2255 | 2254 | ** (versionable) patterns specifying files that the "clean" command will |
| 2256 | -** keep. | |
| 2255 | +** keep. Example: *.log customCode.c notes.txt | |
| 2257 | 2256 | ** |
| 2258 | 2257 | ** localauth If enabled, require that HTTP connections from |
| 2259 | 2258 | ** 127.0.0.1 be authenticated by password. If |
| 2260 | 2259 | ** false, all HTTP requests from localhost have |
| 2261 | 2260 | ** unrestricted access to the repository. |
| 2262 | 2261 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2085,10 +2085,11 @@ | |
| 2085 | char const *def; /* Default value */ |
| 2086 | }; |
| 2087 | #endif /* INTERFACE */ |
| 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2091 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2092 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2093 | { "auto-shun", 0, 0, 0, "on" }, |
| 2094 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | |
| 2097 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2098 | { "case-sensitive",0, 0, 0, "off" }, |
| 2099 | #else |
| 2100 | { "case-sensitive",0, 0, 0, "on" }, |
| 2101 | #endif |
| 2102 | { "clean-glob", 0, 40, 1, "" }, |
| 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | |
| 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | ** (existing links in repository created on Unix become |
| 2164 | ** plain-text files with link destination path inside). |
| 2165 | ** Default: off |
| 2166 | ** |
| 2167 | ** auto-captcha If enabled, the Login page provides a button to |
| 2168 | ** fill in the captcha password. Default: on |
| 2169 | ** |
| 2170 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | |
| 2189 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2190 | ** care considered distinct. If FALSE files whose names |
| 2191 | ** differ only in case are the same file. Defaults to |
| 2192 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2193 | ** |
| 2194 | ** clean-glob The VALUE is a comma or newline-separated list of GLOB |
| 2195 | ** (versionable) patterns specifying files that the "clean" command will |
| 2196 | ** delete without prompting even when the -force flag has |
| 2197 | ** not been used. Example: *.a *.lib *.o |
| 2198 | ** |
| 2199 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2200 | ** with gpg. When disabled (the default), commits will |
| 2201 | ** be unsigned. Default: off |
| 2202 | ** |
| 2203 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | |
| 2247 | ** even if the login page request came via HTTP. |
| 2248 | ** |
| 2249 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2250 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2251 | ** "clean", and "extra" commands will ignore. |
| 2252 | ** Example: *.log customCode.c notes.txt |
| 2253 | ** |
| 2254 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2255 | ** (versionable) patterns specifying files that the "clean" command will |
| 2256 | ** keep. |
| 2257 | ** |
| 2258 | ** localauth If enabled, require that HTTP connections from |
| 2259 | ** 127.0.0.1 be authenticated by password. If |
| 2260 | ** false, all HTTP requests from localhost have |
| 2261 | ** unrestricted access to the repository. |
| 2262 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2085,10 +2085,11 @@ | |
| 2085 | char const *def; /* Default value */ |
| 2086 | }; |
| 2087 | #endif /* INTERFACE */ |
| 2088 | struct stControlSettings const ctrlSettings[] = { |
| 2089 | { "access-log", 0, 0, 0, "off" }, |
| 2090 | { "allow-clean-x", 0, 0, 0, "off" }, |
| 2091 | { "allow-symlinks",0, 0, 1, "off" }, |
| 2092 | { "auto-captcha", "autocaptcha", 0, 0, "on" }, |
| 2093 | { "auto-hyperlink",0, 0, 0, "on", }, |
| 2094 | { "auto-shun", 0, 0, 0, "on" }, |
| 2095 | { "autosync", 0, 0, 0, "on" }, |
| @@ -2097,11 +2098,10 @@ | |
| 2098 | #if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || defined(__APPLE__) |
| 2099 | { "case-sensitive",0, 0, 0, "off" }, |
| 2100 | #else |
| 2101 | { "case-sensitive",0, 0, 0, "on" }, |
| 2102 | #endif |
| 2103 | { "crnl-glob", 0, 40, 1, "" }, |
| 2104 | { "default-perms", 0, 16, 0, "u" }, |
| 2105 | { "diff-binary", 0, 0, 0, "on" }, |
| 2106 | { "diff-command", 0, 40, 0, "" }, |
| 2107 | { "dont-push", 0, 0, 0, "off" }, |
| @@ -2161,10 +2161,14 @@ | |
| 2161 | ** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2162 | ** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2163 | ** (existing links in repository created on Unix become |
| 2164 | ** plain-text files with link destination path inside). |
| 2165 | ** Default: off |
| 2166 | ** |
| 2167 | ** allow-clean-x If enabled, allow the --extreme option to be used in |
| 2168 | ** the clean command. |
| 2169 | ** Default: off |
| 2170 | ** |
| 2171 | ** auto-captcha If enabled, the Login page provides a button to |
| 2172 | ** fill in the captcha password. Default: on |
| 2173 | ** |
| 2174 | ** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| @@ -2189,15 +2193,10 @@ | |
| 2193 | ** case-sensitive If TRUE, the files whose names differ only in case |
| 2194 | ** care considered distinct. If FALSE files whose names |
| 2195 | ** differ only in case are the same file. Defaults to |
| 2196 | ** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2197 | ** |
| 2198 | ** clearsign When enabled, fossil will attempt to sign all commits |
| 2199 | ** with gpg. When disabled (the default), commits will |
| 2200 | ** be unsigned. Default: off |
| 2201 | ** |
| 2202 | ** crnl-glob A comma or newline-separated list of GLOB patterns for |
| @@ -2247,15 +2246,15 @@ | |
| 2246 | ** even if the login page request came via HTTP. |
| 2247 | ** |
| 2248 | ** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 2249 | ** (versionable) patterns specifying files that the "add", "addremove", |
| 2250 | ** "clean", and "extra" commands will ignore. |
| 2251 | ** Example: *.log *.a *.lib *.o |
| 2252 | ** |
| 2253 | ** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 2254 | ** (versionable) patterns specifying files that the "clean" command will |
| 2255 | ** keep. Example: *.log customCode.c notes.txt |
| 2256 | ** |
| 2257 | ** localauth If enabled, require that HTTP connections from |
| 2258 | ** 127.0.0.1 be authenticated by password. If |
| 2259 | ** false, all HTTP requests from localhost have |
| 2260 | ** unrestricted access to the repository. |
| 2261 |
-1
| --- src/json_config.c | ||
| +++ src/json_config.c | ||
| @@ -64,11 +64,10 @@ | ||
| 64 | 64 | |
| 65 | 65 | { "project-name", CONFIGSET_PROJ }, |
| 66 | 66 | { "project-description", CONFIGSET_PROJ }, |
| 67 | 67 | { "manifest", CONFIGSET_PROJ }, |
| 68 | 68 | { "binary-glob", CONFIGSET_PROJ }, |
| 69 | -{ "clean-glob", CONFIGSET_PROJ }, | |
| 70 | 69 | { "encoding-glob", CONFIGSET_PROJ }, |
| 71 | 70 | { "ignore-glob", CONFIGSET_PROJ }, |
| 72 | 71 | { "keep-glob", CONFIGSET_PROJ }, |
| 73 | 72 | { "crnl-glob", CONFIGSET_PROJ }, |
| 74 | 73 | { "empty-dirs", CONFIGSET_PROJ }, |
| 75 | 74 |
| --- 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 |
-1
| --- src/json_config.c | ||
| +++ src/json_config.c | ||
| @@ -64,11 +64,10 @@ | ||
| 64 | 64 | |
| 65 | 65 | { "project-name", CONFIGSET_PROJ }, |
| 66 | 66 | { "project-description", CONFIGSET_PROJ }, |
| 67 | 67 | { "manifest", CONFIGSET_PROJ }, |
| 68 | 68 | { "binary-glob", CONFIGSET_PROJ }, |
| 69 | -{ "clean-glob", CONFIGSET_PROJ }, | |
| 70 | 69 | { "encoding-glob", CONFIGSET_PROJ }, |
| 71 | 70 | { "ignore-glob", CONFIGSET_PROJ }, |
| 72 | 71 | { "keep-glob", CONFIGSET_PROJ }, |
| 73 | 72 | { "crnl-glob", CONFIGSET_PROJ }, |
| 74 | 73 | { "empty-dirs", CONFIGSET_PROJ }, |
| 75 | 74 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -64,11 +64,10 @@ | |
| 64 | |
| 65 | { "project-name", CONFIGSET_PROJ }, |
| 66 | { "project-description", CONFIGSET_PROJ }, |
| 67 | { "manifest", CONFIGSET_PROJ }, |
| 68 | { "binary-glob", CONFIGSET_PROJ }, |
| 69 | { "clean-glob", CONFIGSET_PROJ }, |
| 70 | { "encoding-glob", CONFIGSET_PROJ }, |
| 71 | { "ignore-glob", CONFIGSET_PROJ }, |
| 72 | { "keep-glob", CONFIGSET_PROJ }, |
| 73 | { "crnl-glob", CONFIGSET_PROJ }, |
| 74 | { "empty-dirs", CONFIGSET_PROJ }, |
| 75 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -64,11 +64,10 @@ | |
| 64 | |
| 65 | { "project-name", CONFIGSET_PROJ }, |
| 66 | { "project-description", CONFIGSET_PROJ }, |
| 67 | { "manifest", CONFIGSET_PROJ }, |
| 68 | { "binary-glob", CONFIGSET_PROJ }, |
| 69 | { "encoding-glob", CONFIGSET_PROJ }, |
| 70 | { "ignore-glob", CONFIGSET_PROJ }, |
| 71 | { "keep-glob", CONFIGSET_PROJ }, |
| 72 | { "crnl-glob", CONFIGSET_PROJ }, |
| 73 | { "empty-dirs", CONFIGSET_PROJ }, |
| 74 |
+4
-16
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -433,20 +433,10 @@ | ||
| 433 | 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | 435 | ** nPrefix characters are elided from the filename. |
| 436 | 436 | */ |
| 437 | 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | - vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0); | |
| 439 | -} | |
| 440 | - | |
| 441 | -void vfile_scan2( | |
| 442 | - Blob *pPath, | |
| 443 | - int nPrefix, | |
| 444 | - unsigned scanFlags, | |
| 445 | - Glob *pIgnore1, | |
| 446 | - Glob *pIgnore2 | |
| 447 | -){ | |
| 448 | 438 | DIR *d; |
| 449 | 439 | int origSize; |
| 450 | 440 | const char *zDir; |
| 451 | 441 | struct dirent *pEntry; |
| 452 | 442 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | ||
| 453 | 443 | static Stmt ins; |
| 454 | 444 | static int depth = 0; |
| 455 | 445 | void *zNative; |
| 456 | 446 | |
| 457 | 447 | origSize = blob_size(pPath); |
| 458 | - if( pIgnore1 || pIgnore2 ){ | |
| 448 | + if( pIgnore ){ | |
| 459 | 449 | blob_appendf(pPath, "/"); |
| 460 | - if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 461 | - if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 450 | + if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 462 | 451 | blob_resize(pPath, origSize); |
| 463 | 452 | } |
| 464 | 453 | if( skipAll ) return; |
| 465 | 454 | |
| 466 | 455 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | ||
| 485 | 474 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 486 | 475 | } |
| 487 | 476 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 488 | 477 | blob_appendf(pPath, "/%s", zUtf8); |
| 489 | 478 | zPath = blob_str(pPath); |
| 490 | - if( glob_match(pIgnore1, &zPath[nPrefix+1]) || | |
| 491 | - glob_match(pIgnore2, &zPath[nPrefix+1]) ){ | |
| 479 | + if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ | |
| 492 | 480 | /* do nothing */ |
| 493 | 481 | }else if( file_wd_isdir(zPath)==1 ){ |
| 494 | 482 | if( !vfile_top_of_checkout(zPath) ){ |
| 495 | - vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); | |
| 483 | + vfile_scan(pPath, nPrefix, scanFlags, pIgnore); | |
| 496 | 484 | } |
| 497 | 485 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 498 | 486 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 499 | 487 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 500 | 488 | db_step(&ins); |
| 501 | 489 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -433,20 +433,10 @@ | |
| 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | ** nPrefix characters are elided from the filename. |
| 436 | */ |
| 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0); |
| 439 | } |
| 440 | |
| 441 | void vfile_scan2( |
| 442 | Blob *pPath, |
| 443 | int nPrefix, |
| 444 | unsigned scanFlags, |
| 445 | Glob *pIgnore1, |
| 446 | Glob *pIgnore2 |
| 447 | ){ |
| 448 | DIR *d; |
| 449 | int origSize; |
| 450 | const char *zDir; |
| 451 | struct dirent *pEntry; |
| 452 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | |
| 453 | static Stmt ins; |
| 454 | static int depth = 0; |
| 455 | void *zNative; |
| 456 | |
| 457 | origSize = blob_size(pPath); |
| 458 | if( pIgnore1 || pIgnore2 ){ |
| 459 | blob_appendf(pPath, "/"); |
| 460 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 461 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 462 | blob_resize(pPath, origSize); |
| 463 | } |
| 464 | if( skipAll ) return; |
| 465 | |
| 466 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | |
| 485 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 486 | } |
| 487 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 488 | blob_appendf(pPath, "/%s", zUtf8); |
| 489 | zPath = blob_str(pPath); |
| 490 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 491 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 492 | /* do nothing */ |
| 493 | }else if( file_wd_isdir(zPath)==1 ){ |
| 494 | if( !vfile_top_of_checkout(zPath) ){ |
| 495 | vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); |
| 496 | } |
| 497 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 498 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 499 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 500 | db_step(&ins); |
| 501 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -433,20 +433,10 @@ | |
| 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | ** nPrefix characters are elided from the filename. |
| 436 | */ |
| 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | DIR *d; |
| 439 | int origSize; |
| 440 | const char *zDir; |
| 441 | struct dirent *pEntry; |
| 442 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | |
| 443 | static Stmt ins; |
| 444 | static int depth = 0; |
| 445 | void *zNative; |
| 446 | |
| 447 | origSize = blob_size(pPath); |
| 448 | if( pIgnore ){ |
| 449 | blob_appendf(pPath, "/"); |
| 450 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 451 | blob_resize(pPath, origSize); |
| 452 | } |
| 453 | if( skipAll ) return; |
| 454 | |
| 455 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | |
| 474 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 475 | } |
| 476 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 477 | blob_appendf(pPath, "/%s", zUtf8); |
| 478 | zPath = blob_str(pPath); |
| 479 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 480 | /* do nothing */ |
| 481 | }else if( file_wd_isdir(zPath)==1 ){ |
| 482 | if( !vfile_top_of_checkout(zPath) ){ |
| 483 | vfile_scan(pPath, nPrefix, scanFlags, pIgnore); |
| 484 | } |
| 485 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 486 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 487 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 488 | db_step(&ins); |
| 489 |
+4
-16
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -433,20 +433,10 @@ | ||
| 433 | 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | 435 | ** nPrefix characters are elided from the filename. |
| 436 | 436 | */ |
| 437 | 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | - vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0); | |
| 439 | -} | |
| 440 | - | |
| 441 | -void vfile_scan2( | |
| 442 | - Blob *pPath, | |
| 443 | - int nPrefix, | |
| 444 | - unsigned scanFlags, | |
| 445 | - Glob *pIgnore1, | |
| 446 | - Glob *pIgnore2 | |
| 447 | -){ | |
| 448 | 438 | DIR *d; |
| 449 | 439 | int origSize; |
| 450 | 440 | const char *zDir; |
| 451 | 441 | struct dirent *pEntry; |
| 452 | 442 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | ||
| 453 | 443 | static Stmt ins; |
| 454 | 444 | static int depth = 0; |
| 455 | 445 | void *zNative; |
| 456 | 446 | |
| 457 | 447 | origSize = blob_size(pPath); |
| 458 | - if( pIgnore1 || pIgnore2 ){ | |
| 448 | + if( pIgnore ){ | |
| 459 | 449 | blob_appendf(pPath, "/"); |
| 460 | - if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 461 | - if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 450 | + if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; | |
| 462 | 451 | blob_resize(pPath, origSize); |
| 463 | 452 | } |
| 464 | 453 | if( skipAll ) return; |
| 465 | 454 | |
| 466 | 455 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | ||
| 485 | 474 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 486 | 475 | } |
| 487 | 476 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 488 | 477 | blob_appendf(pPath, "/%s", zUtf8); |
| 489 | 478 | zPath = blob_str(pPath); |
| 490 | - if( glob_match(pIgnore1, &zPath[nPrefix+1]) || | |
| 491 | - glob_match(pIgnore2, &zPath[nPrefix+1]) ){ | |
| 479 | + if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ | |
| 492 | 480 | /* do nothing */ |
| 493 | 481 | }else if( file_wd_isdir(zPath)==1 ){ |
| 494 | 482 | if( !vfile_top_of_checkout(zPath) ){ |
| 495 | - vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); | |
| 483 | + vfile_scan(pPath, nPrefix, scanFlags, pIgnore); | |
| 496 | 484 | } |
| 497 | 485 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 498 | 486 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 499 | 487 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 500 | 488 | db_step(&ins); |
| 501 | 489 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -433,20 +433,10 @@ | |
| 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | ** nPrefix characters are elided from the filename. |
| 436 | */ |
| 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | vfile_scan2(pPath, nPrefix, scanFlags, pIgnore, 0); |
| 439 | } |
| 440 | |
| 441 | void vfile_scan2( |
| 442 | Blob *pPath, |
| 443 | int nPrefix, |
| 444 | unsigned scanFlags, |
| 445 | Glob *pIgnore1, |
| 446 | Glob *pIgnore2 |
| 447 | ){ |
| 448 | DIR *d; |
| 449 | int origSize; |
| 450 | const char *zDir; |
| 451 | struct dirent *pEntry; |
| 452 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | |
| 453 | static Stmt ins; |
| 454 | static int depth = 0; |
| 455 | void *zNative; |
| 456 | |
| 457 | origSize = blob_size(pPath); |
| 458 | if( pIgnore1 || pIgnore2 ){ |
| 459 | blob_appendf(pPath, "/"); |
| 460 | if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 461 | if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 462 | blob_resize(pPath, origSize); |
| 463 | } |
| 464 | if( skipAll ) return; |
| 465 | |
| 466 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | |
| 485 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 486 | } |
| 487 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 488 | blob_appendf(pPath, "/%s", zUtf8); |
| 489 | zPath = blob_str(pPath); |
| 490 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 491 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 492 | /* do nothing */ |
| 493 | }else if( file_wd_isdir(zPath)==1 ){ |
| 494 | if( !vfile_top_of_checkout(zPath) ){ |
| 495 | vfile_scan2(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); |
| 496 | } |
| 497 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 498 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 499 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 500 | db_step(&ins); |
| 501 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -433,20 +433,10 @@ | |
| 433 | ** Any files or directories that match the glob pattern pIgnore are |
| 434 | ** excluded from the scan. Name matching occurs after the first |
| 435 | ** nPrefix characters are elided from the filename. |
| 436 | */ |
| 437 | void vfile_scan(Blob *pPath, int nPrefix, unsigned scanFlags, Glob *pIgnore){ |
| 438 | DIR *d; |
| 439 | int origSize; |
| 440 | const char *zDir; |
| 441 | struct dirent *pEntry; |
| 442 | int skipAll = 0; |
| @@ -453,14 +443,13 @@ | |
| 443 | static Stmt ins; |
| 444 | static int depth = 0; |
| 445 | void *zNative; |
| 446 | |
| 447 | origSize = blob_size(pPath); |
| 448 | if( pIgnore ){ |
| 449 | blob_appendf(pPath, "/"); |
| 450 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| 451 | blob_resize(pPath, origSize); |
| 452 | } |
| 453 | if( skipAll ) return; |
| 454 | |
| 455 | if( depth==0 ){ |
| @@ -485,16 +474,15 @@ | |
| 474 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 475 | } |
| 476 | zUtf8 = fossil_filename_to_utf8(pEntry->d_name); |
| 477 | blob_appendf(pPath, "/%s", zUtf8); |
| 478 | zPath = blob_str(pPath); |
| 479 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 480 | /* do nothing */ |
| 481 | }else if( file_wd_isdir(zPath)==1 ){ |
| 482 | if( !vfile_top_of_checkout(zPath) ){ |
| 483 | vfile_scan(pPath, nPrefix, scanFlags, pIgnore); |
| 484 | } |
| 485 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 486 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 487 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 488 | db_step(&ins); |
| 489 |