Fossil SCM
Add new test that demonstrates an issue (during merging) with renaming a file and then adding a file with the old name in the same commit.
Commit
25fe7658eceee16ea7899d62b137b69d71c41e8a
Parent
0fb4a8d0988dcb0…
1 file changed
+36
-3
+36
-3
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | # |
| 2 | 2 | # Tests for merging with renames |
| 3 | -# | |
| 3 | +# | |
| 4 | 4 | # |
| 5 | 5 | |
| 6 | 6 | catch {exec $::fossilexe info} res |
| 7 | 7 | puts res=$res |
| 8 | 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | ||
| 169 | 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | 170 | ###################################### |
| 171 | 171 | |
| 172 | 172 | # TO BE WRITTEN. |
| 173 | 173 | |
| 174 | +###################################### | |
| 175 | +# Test 5 # | |
| 176 | +# Handle Rename/Add via Merge # | |
| 177 | +###################################### | |
| 178 | + | |
| 179 | +repo_init | |
| 180 | + | |
| 181 | +write_file f1 "old f1 line" | |
| 182 | +fossil add f1 | |
| 183 | +fossil commit -m "base file" | |
| 184 | + | |
| 185 | +write_file f3 "f3 line" | |
| 186 | +fossil add f3 | |
| 187 | +fossil commit -m "branch file" -b branch_for_f3 | |
| 188 | + | |
| 189 | +fossil update trunk | |
| 190 | +fossil mv f1 f2 | |
| 191 | +file rename -force f1 f2 | |
| 192 | +write_file f1 "new f1 line" | |
| 193 | +fossil add f1 | |
| 194 | +fossil commit -m "rename and add file with old name" | |
| 195 | + | |
| 196 | +fossil update branch_for_f3 | |
| 197 | +fossil merge trunk | |
| 198 | +fossil commit -m "trunk merged, should have 3 files" | |
| 199 | + | |
| 200 | +fossil ls | |
| 201 | + | |
| 202 | +test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1 | |
| 203 | +f2 | |
| 204 | +f3}} | |
| 174 | 205 | |
| 206 | +###################################### | |
| 207 | +# | |
| 175 | 208 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 176 | 209 | # write: |
| 177 | 210 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 178 | -# [953031915f] - Lack of warning when overwriting extra files | |
| 179 | -# [4df5f38f1e] - Troubles merging a file delete with a file change | |
| 211 | +# [953031915f] - Lack of warning when overwriting extra files | |
| 212 | +# [4df5f38f1e] - Troubles merging a file delete with a file change | |
| 180 | 213 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,8 +1,8 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | catch {exec $::fossilexe info} res |
| 7 | puts res=$res |
| 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | |
| 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | ###################################### |
| 171 | |
| 172 | # TO BE WRITTEN. |
| 173 | |
| 174 | |
| 175 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 176 | # write: |
| 177 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 178 | # [953031915f] - Lack of warning when overwriting extra files |
| 179 | # [4df5f38f1e] - Troubles merging a file delete with a file change |
| 180 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -1,8 +1,8 @@ | |
| 1 | # |
| 2 | # Tests for merging with renames |
| 3 | # |
| 4 | # |
| 5 | |
| 6 | catch {exec $::fossilexe info} res |
| 7 | puts res=$res |
| 8 | if {![regexp {use --repository} $res]} { |
| @@ -169,11 +169,44 @@ | |
| 169 | # Reported: Ticket [67176c3aa4] # |
| 170 | ###################################### |
| 171 | |
| 172 | # TO BE WRITTEN. |
| 173 | |
| 174 | ###################################### |
| 175 | # Test 5 # |
| 176 | # Handle Rename/Add via Merge # |
| 177 | ###################################### |
| 178 | |
| 179 | repo_init |
| 180 | |
| 181 | write_file f1 "old f1 line" |
| 182 | fossil add f1 |
| 183 | fossil commit -m "base file" |
| 184 | |
| 185 | write_file f3 "f3 line" |
| 186 | fossil add f3 |
| 187 | fossil commit -m "branch file" -b branch_for_f3 |
| 188 | |
| 189 | fossil update trunk |
| 190 | fossil mv f1 f2 |
| 191 | file rename -force f1 f2 |
| 192 | write_file f1 "new f1 line" |
| 193 | fossil add f1 |
| 194 | fossil commit -m "rename and add file with old name" |
| 195 | |
| 196 | fossil update branch_for_f3 |
| 197 | fossil merge trunk |
| 198 | fossil commit -m "trunk merged, should have 3 files" |
| 199 | |
| 200 | fossil ls |
| 201 | |
| 202 | test merge_renames-5 {[string map [list \r\n \n] [string trim $RESULT]] eq {f1 |
| 203 | f2 |
| 204 | f3}} |
| 205 | |
| 206 | ###################################### |
| 207 | # |
| 208 | # Tests for troubles not specifically linked with renames but that I'd like to |
| 209 | # write: |
| 210 | # [c26c63eb1b] - 'merge --backout' does not handle conflicts properly |
| 211 | # [953031915f] - Lack of warning when overwriting extra files |
| 212 | # [4df5f38f1e] - Troubles merging a file delete with a file change |
| 213 |