##// END OF EJS Templates
Fix undetected change bug in rename tests
Matt Mackall -
r3282:438b0638 default
parent child Browse files
Show More
@@ -1,102 +1,102
1 1 #!/bin/sh
2 2
3 3 mkdir -p t
4 4 cd t
5 5
6 6 cat <<'EOF' > merge
7 7 #!/bin/sh
8 echo merge > $1
8 echo merge $1 $2 $3 > $1
9 9 EOF
10 10 chmod +x merge
11 11
12 12 # perform a test merge with possible renaming
13 13 #
14 14 # args:
15 15 # $1 = action in local branch
16 16 # $2 = action in remote branch
17 17 # $3 = action in working dir
18 18 # $4 = expected result
19 19 tm()
20 20 {
21 21 mkdir t
22 22 cd t
23 23 hg init
24 24 echo "[merge]" >> .hg/hgrc
25 25 echo "followcopies = 1" >> .hg/hgrc
26 26
27 27 # base
28 28 echo base > a
29 29 echo base > rev # used to force commits
30 30 hg add a rev
31 31 hg ci -m "base" -d "0 0"
32 32
33 33 # remote
34 34 echo remote > rev
35 35 if [ "$2" != "" ] ; then $2 ; fi
36 36 hg ci -m "remote" -d "0 0"
37 37
38 38 # local
39 39 hg co -q 0
40 40 echo local > rev
41 41 if [ "$1" != "" ] ; then $1 ; fi
42 42 hg ci -m "local" -d "0 0"
43 43
44 44 # working dir
45 45 echo local > rev
46 46 if [ "$3" != "" ] ; then $3 ; fi
47 47
48 48 # merge
49 49 echo "--------------"
50 50 echo "test L:$1 R:$2 W:$3 - $4"
51 51 echo "--------------"
52 52 env HGMERGE=../merge hg merge -y --debug --traceback
53 53
54 54 echo "--------------"
55 55 hg status -camC -X rev
56 56
57 57 hg ci -m "merge" -d "0 0"
58 58
59 59 echo "--------------"
60 60 echo
61 61
62 62 cd ..
63 63 rm -rf t
64 64 }
65 65
66 66 up() {
67 67 cp rev $1
68 68 hg add $1 2> /dev/null
69 69 if [ "$2" != "" ] ; then
70 70 cp rev $2
71 71 hg add $2 2> /dev/null
72 72 fi
73 73 }
74 74
75 75 uc() { up $1; hg cp $1 $2; } # update + copy
76 76 um() { up $1; hg mv $1 $2; }
77 77 nc() { hg cp $1 $2; } # just copy
78 78 nm() { hg mv $1 $2; } # just move
79 79
80 80 tm "up a " "nc a b" " " "1 get local a to b"
81 81 tm "nc a b" "up a " " " "2 get rem change to a and b"
82 82 tm "up a " "nm a b" " " "3 get local a change to b, remove a"
83 83 tm "nm a b" "up a " " " "4 get remote change to b"
84 84 tm " " "nc a b" " " "5 get b"
85 85 tm "nc a b" " " " " "6 nothing"
86 86 tm " " "nm a b" " " "7 get b"
87 87 tm "nm a b" " " " " "8 nothing"
88 88 tm "um a b" "um a b" " " "9 do merge with ancestor in a"
89 89 #tm "um a c" "um x c" " " "10 do merge with no ancestor"
90 90 tm "nm a b" "nm a c" " " "11 get c, keep b"
91 91 tm "nc a b" "up b " " " "12 merge b no ancestor"
92 92 tm "up b " "nm a b" " " "13 merge b no ancestor"
93 93 tm "nc a b" "up a b" " " "14 merge b no ancestor"
94 94 tm "up b " "nm a b" " " "15 merge b no ancestor, remove a"
95 95 tm "nc a b" "up a b" " " "16 get a, merge b no ancestor"
96 96 tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor"
97 97 tm "nm a b" "up a b" " " "18 merge b no ancestor"
98 98 tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a"
99 99 tm "up a " "um a b" " " "20 merge a and b to b, remove a"
100 100 tm "um a b" "up a " " " "21 merge a and b to b"
101 101 #tm "nm a b" "um x a" " " "22 get a, keep b"
102 102 tm "nm a b" "up a c" " " "23 get c, keep b"
@@ -1,457 +1,457
1 1 --------------
2 2 test L:up a R:nc a b W: - 1 get local a to b
3 3 --------------
4 4 resolving manifests
5 5 overwrite None branchmerge True partial False
6 6 ancestor e300d1c794ec local 735846fee2d7 remote 924404dff337
7 7 rev: versions differ -> m
8 8 a: remote copied -> c
9 9 merging a and b to b
10 10 resolving a
11 11 my a@e300d1c794ec other b@735846fee2d7 ancestor a@924404dff337
12 12 copying a to b
13 13 merging rev
14 14 resolving rev
15 15 my rev@e300d1c794ec other rev@735846fee2d7 ancestor rev@924404dff337
16 16 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
17 17 (branch merge, don't forget to commit)
18 18 --------------
19 M a
19 20 M b
20 21 a
21 C a
22 22 --------------
23 23
24 24 --------------
25 25 test L:nc a b R:up a W: - 2 get rem change to a and b
26 26 --------------
27 27 resolving manifests
28 28 overwrite None branchmerge True partial False
29 29 ancestor ac809aeed39a local f4db7e329e71 remote 924404dff337
30 30 a: remote is newer -> g
31 31 b: local copied -> c
32 32 rev: versions differ -> m
33 33 getting a
34 34 merging b and a to b
35 35 resolving b
36 36 my b@ac809aeed39a other a@f4db7e329e71 ancestor a@924404dff337
37 37 merging rev
38 38 resolving rev
39 39 my rev@ac809aeed39a other rev@f4db7e329e71 ancestor rev@924404dff337
40 40 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
41 41 (branch merge, don't forget to commit)
42 42 --------------
43 43 M a
44 44 M b
45 45 --------------
46 46
47 47 --------------
48 48 test L:up a R:nm a b W: - 3 get local a change to b, remove a
49 49 --------------
50 50 resolving manifests
51 51 overwrite None branchmerge True partial False
52 52 ancestor e300d1c794ec local e03727d2d66b remote 924404dff337
53 53 a: remote moved -> c
54 54 rev: versions differ -> m
55 55 merging a and b to b
56 56 resolving a
57 57 my a@e300d1c794ec other b@e03727d2d66b ancestor a@924404dff337
58 58 copying a to b
59 59 removing a
60 60 merging rev
61 61 resolving rev
62 62 my rev@e300d1c794ec other rev@e03727d2d66b ancestor rev@924404dff337
63 63 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
64 64 (branch merge, don't forget to commit)
65 65 --------------
66 66 M b
67 67 a
68 68 --------------
69 69
70 70 --------------
71 71 test L:nm a b R:up a W: - 4 get remote change to b
72 72 --------------
73 73 resolving manifests
74 74 overwrite None branchmerge True partial False
75 75 ancestor ecf3cb2a4219 local f4db7e329e71 remote 924404dff337
76 76 b: local moved -> c
77 77 rev: versions differ -> m
78 78 merging b and a to b
79 79 resolving b
80 80 my b@ecf3cb2a4219 other a@f4db7e329e71 ancestor a@924404dff337
81 81 merging rev
82 82 resolving rev
83 83 my rev@ecf3cb2a4219 other rev@f4db7e329e71 ancestor rev@924404dff337
84 84 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
85 85 (branch merge, don't forget to commit)
86 86 --------------
87 87 M b
88 88 --------------
89 89
90 90 --------------
91 91 test L: R:nc a b W: - 5 get b
92 92 --------------
93 93 resolving manifests
94 94 overwrite None branchmerge True partial False
95 95 ancestor 94b33a1b7f2d local 735846fee2d7 remote 924404dff337
96 96 rev: versions differ -> m
97 97 a: remote copied -> c
98 98 merging a and b to b
99 99 resolving a
100 100 my a@924404dff337 other b@735846fee2d7 ancestor a@924404dff337
101 101 copying a to b
102 102 merging rev
103 103 resolving rev
104 104 my rev@94b33a1b7f2d other rev@735846fee2d7 ancestor rev@924404dff337
105 105 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
106 106 (branch merge, don't forget to commit)
107 107 --------------
108 108 M a
109 109 M b
110 110 a
111 111 --------------
112 112
113 113 --------------
114 114 test L:nc a b R: W: - 6 nothing
115 115 --------------
116 116 resolving manifests
117 117 overwrite None branchmerge True partial False
118 118 ancestor ac809aeed39a local 97c705ade336 remote 924404dff337
119 119 b: local copied -> c
120 120 rev: versions differ -> m
121 121 merging b and a to b
122 122 resolving b
123 123 my b@ac809aeed39a other a@924404dff337 ancestor a@924404dff337
124 124 merging rev
125 125 resolving rev
126 126 my rev@ac809aeed39a other rev@97c705ade336 ancestor rev@924404dff337
127 127 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
128 128 (branch merge, don't forget to commit)
129 129 --------------
130 130 M b
131 131 C a
132 132 --------------
133 133
134 134 --------------
135 135 test L: R:nm a b W: - 7 get b
136 136 --------------
137 137 resolving manifests
138 138 overwrite None branchmerge True partial False
139 139 ancestor 94b33a1b7f2d local e03727d2d66b remote 924404dff337
140 140 a: remote moved -> c
141 141 rev: versions differ -> m
142 142 merging a and b to b
143 143 resolving a
144 144 my a@924404dff337 other b@e03727d2d66b ancestor a@924404dff337
145 145 copying a to b
146 146 removing a
147 147 merging rev
148 148 resolving rev
149 149 my rev@94b33a1b7f2d other rev@e03727d2d66b ancestor rev@924404dff337
150 150 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
151 151 (branch merge, don't forget to commit)
152 152 --------------
153 153 M b
154 154 a
155 155 --------------
156 156
157 157 --------------
158 158 test L:nm a b R: W: - 8 nothing
159 159 --------------
160 160 resolving manifests
161 161 overwrite None branchmerge True partial False
162 162 ancestor ecf3cb2a4219 local 97c705ade336 remote 924404dff337
163 163 b: local moved -> c
164 164 rev: versions differ -> m
165 165 merging b and a to b
166 166 resolving b
167 167 my b@ecf3cb2a4219 other a@924404dff337 ancestor a@924404dff337
168 168 merging rev
169 169 resolving rev
170 170 my rev@ecf3cb2a4219 other rev@97c705ade336 ancestor rev@924404dff337
171 171 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
172 172 (branch merge, don't forget to commit)
173 173 --------------
174 174 M b
175 175 --------------
176 176
177 177 --------------
178 178 test L:um a b R:um a b W: - 9 do merge with ancestor in a
179 179 --------------
180 180 resolving manifests
181 181 overwrite None branchmerge True partial False
182 182 ancestor ec03c2ca8642 local 79cc6877a3b7 remote 924404dff337
183 183 b: versions differ -> m
184 184 rev: versions differ -> m
185 185 merging b
186 186 resolving b
187 187 my b@ec03c2ca8642 other b@79cc6877a3b7 ancestor a@924404dff337
188 188 merging rev
189 189 resolving rev
190 190 my rev@ec03c2ca8642 other rev@79cc6877a3b7 ancestor rev@924404dff337
191 191 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
192 192 (branch merge, don't forget to commit)
193 193 --------------
194 194 M b
195 195 --------------
196 196
197 197 --------------
198 198 test L:nm a b R:nm a c W: - 11 get c, keep b
199 199 --------------
200 200 resolving manifests
201 201 overwrite None branchmerge True partial False
202 202 ancestor ecf3cb2a4219 local e6abcc1a30c2 remote 924404dff337
203 203 rev: versions differ -> m
204 204 c: remote created -> g
205 205 getting c
206 206 merging rev
207 207 resolving rev
208 208 my rev@ecf3cb2a4219 other rev@e6abcc1a30c2 ancestor rev@924404dff337
209 209 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
210 210 (branch merge, don't forget to commit)
211 211 --------------
212 212 M c
213 213 C b
214 214 --------------
215 215
216 216 --------------
217 217 test L:nc a b R:up b W: - 12 merge b no ancestor
218 218 --------------
219 219 resolving manifests
220 220 overwrite None branchmerge True partial False
221 221 ancestor ac809aeed39a local af30c7647fc7 remote 924404dff337
222 222 b: versions differ -> m
223 223 rev: versions differ -> m
224 224 merging b
225 225 resolving b
226 226 my b@ac809aeed39a other b@af30c7647fc7 ancestor b@000000000000
227 227 merging rev
228 228 resolving rev
229 229 my rev@ac809aeed39a other rev@af30c7647fc7 ancestor rev@924404dff337
230 230 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
231 231 (branch merge, don't forget to commit)
232 232 --------------
233 233 M b
234 234 C a
235 235 --------------
236 236
237 237 --------------
238 238 test L:up b R:nm a b W: - 13 merge b no ancestor
239 239 --------------
240 240 resolving manifests
241 241 overwrite None branchmerge True partial False
242 242 ancestor 59318016310c local e03727d2d66b remote 924404dff337
243 243 a: other deleted -> r
244 244 b: versions differ -> m
245 245 rev: versions differ -> m
246 246 removing a
247 247 merging b
248 248 resolving b
249 249 my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
250 250 merging rev
251 251 resolving rev
252 252 my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
253 253 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
254 254 (branch merge, don't forget to commit)
255 255 --------------
256 256 M b
257 257 --------------
258 258
259 259 --------------
260 260 test L:nc a b R:up a b W: - 14 merge b no ancestor
261 261 --------------
262 262 resolving manifests
263 263 overwrite None branchmerge True partial False
264 264 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
265 265 a: remote is newer -> g
266 266 b: versions differ -> m
267 267 rev: versions differ -> m
268 268 getting a
269 269 merging b
270 270 resolving b
271 271 my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
272 272 merging rev
273 273 resolving rev
274 274 my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
275 275 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
276 276 (branch merge, don't forget to commit)
277 277 --------------
278 278 M a
279 279 M b
280 280 --------------
281 281
282 282 --------------
283 283 test L:up b R:nm a b W: - 15 merge b no ancestor, remove a
284 284 --------------
285 285 resolving manifests
286 286 overwrite None branchmerge True partial False
287 287 ancestor 59318016310c local e03727d2d66b remote 924404dff337
288 288 a: other deleted -> r
289 289 b: versions differ -> m
290 290 rev: versions differ -> m
291 291 removing a
292 292 merging b
293 293 resolving b
294 294 my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
295 295 merging rev
296 296 resolving rev
297 297 my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
298 298 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
299 299 (branch merge, don't forget to commit)
300 300 --------------
301 301 M b
302 302 --------------
303 303
304 304 --------------
305 305 test L:nc a b R:up a b W: - 16 get a, merge b no ancestor
306 306 --------------
307 307 resolving manifests
308 308 overwrite None branchmerge True partial False
309 309 ancestor ac809aeed39a local 8dbce441892a remote 924404dff337
310 310 a: remote is newer -> g
311 311 b: versions differ -> m
312 312 rev: versions differ -> m
313 313 getting a
314 314 merging b
315 315 resolving b
316 316 my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
317 317 merging rev
318 318 resolving rev
319 319 my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
320 320 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
321 321 (branch merge, don't forget to commit)
322 322 --------------
323 323 M a
324 324 M b
325 325 --------------
326 326
327 327 --------------
328 328 test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor
329 329 --------------
330 330 resolving manifests
331 331 overwrite None branchmerge True partial False
332 332 ancestor 0b76e65c8289 local 735846fee2d7 remote 924404dff337
333 333 b: versions differ -> m
334 334 rev: versions differ -> m
335 335 merging b
336 336 resolving b
337 337 my b@0b76e65c8289 other b@735846fee2d7 ancestor b@000000000000
338 338 merging rev
339 339 resolving rev
340 340 my rev@0b76e65c8289 other rev@735846fee2d7 ancestor rev@924404dff337
341 341 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
342 342 (branch merge, don't forget to commit)
343 343 --------------
344 344 M b
345 345 C a
346 346 --------------
347 347
348 348 --------------
349 349 test L:nm a b R:up a b W: - 18 merge b no ancestor
350 350 --------------
351 351 resolving manifests
352 352 overwrite None branchmerge True partial False
353 353 ancestor ecf3cb2a4219 local 8dbce441892a remote 924404dff337
354 354 b: versions differ -> m
355 355 rev: versions differ -> m
356 356 a: prompt recreating -> g
357 357 getting a
358 358 merging b
359 359 resolving b
360 360 my b@ecf3cb2a4219 other b@8dbce441892a ancestor b@000000000000
361 361 merging rev
362 362 resolving rev
363 363 my rev@ecf3cb2a4219 other rev@8dbce441892a ancestor rev@924404dff337
364 364 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
365 365 (branch merge, don't forget to commit)
366 366 --------------
367 367 M a
368 368 M b
369 369 --------------
370 370
371 371 --------------
372 372 test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a
373 373 --------------
374 374 resolving manifests
375 375 overwrite None branchmerge True partial False
376 376 ancestor 0b76e65c8289 local e03727d2d66b remote 924404dff337
377 377 b: versions differ -> m
378 378 rev: versions differ -> m
379 379 merging b
380 380 resolving b
381 381 my b@0b76e65c8289 other b@e03727d2d66b ancestor b@000000000000
382 382 merging rev
383 383 resolving rev
384 384 my rev@0b76e65c8289 other rev@e03727d2d66b ancestor rev@924404dff337
385 385 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
386 386 (branch merge, don't forget to commit)
387 387 --------------
388 388 M b
389 389 C a
390 390 --------------
391 391
392 392 --------------
393 393 test L:up a R:um a b W: - 20 merge a and b to b, remove a
394 394 --------------
395 395 resolving manifests
396 396 overwrite None branchmerge True partial False
397 397 ancestor e300d1c794ec local 79cc6877a3b7 remote 924404dff337
398 398 a: remote moved -> c
399 399 rev: versions differ -> m
400 400 merging a and b to b
401 401 resolving a
402 402 my a@e300d1c794ec other b@79cc6877a3b7 ancestor a@924404dff337
403 403 copying a to b
404 404 removing a
405 405 merging rev
406 406 resolving rev
407 407 my rev@e300d1c794ec other rev@79cc6877a3b7 ancestor rev@924404dff337
408 408 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
409 409 (branch merge, don't forget to commit)
410 410 --------------
411 411 M b
412 412 a
413 413 --------------
414 414
415 415 --------------
416 416 test L:um a b R:up a W: - 21 merge a and b to b
417 417 --------------
418 418 resolving manifests
419 419 overwrite None branchmerge True partial False
420 420 ancestor ec03c2ca8642 local f4db7e329e71 remote 924404dff337
421 421 b: local moved -> c
422 422 rev: versions differ -> m
423 423 merging b and a to b
424 424 resolving b
425 425 my b@ec03c2ca8642 other a@f4db7e329e71 ancestor a@924404dff337
426 426 merging rev
427 427 resolving rev
428 428 my rev@ec03c2ca8642 other rev@f4db7e329e71 ancestor rev@924404dff337
429 429 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
430 430 (branch merge, don't forget to commit)
431 431 --------------
432 432 M b
433 433 --------------
434 434
435 435 --------------
436 436 test L:nm a b R:up a c W: - 23 get c, keep b
437 437 --------------
438 438 resolving manifests
439 439 overwrite None branchmerge True partial False
440 440 ancestor ecf3cb2a4219 local 2b958612230f remote 924404dff337
441 441 b: local moved -> c
442 442 rev: versions differ -> m
443 443 c: remote created -> g
444 444 merging b and a to b
445 445 resolving b
446 446 my b@ecf3cb2a4219 other a@2b958612230f ancestor a@924404dff337
447 447 getting c
448 448 merging rev
449 449 resolving rev
450 450 my rev@ecf3cb2a4219 other rev@2b958612230f ancestor rev@924404dff337
451 451 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
452 452 (branch merge, don't forget to commit)
453 453 --------------
454 454 M b
455 455 M c
456 456 --------------
457 457
General Comments 0
You need to be logged in to leave comments. Login now