| | @@ -44,11 +44,12 @@ |
| 44 | 44 | fossil extra |
| 45 | 45 | test clean-3 {[normalize_result] eq {f2}} |
| 46 | 46 | |
| 47 | 47 | ############################################################################### |
| 48 | 48 | |
| 49 | | -fossil clean; # undo enabled, file < 10MiB |
| 49 | +# clean w/undo enabled, should not prompt, 1 file < 10MiB |
| 50 | +fossil clean |
| 50 | 51 | test clean-4 {[normalize_result] eq \ |
| 51 | 52 | {"fossil undo" is available to undo changes to the working checkout.}} |
| 52 | 53 | |
| 53 | 54 | ############################################################################### |
| 54 | 55 | |
| | @@ -57,36 +58,132 @@ |
| 57 | 58 | |
| 58 | 59 | ############################################################################### |
| 59 | 60 | |
| 60 | 61 | fossil undo |
| 61 | 62 | test clean-6 {[normalize_result] eq {NEW f2}} |
| 62 | | -test clean-7 {[normalize_result] eq {NEW f2}} |
| 63 | +test clean-7 {[read_file f2] eq "f2 line"} |
| 63 | 64 | |
| 64 | 65 | ############################################################################### |
| 65 | 66 | |
| 66 | 67 | fossil extra |
| 67 | 68 | test clean-8 {[normalize_result] eq {f2}} |
| 68 | 69 | |
| 69 | 70 | ############################################################################### |
| 70 | 71 | |
| 71 | 72 | write_file f3 [string repeat ABCDEFGHIJK 1048576] |
| 72 | | -fossil clean --no-prompt; # undo enabled, one file < 10MiB, one file > 10MiB |
| 73 | | -test clean-9 {[normalize_result] eq \ |
| 73 | +fossil extra |
| 74 | +test clean-9 {[normalize_result] eq {f2 |
| 75 | +f3}} |
| 76 | + |
| 77 | +############################################################################### |
| 78 | + |
| 79 | +# clean w/undo enabled, no prompt, 1 file < 10MiB, 1 file > 10MiB |
| 80 | +fossil clean --no-prompt |
| 81 | +test clean-10 {[normalize_result] eq \ |
| 82 | +{"fossil undo" is available to undo changes to the working checkout.}} |
| 83 | + |
| 84 | +############################################################################### |
| 85 | + |
| 86 | +fossil extra |
| 87 | +test clean-11 {[normalize_result] eq {f3}} |
| 88 | + |
| 89 | +############################################################################### |
| 90 | + |
| 91 | +fossil undo |
| 92 | +test clean-12 {[normalize_result] eq {NEW f2}} |
| 93 | +test clean-13 {[read_file f2] eq "f2 line"} |
| 94 | +test clean-14 {[read_file f3] eq [string repeat ABCDEFGHIJK 1048576]} |
| 95 | + |
| 96 | +############################################################################### |
| 97 | + |
| 98 | +fossil extra |
| 99 | +test clean-15 {[normalize_result] eq {f2 |
| 100 | +f3}} |
| 101 | + |
| 102 | +############################################################################### |
| 103 | + |
| 104 | +# clean w/undo enabled, force, 1 file < 10MiB, 1 file > 10MiB |
| 105 | +fossil clean --force |
| 106 | +test clean-16 {[normalize_result] eq \ |
| 74 | 107 | {"fossil undo" is available to undo changes to the working checkout.}} |
| 75 | 108 | |
| 76 | 109 | ############################################################################### |
| 77 | 110 | |
| 78 | 111 | fossil extra |
| 79 | | -test clean-10 {[normalize_result] eq {f3}} |
| 112 | +test clean-17 {[normalize_result] eq {}} |
| 113 | + |
| 114 | +############################################################################### |
| 115 | + |
| 116 | +fossil undo |
| 117 | +test clean-18 {[normalize_result] eq {NEW f2}} |
| 118 | +test clean-19 {[read_file f2] eq "f2 line"} |
| 119 | + |
| 120 | +############################################################################### |
| 121 | + |
| 122 | +write_file f4 [string repeat KJIHGFEDCBA 1048576] |
| 123 | +fossil extra |
| 124 | +test clean-20 {[normalize_result] eq {f2 |
| 125 | +f4}} |
| 126 | + |
| 127 | +############################################################################### |
| 128 | + |
| 129 | +# clean w/undo disabled, no prompt, 1 file < 10MiB, 1 file > 10MiB |
| 130 | +fossil clean --disable-undo --no-prompt |
| 131 | +test clean-21 {[normalize_result] eq {}} |
| 132 | + |
| 133 | +############################################################################### |
| 134 | + |
| 135 | +fossil extra |
| 136 | +test clean-22 {[normalize_result] eq {f2 |
| 137 | +f4}} |
| 138 | + |
| 139 | +############################################################################### |
| 140 | + |
| 141 | +fossil undo |
| 142 | +test clean-23 {[normalize_result] eq {nothing to undo}} |
| 143 | + |
| 144 | +############################################################################### |
| 145 | + |
| 146 | +# clean w/undo disabled, force, 1 file < 10MiB, 1 file > 10MiB |
| 147 | +fossil clean --disable-undo --force |
| 148 | +test clean-24 {[normalize_result] eq {}} |
| 149 | + |
| 150 | +############################################################################### |
| 151 | + |
| 152 | +fossil extra |
| 153 | +test clean-25 {[normalize_result] eq {}} |
| 154 | + |
| 155 | +############################################################################### |
| 156 | + |
| 157 | +fossil undo |
| 158 | +test clean-26 {[normalize_result] eq {nothing to undo}} |
| 159 | + |
| 160 | +############################################################################### |
| 161 | + |
| 162 | +write_file f5 "f5 line" |
| 163 | +fossil extra |
| 164 | +test clean-27 {[normalize_result] eq {f5}} |
| 165 | + |
| 166 | +############################################################################### |
| 167 | + |
| 168 | +# clean w/undo disabled, should prompt, 1 file < 10MiB |
| 169 | +fossil_maybe_answer Y clean --disable-undo |
| 170 | +test clean-28 {[normalize_result] eq \ |
| 171 | +{WARNING: Deletion of this file will not be undoable via the 'undo' |
| 172 | + command because undo is disabled for this operation. |
| 173 | + |
| 174 | +Remove unmanaged file "f5" (a=all/y/N)?}} |
| 175 | + |
| 176 | +############################################################################### |
| 177 | + |
| 178 | +fossil extra |
| 179 | +test clean-29 {[normalize_result] eq {}} |
| 80 | 180 | |
| 81 | 181 | ############################################################################### |
| 82 | 182 | |
| 83 | 183 | fossil undo |
| 84 | | -test clean-11 {[normalize_result] eq {NEW f2}} |
| 85 | | -test clean-12 {[read_file f2] eq "f2 line"} |
| 86 | | -test clean-13 {[read_file f3] eq [string repeat ABCDEFGHIJK 1048576]} |
| 184 | +test clean-30 {[normalize_result] eq {nothing to undo}} |
| 87 | 185 | |
| 88 | 186 | ############################################################################### |
| 89 | 187 | |
| 90 | 188 | fossil extra |
| 91 | | -test clean-14 {[normalize_result] eq {f2 |
| 92 | | -f3}} |
| 189 | +test clean-31 {[normalize_result] eq {}} |
| 93 | 190 | |