Fossil SCM
rebase
Commit
5dd6b697999699748e209213d94cfe85a14cd794
Parent
1162df8e4125f7a…
5 files changed
+8
-17
+8
-17
-1
-5
-1
+8
-17
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -383,16 +383,15 @@ | ||
| 383 | 383 | ** cannot be undone. |
| 384 | 384 | ** |
| 385 | 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | -** --ignore option is omitted, the same with "clean-glob" and --clean | |
| 389 | -** as well as "keep-glob" and --keep. If you are sure you wish to | |
| 390 | -** remove all "extra" files except the ones specified with --ignore | |
| 391 | -** and --keep, you can specify the optional -f|--force flag and no | |
| 392 | -** prompts will be issued. If a file matches both --keep and --clean, | |
| 393 | -** --keep takes precedence. | |
| 388 | +** --ignore option is omitted, the same with "clean-glob" and --clean. | |
| 389 | +** If you are sure you wish to remove all "extra" files except the | |
| 390 | +** ones specified with --ignore, you can specify the optional | |
| 391 | +** -f|--force flag and no prompts will be issued. If a file matches | |
| 392 | +** both --ignore and --clean, --ignore takes precedence. | |
| 394 | 393 | ** |
| 395 | 394 | ** Files and subdirectories whose names begin with "." are |
| 396 | 395 | ** normally kept. They are handled if the "--dotfiles" option |
| 397 | 396 | ** is used. |
| 398 | 397 | ** |
| @@ -402,25 +401,23 @@ | ||
| 402 | 401 | ** -f|--force Remove files without prompting |
| 403 | 402 | ** --clean <CSG> never prompt for files matching this |
| 404 | 403 | ** comma separated list of glob patterns. |
| 405 | 404 | ** --ignore <CSG> ignore files matching patterns from the |
| 406 | 405 | ** comma separated list of glob patterns. |
| 407 | -** --keep <CSG> keep files matching this comma separated | |
| 408 | -** list of glob patterns. | |
| 409 | 406 | ** -n|--dry-run If given, display instead of run actions |
| 410 | 407 | ** --temp Remove only Fossil-generated temporary files |
| 411 | 408 | ** |
| 412 | 409 | ** See also: addremove, extra, status |
| 413 | 410 | */ |
| 414 | 411 | void clean_cmd(void){ |
| 415 | 412 | int allFlag; |
| 416 | 413 | unsigned scanFlags = 0; |
| 417 | - const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; | |
| 414 | + const char *zIgnoreFlag, *zCleanFlag; | |
| 418 | 415 | Blob path, repo; |
| 419 | 416 | Stmt q; |
| 420 | 417 | int n; |
| 421 | - Glob *pIgnore, *pKeep, *pClean; | |
| 418 | + Glob *pIgnore, *pClean; | |
| 422 | 419 | int dryRunFlag = 0; |
| 423 | 420 | |
| 424 | 421 | allFlag = find_option("force","f",0)!=0; |
| 425 | 422 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 426 | 423 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | ||
| 427 | 424 | zIgnoreFlag = find_option("ignore",0,1); |
| 428 | 425 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 429 | 426 | if( !dryRunFlag ){ |
| 430 | 427 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 431 | 428 | } |
| 432 | - zKeepFlag = find_option("keep",0,1); | |
| 433 | 429 | zCleanFlag = find_option("clean",0,1); |
| 434 | 430 | capture_case_sensitive_option(); |
| 435 | 431 | db_must_be_within_tree(); |
| 436 | 432 | if( zIgnoreFlag==0 ){ |
| 437 | 433 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 438 | 434 | } |
| 439 | - if( zKeepFlag==0 ){ | |
| 440 | - zKeepFlag = db_get("keep-glob", 0); | |
| 441 | - } | |
| 442 | 435 | if( zCleanFlag==0 ){ |
| 443 | 436 | zCleanFlag = db_get("clean-glob", 0); |
| 444 | 437 | } |
| 445 | 438 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 446 | 439 | filename_collation()); |
| 447 | 440 | n = strlen(g.zLocalRoot); |
| 448 | 441 | blob_init(&path, g.zLocalRoot, n-1); |
| 449 | 442 | pIgnore = glob_create(zIgnoreFlag); |
| 450 | - pKeep = glob_create(zKeepFlag); | |
| 451 | 443 | pClean = glob_create(zCleanFlag); |
| 452 | - vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); | |
| 453 | - glob_free(pKeep); | |
| 444 | + vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); | |
| 454 | 445 | glob_free(pIgnore); |
| 455 | 446 | db_prepare(&q, |
| 456 | 447 | "SELECT %Q || x FROM sfile" |
| 457 | 448 | " WHERE x NOT IN (%s)" |
| 458 | 449 | " ORDER BY 1", |
| 459 | 450 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -383,16 +383,15 @@ | |
| 383 | ** cannot be undone. |
| 384 | ** |
| 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | ** --ignore option is omitted, the same with "clean-glob" and --clean |
| 389 | ** as well as "keep-glob" and --keep. If you are sure you wish to |
| 390 | ** remove all "extra" files except the ones specified with --ignore |
| 391 | ** and --keep, you can specify the optional -f|--force flag and no |
| 392 | ** prompts will be issued. If a file matches both --keep and --clean, |
| 393 | ** --keep takes precedence. |
| 394 | ** |
| 395 | ** Files and subdirectories whose names begin with "." are |
| 396 | ** normally kept. They are handled if the "--dotfiles" option |
| 397 | ** is used. |
| 398 | ** |
| @@ -402,25 +401,23 @@ | |
| 402 | ** -f|--force Remove files without prompting |
| 403 | ** --clean <CSG> never prompt for files matching this |
| 404 | ** comma separated list of glob patterns. |
| 405 | ** --ignore <CSG> ignore files matching patterns from the |
| 406 | ** comma separated list of glob patterns. |
| 407 | ** --keep <CSG> keep files matching this comma separated |
| 408 | ** list of glob patterns. |
| 409 | ** -n|--dry-run If given, display instead of run actions |
| 410 | ** --temp Remove only Fossil-generated temporary files |
| 411 | ** |
| 412 | ** See also: addremove, extra, status |
| 413 | */ |
| 414 | void clean_cmd(void){ |
| 415 | int allFlag; |
| 416 | unsigned scanFlags = 0; |
| 417 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 418 | Blob path, repo; |
| 419 | Stmt q; |
| 420 | int n; |
| 421 | Glob *pIgnore, *pKeep, *pClean; |
| 422 | int dryRunFlag = 0; |
| 423 | |
| 424 | allFlag = find_option("force","f",0)!=0; |
| 425 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 426 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | |
| 427 | zIgnoreFlag = find_option("ignore",0,1); |
| 428 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 429 | if( !dryRunFlag ){ |
| 430 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 431 | } |
| 432 | zKeepFlag = find_option("keep",0,1); |
| 433 | zCleanFlag = find_option("clean",0,1); |
| 434 | capture_case_sensitive_option(); |
| 435 | db_must_be_within_tree(); |
| 436 | if( zIgnoreFlag==0 ){ |
| 437 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 438 | } |
| 439 | if( zKeepFlag==0 ){ |
| 440 | zKeepFlag = db_get("keep-glob", 0); |
| 441 | } |
| 442 | if( zCleanFlag==0 ){ |
| 443 | zCleanFlag = db_get("clean-glob", 0); |
| 444 | } |
| 445 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 446 | filename_collation()); |
| 447 | n = strlen(g.zLocalRoot); |
| 448 | blob_init(&path, g.zLocalRoot, n-1); |
| 449 | pIgnore = glob_create(zIgnoreFlag); |
| 450 | pKeep = glob_create(zKeepFlag); |
| 451 | pClean = glob_create(zCleanFlag); |
| 452 | vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); |
| 453 | glob_free(pKeep); |
| 454 | glob_free(pIgnore); |
| 455 | db_prepare(&q, |
| 456 | "SELECT %Q || x FROM sfile" |
| 457 | " WHERE x NOT IN (%s)" |
| 458 | " ORDER BY 1", |
| 459 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -383,16 +383,15 @@ | |
| 383 | ** cannot be undone. |
| 384 | ** |
| 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | ** --ignore option is omitted, the same with "clean-glob" and --clean. |
| 389 | ** If you are sure you wish to remove all "extra" files except the |
| 390 | ** ones specified with --ignore, you can specify the optional |
| 391 | ** -f|--force flag and no prompts will be issued. If a file matches |
| 392 | ** both --ignore and --clean, --ignore takes precedence. |
| 393 | ** |
| 394 | ** Files and subdirectories whose names begin with "." are |
| 395 | ** normally kept. They are handled if the "--dotfiles" option |
| 396 | ** is used. |
| 397 | ** |
| @@ -402,25 +401,23 @@ | |
| 401 | ** -f|--force Remove files without prompting |
| 402 | ** --clean <CSG> never prompt for files matching this |
| 403 | ** comma separated list of glob patterns. |
| 404 | ** --ignore <CSG> ignore files matching patterns from the |
| 405 | ** comma separated list of glob patterns. |
| 406 | ** -n|--dry-run If given, display instead of run actions |
| 407 | ** --temp Remove only Fossil-generated temporary files |
| 408 | ** |
| 409 | ** See also: addremove, extra, status |
| 410 | */ |
| 411 | void clean_cmd(void){ |
| 412 | int allFlag; |
| 413 | unsigned scanFlags = 0; |
| 414 | const char *zIgnoreFlag, *zCleanFlag; |
| 415 | Blob path, repo; |
| 416 | Stmt q; |
| 417 | int n; |
| 418 | Glob *pIgnore, *pClean; |
| 419 | int dryRunFlag = 0; |
| 420 | |
| 421 | allFlag = find_option("force","f",0)!=0; |
| 422 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 423 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | |
| 424 | zIgnoreFlag = find_option("ignore",0,1); |
| 425 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 426 | if( !dryRunFlag ){ |
| 427 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 428 | } |
| 429 | zCleanFlag = find_option("clean",0,1); |
| 430 | capture_case_sensitive_option(); |
| 431 | db_must_be_within_tree(); |
| 432 | if( zIgnoreFlag==0 ){ |
| 433 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 434 | } |
| 435 | if( zCleanFlag==0 ){ |
| 436 | zCleanFlag = db_get("clean-glob", 0); |
| 437 | } |
| 438 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 439 | filename_collation()); |
| 440 | n = strlen(g.zLocalRoot); |
| 441 | blob_init(&path, g.zLocalRoot, n-1); |
| 442 | pIgnore = glob_create(zIgnoreFlag); |
| 443 | pClean = glob_create(zCleanFlag); |
| 444 | vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); |
| 445 | glob_free(pIgnore); |
| 446 | db_prepare(&q, |
| 447 | "SELECT %Q || x FROM sfile" |
| 448 | " WHERE x NOT IN (%s)" |
| 449 | " ORDER BY 1", |
| 450 |
+8
-17
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -383,16 +383,15 @@ | ||
| 383 | 383 | ** cannot be undone. |
| 384 | 384 | ** |
| 385 | 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | -** --ignore option is omitted, the same with "clean-glob" and --clean | |
| 389 | -** as well as "keep-glob" and --keep. If you are sure you wish to | |
| 390 | -** remove all "extra" files except the ones specified with --ignore | |
| 391 | -** and --keep, you can specify the optional -f|--force flag and no | |
| 392 | -** prompts will be issued. If a file matches both --keep and --clean, | |
| 393 | -** --keep takes precedence. | |
| 388 | +** --ignore option is omitted, the same with "clean-glob" and --clean. | |
| 389 | +** If you are sure you wish to remove all "extra" files except the | |
| 390 | +** ones specified with --ignore, you can specify the optional | |
| 391 | +** -f|--force flag and no prompts will be issued. If a file matches | |
| 392 | +** both --ignore and --clean, --ignore takes precedence. | |
| 394 | 393 | ** |
| 395 | 394 | ** Files and subdirectories whose names begin with "." are |
| 396 | 395 | ** normally kept. They are handled if the "--dotfiles" option |
| 397 | 396 | ** is used. |
| 398 | 397 | ** |
| @@ -402,25 +401,23 @@ | ||
| 402 | 401 | ** -f|--force Remove files without prompting |
| 403 | 402 | ** --clean <CSG> never prompt for files matching this |
| 404 | 403 | ** comma separated list of glob patterns. |
| 405 | 404 | ** --ignore <CSG> ignore files matching patterns from the |
| 406 | 405 | ** comma separated list of glob patterns. |
| 407 | -** --keep <CSG> keep files matching this comma separated | |
| 408 | -** list of glob patterns. | |
| 409 | 406 | ** -n|--dry-run If given, display instead of run actions |
| 410 | 407 | ** --temp Remove only Fossil-generated temporary files |
| 411 | 408 | ** |
| 412 | 409 | ** See also: addremove, extra, status |
| 413 | 410 | */ |
| 414 | 411 | void clean_cmd(void){ |
| 415 | 412 | int allFlag; |
| 416 | 413 | unsigned scanFlags = 0; |
| 417 | - const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; | |
| 414 | + const char *zIgnoreFlag, *zCleanFlag; | |
| 418 | 415 | Blob path, repo; |
| 419 | 416 | Stmt q; |
| 420 | 417 | int n; |
| 421 | - Glob *pIgnore, *pKeep, *pClean; | |
| 418 | + Glob *pIgnore, *pClean; | |
| 422 | 419 | int dryRunFlag = 0; |
| 423 | 420 | |
| 424 | 421 | allFlag = find_option("force","f",0)!=0; |
| 425 | 422 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 426 | 423 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | ||
| 427 | 424 | zIgnoreFlag = find_option("ignore",0,1); |
| 428 | 425 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 429 | 426 | if( !dryRunFlag ){ |
| 430 | 427 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 431 | 428 | } |
| 432 | - zKeepFlag = find_option("keep",0,1); | |
| 433 | 429 | zCleanFlag = find_option("clean",0,1); |
| 434 | 430 | capture_case_sensitive_option(); |
| 435 | 431 | db_must_be_within_tree(); |
| 436 | 432 | if( zIgnoreFlag==0 ){ |
| 437 | 433 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 438 | 434 | } |
| 439 | - if( zKeepFlag==0 ){ | |
| 440 | - zKeepFlag = db_get("keep-glob", 0); | |
| 441 | - } | |
| 442 | 435 | if( zCleanFlag==0 ){ |
| 443 | 436 | zCleanFlag = db_get("clean-glob", 0); |
| 444 | 437 | } |
| 445 | 438 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 446 | 439 | filename_collation()); |
| 447 | 440 | n = strlen(g.zLocalRoot); |
| 448 | 441 | blob_init(&path, g.zLocalRoot, n-1); |
| 449 | 442 | pIgnore = glob_create(zIgnoreFlag); |
| 450 | - pKeep = glob_create(zKeepFlag); | |
| 451 | 443 | pClean = glob_create(zCleanFlag); |
| 452 | - vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); | |
| 453 | - glob_free(pKeep); | |
| 444 | + vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); | |
| 454 | 445 | glob_free(pIgnore); |
| 455 | 446 | db_prepare(&q, |
| 456 | 447 | "SELECT %Q || x FROM sfile" |
| 457 | 448 | " WHERE x NOT IN (%s)" |
| 458 | 449 | " ORDER BY 1", |
| 459 | 450 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -383,16 +383,15 @@ | |
| 383 | ** cannot be undone. |
| 384 | ** |
| 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | ** --ignore option is omitted, the same with "clean-glob" and --clean |
| 389 | ** as well as "keep-glob" and --keep. If you are sure you wish to |
| 390 | ** remove all "extra" files except the ones specified with --ignore |
| 391 | ** and --keep, you can specify the optional -f|--force flag and no |
| 392 | ** prompts will be issued. If a file matches both --keep and --clean, |
| 393 | ** --keep takes precedence. |
| 394 | ** |
| 395 | ** Files and subdirectories whose names begin with "." are |
| 396 | ** normally kept. They are handled if the "--dotfiles" option |
| 397 | ** is used. |
| 398 | ** |
| @@ -402,25 +401,23 @@ | |
| 402 | ** -f|--force Remove files without prompting |
| 403 | ** --clean <CSG> never prompt for files matching this |
| 404 | ** comma separated list of glob patterns. |
| 405 | ** --ignore <CSG> ignore files matching patterns from the |
| 406 | ** comma separated list of glob patterns. |
| 407 | ** --keep <CSG> keep files matching this comma separated |
| 408 | ** list of glob patterns. |
| 409 | ** -n|--dry-run If given, display instead of run actions |
| 410 | ** --temp Remove only Fossil-generated temporary files |
| 411 | ** |
| 412 | ** See also: addremove, extra, status |
| 413 | */ |
| 414 | void clean_cmd(void){ |
| 415 | int allFlag; |
| 416 | unsigned scanFlags = 0; |
| 417 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 418 | Blob path, repo; |
| 419 | Stmt q; |
| 420 | int n; |
| 421 | Glob *pIgnore, *pKeep, *pClean; |
| 422 | int dryRunFlag = 0; |
| 423 | |
| 424 | allFlag = find_option("force","f",0)!=0; |
| 425 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 426 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | |
| 427 | zIgnoreFlag = find_option("ignore",0,1); |
| 428 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 429 | if( !dryRunFlag ){ |
| 430 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 431 | } |
| 432 | zKeepFlag = find_option("keep",0,1); |
| 433 | zCleanFlag = find_option("clean",0,1); |
| 434 | capture_case_sensitive_option(); |
| 435 | db_must_be_within_tree(); |
| 436 | if( zIgnoreFlag==0 ){ |
| 437 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 438 | } |
| 439 | if( zKeepFlag==0 ){ |
| 440 | zKeepFlag = db_get("keep-glob", 0); |
| 441 | } |
| 442 | if( zCleanFlag==0 ){ |
| 443 | zCleanFlag = db_get("clean-glob", 0); |
| 444 | } |
| 445 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 446 | filename_collation()); |
| 447 | n = strlen(g.zLocalRoot); |
| 448 | blob_init(&path, g.zLocalRoot, n-1); |
| 449 | pIgnore = glob_create(zIgnoreFlag); |
| 450 | pKeep = glob_create(zKeepFlag); |
| 451 | pClean = glob_create(zCleanFlag); |
| 452 | vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep); |
| 453 | glob_free(pKeep); |
| 454 | glob_free(pIgnore); |
| 455 | db_prepare(&q, |
| 456 | "SELECT %Q || x FROM sfile" |
| 457 | " WHERE x NOT IN (%s)" |
| 458 | " ORDER BY 1", |
| 459 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -383,16 +383,15 @@ | |
| 383 | ** cannot be undone. |
| 384 | ** |
| 385 | ** You will be prompted before removing each eligible file unless the |
| 386 | ** --force flag is in use or it matches the --clean option. The |
| 387 | ** GLOBPATTERN specified by the "ignore-glob" setting is used if the |
| 388 | ** --ignore option is omitted, the same with "clean-glob" and --clean. |
| 389 | ** If you are sure you wish to remove all "extra" files except the |
| 390 | ** ones specified with --ignore, you can specify the optional |
| 391 | ** -f|--force flag and no prompts will be issued. If a file matches |
| 392 | ** both --ignore and --clean, --ignore takes precedence. |
| 393 | ** |
| 394 | ** Files and subdirectories whose names begin with "." are |
| 395 | ** normally kept. They are handled if the "--dotfiles" option |
| 396 | ** is used. |
| 397 | ** |
| @@ -402,25 +401,23 @@ | |
| 401 | ** -f|--force Remove files without prompting |
| 402 | ** --clean <CSG> never prompt for files matching this |
| 403 | ** comma separated list of glob patterns. |
| 404 | ** --ignore <CSG> ignore files matching patterns from the |
| 405 | ** comma separated list of glob patterns. |
| 406 | ** -n|--dry-run If given, display instead of run actions |
| 407 | ** --temp Remove only Fossil-generated temporary files |
| 408 | ** |
| 409 | ** See also: addremove, extra, status |
| 410 | */ |
| 411 | void clean_cmd(void){ |
| 412 | int allFlag; |
| 413 | unsigned scanFlags = 0; |
| 414 | const char *zIgnoreFlag, *zCleanFlag; |
| 415 | Blob path, repo; |
| 416 | Stmt q; |
| 417 | int n; |
| 418 | Glob *pIgnore, *pClean; |
| 419 | int dryRunFlag = 0; |
| 420 | |
| 421 | allFlag = find_option("force","f",0)!=0; |
| 422 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 423 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| @@ -427,32 +424,26 @@ | |
| 424 | zIgnoreFlag = find_option("ignore",0,1); |
| 425 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 426 | if( !dryRunFlag ){ |
| 427 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 428 | } |
| 429 | zCleanFlag = find_option("clean",0,1); |
| 430 | capture_case_sensitive_option(); |
| 431 | db_must_be_within_tree(); |
| 432 | if( zIgnoreFlag==0 ){ |
| 433 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 434 | } |
| 435 | if( zCleanFlag==0 ){ |
| 436 | zCleanFlag = db_get("clean-glob", 0); |
| 437 | } |
| 438 | db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)", |
| 439 | filename_collation()); |
| 440 | n = strlen(g.zLocalRoot); |
| 441 | blob_init(&path, g.zLocalRoot, n-1); |
| 442 | pIgnore = glob_create(zIgnoreFlag); |
| 443 | pClean = glob_create(zCleanFlag); |
| 444 | vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); |
| 445 | glob_free(pIgnore); |
| 446 | db_prepare(&q, |
| 447 | "SELECT %Q || x FROM sfile" |
| 448 | " WHERE x NOT IN (%s)" |
| 449 | " ORDER BY 1", |
| 450 |
-1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -103,11 +103,10 @@ | ||
| 103 | 103 | { "project-description", CONFIGSET_PROJ }, |
| 104 | 104 | { "manifest", CONFIGSET_PROJ }, |
| 105 | 105 | { "binary-glob", CONFIGSET_PROJ }, |
| 106 | 106 | { "clean-glob", CONFIGSET_PROJ }, |
| 107 | 107 | { "ignore-glob", CONFIGSET_PROJ }, |
| 108 | - { "keep-glob", CONFIGSET_PROJ }, | |
| 109 | 108 | { "crnl-glob", CONFIGSET_PROJ }, |
| 110 | 109 | { "encoding-glob", CONFIGSET_PROJ }, |
| 111 | 110 | { "empty-dirs", CONFIGSET_PROJ }, |
| 112 | 111 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 113 | 112 | |
| 114 | 113 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -103,11 +103,10 @@ | |
| 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 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 113 | |
| 114 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -103,11 +103,10 @@ | |
| 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 | { "crnl-glob", CONFIGSET_PROJ }, |
| 109 | { "encoding-glob", CONFIGSET_PROJ }, |
| 110 | { "empty-dirs", CONFIGSET_PROJ }, |
| 111 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 112 | |
| 113 |
M
src/db.c
-5
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2111,11 +2111,10 @@ | ||
| 2111 | 2111 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2112 | 2112 | { "gmerge-command",0, 40, 0, "" }, |
| 2113 | 2113 | { "http-port", 0, 16, 0, "8080" }, |
| 2114 | 2114 | { "https-login", 0, 0, 0, "off" }, |
| 2115 | 2115 | { "ignore-glob", 0, 40, 1, "" }, |
| 2116 | - { "keep-glob", 0, 40, 1, "" }, | |
| 2117 | 2116 | { "localauth", 0, 0, 0, "off" }, |
| 2118 | 2117 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2119 | 2118 | { "manifest", 0, 0, 1, "off" }, |
| 2120 | 2119 | { "max-upload", 0, 25, 0, "250000" }, |
| 2121 | 2120 | { "mtime-changes", 0, 0, 0, "on" }, |
| @@ -2249,14 +2248,10 @@ | ||
| 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 | 2251 | ** Example: *.log customCode.c notes.txt |
| 2253 | 2252 | ** |
| 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 | 2253 | ** localauth If enabled, require that HTTP connections from |
| 2259 | 2254 | ** 127.0.0.1 be authenticated by password. If |
| 2260 | 2255 | ** false, all HTTP requests from localhost have |
| 2261 | 2256 | ** unrestricted access to the repository. |
| 2262 | 2257 | ** |
| 2263 | 2258 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2111,11 +2111,10 @@ | |
| 2111 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2112 | { "gmerge-command",0, 40, 0, "" }, |
| 2113 | { "http-port", 0, 16, 0, "8080" }, |
| 2114 | { "https-login", 0, 0, 0, "off" }, |
| 2115 | { "ignore-glob", 0, 40, 1, "" }, |
| 2116 | { "keep-glob", 0, 40, 1, "" }, |
| 2117 | { "localauth", 0, 0, 0, "off" }, |
| 2118 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2119 | { "manifest", 0, 0, 1, "off" }, |
| 2120 | { "max-upload", 0, 25, 0, "250000" }, |
| 2121 | { "mtime-changes", 0, 0, 0, "on" }, |
| @@ -2249,14 +2248,10 @@ | |
| 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 | ** |
| 2263 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2111,11 +2111,10 @@ | |
| 2111 | { "gdiff-command", 0, 40, 0, "gdiff" }, |
| 2112 | { "gmerge-command",0, 40, 0, "" }, |
| 2113 | { "http-port", 0, 16, 0, "8080" }, |
| 2114 | { "https-login", 0, 0, 0, "off" }, |
| 2115 | { "ignore-glob", 0, 40, 1, "" }, |
| 2116 | { "localauth", 0, 0, 0, "off" }, |
| 2117 | { "main-branch", 0, 40, 0, "trunk" }, |
| 2118 | { "manifest", 0, 0, 1, "off" }, |
| 2119 | { "max-upload", 0, 25, 0, "250000" }, |
| 2120 | { "mtime-changes", 0, 0, 0, "on" }, |
| @@ -2249,14 +2248,10 @@ | |
| 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 customCode.c notes.txt |
| 2252 | ** |
| 2253 | ** localauth If enabled, require that HTTP connections from |
| 2254 | ** 127.0.0.1 be authenticated by password. If |
| 2255 | ** false, all HTTP requests from localhost have |
| 2256 | ** unrestricted access to the repository. |
| 2257 | ** |
| 2258 |
-1
| --- src/json_config.c | ||
| +++ src/json_config.c | ||
| @@ -67,11 +67,10 @@ | ||
| 67 | 67 | { "manifest", CONFIGSET_PROJ }, |
| 68 | 68 | { "binary-glob", CONFIGSET_PROJ }, |
| 69 | 69 | { "clean-glob", CONFIGSET_PROJ }, |
| 70 | 70 | { "encoding-glob", CONFIGSET_PROJ }, |
| 71 | 71 | { "ignore-glob", CONFIGSET_PROJ }, |
| 72 | -{ "keep-glob", CONFIGSET_PROJ }, | |
| 73 | 72 | { "crnl-glob", CONFIGSET_PROJ }, |
| 74 | 73 | { "empty-dirs", CONFIGSET_PROJ }, |
| 75 | 74 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 76 | 75 | |
| 77 | 76 | { "ticket-table", CONFIGSET_TKT }, |
| 78 | 77 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -67,11 +67,10 @@ | |
| 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 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 76 | |
| 77 | { "ticket-table", CONFIGSET_TKT }, |
| 78 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -67,11 +67,10 @@ | |
| 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 | { "crnl-glob", CONFIGSET_PROJ }, |
| 73 | { "empty-dirs", CONFIGSET_PROJ }, |
| 74 | { "allow-symlinks", CONFIGSET_PROJ }, |
| 75 | |
| 76 | { "ticket-table", CONFIGSET_TKT }, |
| 77 |