Fossil SCM

Adding a new test (this failed by current trunk) based on ticket [74413366fe].

viric 2011-06-17 20:13 merge_renames
Commit b2e7370e32d8acc735170c6b1b68ec8fa0cd370e
1 file changed +71 -12
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -8,13 +8,14 @@
88
if {![regexp {not within an open checkout} $res]} {
99
puts stderr "Cannot run this test within an open checkout"
1010
return
1111
}
1212
13
-#################
14
-# Test 1 #
15
-#################
13
+######################################
14
+# Test 1 #
15
+# Reported: Ticket [554f44ee74e3d] #
16
+######################################
1617
1718
fossil new rep.fossil
1819
fossil open rep.fossil
1920
2021
write_file f1 "line"
@@ -36,11 +37,10 @@
3637
3738
write_file f1 "line6"
3839
fossil commit -m "c4"
3940
4041
fossil update pivot
41
-puts $RESULT
4242
fossil mv f1 f2
4343
exec mv f1 f2
4444
fossil commit -b rename -m "c5"
4545
4646
fossil merge trunk
@@ -52,15 +52,74 @@
5252
fossil commit -b branch2 -m "newbranch"
5353
5454
fossil merge trunk
5555
puts $RESULT
5656
57
-# Not a nice way to check, but I don't know more tcl now
58
-foreach {status filename} $RESULT {
59
- if {$status=="DELETED"} {
60
- protOut "Error, the merge should not delete any file"
61
- test merge_renames-1 0
62
- }
63
- if {$status=="UPDATE"} {
64
- test merge_renames-1 1
57
+set deletes 0
58
+foreach {status filename} $RESULT {
59
+ if {$status=="DELETE"} {
60
+ set deletes [expr $deletes + 1]
61
+ }
62
+}
63
+
64
+if {$deletes!=0} {
65
+ # failed
66
+ protOut "Error, the merge should not delete any file"
67
+ test merge_renames-1 0
68
+} else {
69
+ test merge_renames-1 1
70
+}
71
+
72
+fossil close -f
73
+exec rm rep.fossil
74
+
75
+######################################
76
+# Test 2 #
77
+# Reported: Ticket [74413366fe5067] #
78
+######################################
79
+
80
+fossil new rep.fossil
81
+fossil open rep.fossil
82
+
83
+write_file f1 "line"
84
+fossil add f1
85
+fossil commit -m "base file"
86
+fossil tag add pivot current
87
+
88
+write_file f2 "line2"
89
+fossil add f2
90
+fossil commit -m "newfile"
91
+
92
+fossil mv f2 f2new
93
+exec mv f2 f2new
94
+fossil commit -m "rename"
95
+
96
+fossil update pivot
97
+write_file f1 "line3"
98
+fossil commit -b branch -m "change"
99
+
100
+fossil merge trunk
101
+fossil commit -m "trunk merged"
102
+
103
+fossil update trunk
104
+
105
+fossil merge branch
106
+puts $RESULT
107
+
108
+# Not a nice way to check, but I don't know more tcl now
109
+set deletes 0
110
+foreach {status filename} $RESULT {
111
+ if {$status=="DELETE"} {
112
+ set deletes [expr $deletes + 1]
65113
}
66114
}
115
+
116
+if {$deletes!=0} {
117
+ # failed
118
+ protOut "Error, the merge should not delete any file"
119
+ test merge_renames-2 0
120
+} else {
121
+ test merge_renames-2 1
122
+}
123
+
124
+fossil close -f
125
+exec rm rep.fossil
67126
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -8,13 +8,14 @@
8 if {![regexp {not within an open checkout} $res]} {
9 puts stderr "Cannot run this test within an open checkout"
10 return
11 }
12
13 #################
14 # Test 1 #
15 #################
 
16
17 fossil new rep.fossil
18 fossil open rep.fossil
19
20 write_file f1 "line"
@@ -36,11 +37,10 @@
36
37 write_file f1 "line6"
38 fossil commit -m "c4"
39
40 fossil update pivot
41 puts $RESULT
42 fossil mv f1 f2
43 exec mv f1 f2
44 fossil commit -b rename -m "c5"
45
46 fossil merge trunk
@@ -52,15 +52,74 @@
52 fossil commit -b branch2 -m "newbranch"
53
54 fossil merge trunk
55 puts $RESULT
56
57 # Not a nice way to check, but I don't know more tcl now
58 foreach {status filename} $RESULT {
59 if {$status=="DELETED"} {
60 protOut "Error, the merge should not delete any file"
61 test merge_renames-1 0
62 }
63 if {$status=="UPDATE"} {
64 test merge_renames-1 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65 }
66 }
 
 
 
 
 
 
 
 
 
 
 
67
--- test/merge_renames.test
+++ test/merge_renames.test
@@ -8,13 +8,14 @@
8 if {![regexp {not within an open checkout} $res]} {
9 puts stderr "Cannot run this test within an open checkout"
10 return
11 }
12
13 ######################################
14 # Test 1 #
15 # Reported: Ticket [554f44ee74e3d] #
16 ######################################
17
18 fossil new rep.fossil
19 fossil open rep.fossil
20
21 write_file f1 "line"
@@ -36,11 +37,10 @@
37
38 write_file f1 "line6"
39 fossil commit -m "c4"
40
41 fossil update pivot
 
42 fossil mv f1 f2
43 exec mv f1 f2
44 fossil commit -b rename -m "c5"
45
46 fossil merge trunk
@@ -52,15 +52,74 @@
52 fossil commit -b branch2 -m "newbranch"
53
54 fossil merge trunk
55 puts $RESULT
56
57 set deletes 0
58 foreach {status filename} $RESULT {
59 if {$status=="DELETE"} {
60 set deletes [expr $deletes + 1]
61 }
62 }
63
64 if {$deletes!=0} {
65 # failed
66 protOut "Error, the merge should not delete any file"
67 test merge_renames-1 0
68 } else {
69 test merge_renames-1 1
70 }
71
72 fossil close -f
73 exec rm rep.fossil
74
75 ######################################
76 # Test 2 #
77 # Reported: Ticket [74413366fe5067] #
78 ######################################
79
80 fossil new rep.fossil
81 fossil open rep.fossil
82
83 write_file f1 "line"
84 fossil add f1
85 fossil commit -m "base file"
86 fossil tag add pivot current
87
88 write_file f2 "line2"
89 fossil add f2
90 fossil commit -m "newfile"
91
92 fossil mv f2 f2new
93 exec mv f2 f2new
94 fossil commit -m "rename"
95
96 fossil update pivot
97 write_file f1 "line3"
98 fossil commit -b branch -m "change"
99
100 fossil merge trunk
101 fossil commit -m "trunk merged"
102
103 fossil update trunk
104
105 fossil merge branch
106 puts $RESULT
107
108 # Not a nice way to check, but I don't know more tcl now
109 set deletes 0
110 foreach {status filename} $RESULT {
111 if {$status=="DELETE"} {
112 set deletes [expr $deletes + 1]
113 }
114 }
115
116 if {$deletes!=0} {
117 # failed
118 protOut "Error, the merge should not delete any file"
119 test merge_renames-2 0
120 } else {
121 test merge_renames-2 1
122 }
123
124 fossil close -f
125 exec rm rep.fossil
126

Keyboard Shortcuts

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