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.

mistachkin 2014-07-13 03:37 trunk
Commit 25fe7658eceee16ea7899d62b137b69d71c41e8a
1 file changed +36 -3
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -1,8 +1,8 @@
11
#
22
# Tests for merging with renames
3
-#
3
+#
44
#
55
66
catch {exec $::fossilexe info} res
77
puts res=$res
88
if {![regexp {use --repository} $res]} {
@@ -169,11 +169,44 @@
169169
# Reported: Ticket [67176c3aa4] #
170170
######################################
171171
172172
# TO BE WRITTEN.
173173
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}}
174205
206
+######################################
207
+#
175208
# Tests for troubles not specifically linked with renames but that I'd like to
176209
# write:
177210
# [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
180213
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button