Fossil SCM
Adding a new test I wanted to write. I just saw this in my local copy, but I really forgot if I finished it or not.
Commit
62f4a8a61ce5ed83ca80e65fe55c606dca790a0d
Parent
75aaf30aadc5cb3…
1 file changed
+46
-1
+46
-1
| --- test/merge_renames.test | ||
| +++ test/merge_renames.test | ||
| @@ -127,11 +127,56 @@ | ||
| 127 | 127 | ###################################### |
| 128 | 128 | # Test 3 # |
| 129 | 129 | # Reported: Ticket [30b28cf351] # |
| 130 | 130 | ###################################### |
| 131 | 131 | |
| 132 | -# TO BE WRITTEN. | |
| 132 | +fossil new rep.fossil | |
| 133 | +fossil open rep.fossil | |
| 134 | + | |
| 135 | +write_file f1 "line" | |
| 136 | +fossil add f1 | |
| 137 | +fossil commit -m "base file" | |
| 138 | +fossil tag add pivot current | |
| 139 | + | |
| 140 | +write_file f2 "line2" | |
| 141 | +fossil add f2 | |
| 142 | +fossil commit -m "newfile" | |
| 143 | + | |
| 144 | +fossil mv f2 f2new | |
| 145 | +exec mv f2 f2new | |
| 146 | +fossil commit -m "rename" | |
| 147 | + | |
| 148 | +fossil update pivot | |
| 149 | +write_file f1 "line3" | |
| 150 | +fossil commit -b branch -m "change" | |
| 151 | + | |
| 152 | +fossil merge trunk | |
| 153 | +fossil commit -m "trunk merged" | |
| 154 | + | |
| 155 | +fossil update trunk | |
| 156 | + | |
| 157 | +fossil merge branch | |
| 158 | +puts $RESULT | |
| 159 | + | |
| 160 | +# Not a nice way to check, but I don't know more tcl now | |
| 161 | +set deletes 0 | |
| 162 | +foreach {status filename} $RESULT { | |
| 163 | + if {$status=="DELETE"} { | |
| 164 | + set deletes [expr $deletes + 1] | |
| 165 | + } | |
| 166 | +} | |
| 167 | + | |
| 168 | +if {$deletes!=0} { | |
| 169 | + # failed | |
| 170 | + protOut "Error, the merge should not delete any file" | |
| 171 | + test merge_renames-2 0 | |
| 172 | +} else { | |
| 173 | + test merge_renames-2 1 | |
| 174 | +} | |
| 175 | + | |
| 176 | +fossil close -f | |
| 177 | +exec rm rep.fossil | |
| 133 | 178 | |
| 134 | 179 | ###################################### |
| 135 | 180 | # Test 4 # |
| 136 | 181 | # Reported: Ticket [67176c3aa4] # |
| 137 | 182 | ###################################### |
| 138 | 183 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -127,11 +127,56 @@ | |
| 127 | ###################################### |
| 128 | # Test 3 # |
| 129 | # Reported: Ticket [30b28cf351] # |
| 130 | ###################################### |
| 131 | |
| 132 | # TO BE WRITTEN. |
| 133 | |
| 134 | ###################################### |
| 135 | # Test 4 # |
| 136 | # Reported: Ticket [67176c3aa4] # |
| 137 | ###################################### |
| 138 |
| --- test/merge_renames.test | |
| +++ test/merge_renames.test | |
| @@ -127,11 +127,56 @@ | |
| 127 | ###################################### |
| 128 | # Test 3 # |
| 129 | # Reported: Ticket [30b28cf351] # |
| 130 | ###################################### |
| 131 | |
| 132 | fossil new rep.fossil |
| 133 | fossil open rep.fossil |
| 134 | |
| 135 | write_file f1 "line" |
| 136 | fossil add f1 |
| 137 | fossil commit -m "base file" |
| 138 | fossil tag add pivot current |
| 139 | |
| 140 | write_file f2 "line2" |
| 141 | fossil add f2 |
| 142 | fossil commit -m "newfile" |
| 143 | |
| 144 | fossil mv f2 f2new |
| 145 | exec mv f2 f2new |
| 146 | fossil commit -m "rename" |
| 147 | |
| 148 | fossil update pivot |
| 149 | write_file f1 "line3" |
| 150 | fossil commit -b branch -m "change" |
| 151 | |
| 152 | fossil merge trunk |
| 153 | fossil commit -m "trunk merged" |
| 154 | |
| 155 | fossil update trunk |
| 156 | |
| 157 | fossil merge branch |
| 158 | puts $RESULT |
| 159 | |
| 160 | # Not a nice way to check, but I don't know more tcl now |
| 161 | set deletes 0 |
| 162 | foreach {status filename} $RESULT { |
| 163 | if {$status=="DELETE"} { |
| 164 | set deletes [expr $deletes + 1] |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | if {$deletes!=0} { |
| 169 | # failed |
| 170 | protOut "Error, the merge should not delete any file" |
| 171 | test merge_renames-2 0 |
| 172 | } else { |
| 173 | test merge_renames-2 1 |
| 174 | } |
| 175 | |
| 176 | fossil close -f |
| 177 | exec rm rep.fossil |
| 178 | |
| 179 | ###################################### |
| 180 | # Test 4 # |
| 181 | # Reported: Ticket [67176c3aa4] # |
| 182 | ###################################### |
| 183 |