| | @@ -634,11 +634,11 @@ |
| 634 | 634 | ** values for --clean, --ignore, and --keep are determined by the |
| 635 | 635 | ** (versionable) clean-glob, ignore-glob, and keep-glob settings. |
| 636 | 636 | ** Files and subdirectories whose names begin with "." are automatically |
| 637 | 637 | ** ignored unless the --dotfiles option is used. |
| 638 | 638 | ** |
| 639 | | -** The --verily option ignores ignore-glob settings and turns on |
| 639 | +** The --verily option ignores the ignore-glob setting and turns on |
| 640 | 640 | **--dotfiles, and --emptydirs. Use the --verily option when you |
| 641 | 641 | ** really want to clean up everything. |
| 642 | 642 | ** |
| 643 | 643 | ** Options: |
| 644 | 644 | ** --allckouts Check for empty directories within any checkouts |
| | @@ -676,11 +676,11 @@ |
| 676 | 676 | ** -v|--verbose Show all files as they are removed. |
| 677 | 677 | ** |
| 678 | 678 | ** See also: addremove, extras, status |
| 679 | 679 | */ |
| 680 | 680 | void clean_cmd(void){ |
| 681 | | - int allFileFlag, allDirFlag, dryRunFlag, verboseFlag; |
| 681 | + int allFileFlag, dryRunFlag, verboseFlag; |
| 682 | 682 | int emptyDirsFlag, dirsOnlyFlag; |
| 683 | 683 | unsigned scanFlags = 0; |
| 684 | 684 | int verilyFlag; |
| 685 | 685 | const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; |
| 686 | 686 | Glob *pIgnore, *pKeep, *pClean; |
| | @@ -691,11 +691,11 @@ |
| 691 | 691 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 692 | 692 | } |
| 693 | 693 | if( !dryRunFlag ){ |
| 694 | 694 | dryRunFlag = find_option("whatif",0,0)!=0; |
| 695 | 695 | } |
| 696 | | - allFileFlag = allDirFlag = find_option("force","f",0)!=0; |
| 696 | + allFileFlag = find_option("force","f",0)!=0; |
| 697 | 697 | dirsOnlyFlag = find_option("dirsonly",0,0)!=0; |
| 698 | 698 | emptyDirsFlag = find_option("emptydirs","d",0)!=0 || dirsOnlyFlag; |
| 699 | 699 | if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; |
| 700 | 700 | if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; |
| 701 | 701 | if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; |
| | @@ -703,11 +703,11 @@ |
| 703 | 703 | verboseFlag = find_option("verbose","v",0)!=0; |
| 704 | 704 | zKeepFlag = find_option("keep",0,1); |
| 705 | 705 | zCleanFlag = find_option("clean",0,1); |
| 706 | 706 | db_must_be_within_tree(); |
| 707 | 707 | if( find_option("verily","x",0)!=0 ){ |
| 708 | | - verilyFlag = allFileFlag = allDirFlag = 1; |
| 708 | + verilyFlag = 1; |
| 709 | 709 | emptyDirsFlag = 1; |
| 710 | 710 | scanFlags |= SCAN_ALL; |
| 711 | 711 | zCleanFlag = 0; |
| 712 | 712 | } |
| 713 | 713 | if( zIgnoreFlag==0 ){ |
| | @@ -783,12 +783,11 @@ |
| 783 | 783 | Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); |
| 784 | 784 | Stmt q; |
| 785 | 785 | Blob root; |
| 786 | 786 | blob_init(&root, g.zLocalRoot, nRoot - 1); |
| 787 | 787 | vfile_dir_scan(&root, blob_size(&root), scanFlags, |
| 788 | | - verilyFlag ? 0 : pIgnore, |
| 789 | | - verilyFlag ? 0 : pEmptyDirs); |
| 788 | + verilyFlag ? 0 : pIgnore, pEmptyDirs); |
| 790 | 789 | blob_reset(&root); |
| 791 | 790 | db_prepare(&q, |
| 792 | 791 | "SELECT %Q || x FROM dscan_temp" |
| 793 | 792 | " WHERE x NOT IN (%s) AND y = 0" |
| 794 | 793 | " ORDER BY 1 DESC", |
| | @@ -801,32 +800,10 @@ |
| 801 | 800 | fossil_print("KEPT directory \"%s\" not removed (due to --keep" |
| 802 | 801 | " or \"keep-glob\")\n", zName+nRoot); |
| 803 | 802 | } |
| 804 | 803 | continue; |
| 805 | 804 | } |
| 806 | | - if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) |
| 807 | | - && !(verilyFlag && glob_match(pIgnore, zName+nRoot)) ){ |
| 808 | | - Blob ans; |
| 809 | | - char cReply; |
| 810 | | - int matchIgnore = verilyFlag && glob_match(pIgnore, zName+nRoot); |
| 811 | | - int matchEmpty = verilyFlag && glob_match(pEmptyDirs, zName+nRoot); |
| 812 | | - char *prompt = mprintf("%sRemove %s empty directory \"%s\" " |
| 813 | | - "(a=all/y/N)? ", |
| 814 | | - (matchEmpty || matchIgnore) ? |
| 815 | | - "WARNING: " : "", matchEmpty ? "\"RESERVED\"" : |
| 816 | | - matchIgnore ? "\"IGNORED\"" : "unmanaged", |
| 817 | | - zName+nRoot); |
| 818 | | - prompt_user(prompt, &ans); |
| 819 | | - cReply = blob_str(&ans)[0]; |
| 820 | | - if( cReply=='a' || cReply=='A' ){ |
| 821 | | - allDirFlag = 1; |
| 822 | | - }else if( cReply!='y' && cReply!='Y' ){ |
| 823 | | - blob_reset(&ans); |
| 824 | | - continue; |
| 825 | | - } |
| 826 | | - blob_reset(&ans); |
| 827 | | - } |
| 828 | 805 | if( dryRunFlag || file_rmdir(zName)==0 ){ |
| 829 | 806 | if( verboseFlag || dryRunFlag ){ |
| 830 | 807 | fossil_print("Removed unmanaged directory: %s\n", zName+nRoot); |
| 831 | 808 | } |
| 832 | 809 | }else if( verboseFlag ){ |
| 833 | 810 | |