##// END OF EJS Templates
tests: add test-issue3084.t cases for 'changed but same' as for 'unchanged'...
Mads Kiilerich -
r23418:c90d9ab6 stable
parent child Browse files
Show More
@@ -1,401 +1,471 b''
1 1
2 2 $ echo "[extensions]" >> $HGRCPATH
3 3 $ echo "largefiles =" >> $HGRCPATH
4 4
5 5 Create the repository outside $HOME since largefiles write to
6 6 $HOME/.cache/largefiles.
7 7
8 8 $ hg init test
9 9 $ cd test
10 10 $ echo "root" > root
11 11 $ hg add root
12 12 $ hg commit -m "Root commit" --config extensions.largefiles=!
13 13
14 14 Ensure that .hg/largefiles isn't created before largefiles are added
15 15 #if unix-permissions
16 16 $ chmod 555 .hg
17 17 #endif
18 18 $ hg status
19 19 #if unix-permissions
20 20 $ chmod 755 .hg
21 21 #endif
22 22
23 23 $ test -f .hg/largefiles
24 24 [1]
25 25
26 26 $ echo "large" > foo
27 27 $ hg add --large foo
28 28 $ hg commit -m "Add foo as a largefile"
29 29
30 30 $ hg update -r 0
31 31 getting changed largefiles
32 32 0 largefiles updated, 1 removed
33 33 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
34 34
35 35 $ echo "normal" > foo
36 36 $ hg add foo
37 37 $ hg commit -m "Add foo as normal file"
38 38 created new head
39 39
40 40 Normal file in the working copy, keeping the normal version:
41 41
42 42 $ echo "n" | hg merge --config ui.interactive=Yes
43 43 remote turned local normal file foo into a largefile
44 44 use (l)argefile or keep (n)ormal file? n
45 45 getting changed largefiles
46 46 0 largefiles updated, 0 removed
47 47 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 48 (branch merge, don't forget to commit)
49 49
50 50 $ hg status
51 51 $ cat foo
52 52 normal
53 53
54 54 Normal file in the working copy, keeping the largefile version:
55 55
56 56 $ hg update -q -C
57 57 $ echo "l" | hg merge --config ui.interactive=Yes
58 58 remote turned local normal file foo into a largefile
59 59 use (l)argefile or keep (n)ormal file? l
60 60 getting changed largefiles
61 61 1 largefiles updated, 0 removed
62 62 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
63 63 (branch merge, don't forget to commit)
64 64
65 65 $ hg status
66 66 M foo
67 67
68 68 $ hg diff --nodates
69 69 diff -r fa129ab6b5a7 .hglf/foo
70 70 --- /dev/null
71 71 +++ b/.hglf/foo
72 72 @@ -0,0 +1,1 @@
73 73 +7f7097b041ccf68cc5561e9600da4655d21c6d18
74 74 diff -r fa129ab6b5a7 foo
75 75 --- a/foo
76 76 +++ /dev/null
77 77 @@ -1,1 +0,0 @@
78 78 -normal
79 79
80 80 $ cat foo
81 81 large
82 82
83 83 Largefile in the working copy, keeping the normal version:
84 84
85 85 $ hg update -q -C -r 1
86 86 $ echo "n" | hg merge --config ui.interactive=Yes
87 87 remote turned local largefile foo into a normal file
88 88 keep (l)argefile or use (n)ormal file? n
89 89 getting changed largefiles
90 90 0 largefiles updated, 0 removed
91 91 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
92 92 (branch merge, don't forget to commit)
93 93
94 94 $ hg status
95 95 M foo
96 96
97 97 $ hg diff --nodates
98 98 diff -r ff521236428a .hglf/foo
99 99 --- a/.hglf/foo
100 100 +++ /dev/null
101 101 @@ -1,1 +0,0 @@
102 102 -7f7097b041ccf68cc5561e9600da4655d21c6d18
103 103 diff -r ff521236428a foo
104 104 --- /dev/null
105 105 +++ b/foo
106 106 @@ -0,0 +1,1 @@
107 107 +normal
108 108
109 109 $ cat foo
110 110 normal
111 111
112 112 Largefile in the working copy, keeping the largefile version:
113 113
114 114 $ hg update -q -C -r 1
115 115 $ echo "l" | hg merge --config ui.interactive=Yes
116 116 remote turned local largefile foo into a normal file
117 117 keep (l)argefile or use (n)ormal file? l
118 118 getting changed largefiles
119 119 1 largefiles updated, 0 removed
120 120 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
121 121 (branch merge, don't forget to commit)
122 122
123 123 $ hg status
124 124
125 125 $ cat foo
126 126 large
127 127
128 128 Whatever ... commit something so we can invoke merge when updating
129 129
130 130 $ hg commit -m '3: Merge'
131 131
132 132 Updating from largefile to normal - no reason to prompt
133 133
134 134 $ hg up -r 2
135 135 getting changed largefiles
136 136 0 largefiles updated, 0 removed
137 137 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
138 138 $ cat foo
139 139 normal
140 140
141 141 (the update above used to leave the working dir in a very weird state - clean it
142 142 $ hg up -qr null
143 143 $ hg up -qr 2
144 144 )
145 145
146 146 Updating from normal to largefile - no reason to prompt
147 147
148 148 $ hg up -r 3
149 149 getting changed largefiles
150 150 1 largefiles updated, 0 removed
151 151 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
152 152 $ cat foo
153 153 large
154 154
155 155 $ cd ..
156 156
157 157
158 158 Systematic testing of merges involving largefiles:
159 159
160 160 Ancestor: normal Parent: normal-id Parent: large result: large
161 161 Ancestor: normal Parent: normal2 Parent: large result: ?
162 162 Ancestor: large Parent: large-id Parent: normal result: normal
163 163 Ancestor: large Parent: large2 Parent: normal result: ?
164 164
165 165 All cases should try merging both ways.
166 166
167 167 Prepare test repo:
168 168
169 169 $ hg init merges
170 170 $ cd merges
171 171
172 172 prepare cases with "normal" ancestor:
173 173
174 174 $ hg up -qr null
175 175 $ echo normal > f
176 176 $ hg ci -Aqm "normal-ancestor"
177 177 $ hg tag -l "normal-ancestor"
178 178 $ touch f2
179 179 $ hg ci -Aqm "normal-id"
180 180 $ hg tag -l "normal-id"
181 181 $ echo normal2 > f
182 182 $ hg ci -m "normal2"
183 183 $ hg tag -l "normal2"
184 $ echo normal > f
185 $ hg ci -Aqm "normal-same"
186 $ hg tag -l "normal-same"
184 187 $ hg up -qr "normal-ancestor"
185 188 $ hg rm f
186 189 $ echo large > f
187 190 $ hg add --large f
188 191 $ hg ci -qm "large"
189 192 $ hg tag -l "large"
190 193
191 194 prepare cases with "large" ancestor:
192 195
193 196 $ hg up -qr null
194 197 $ echo large > f
195 198 $ hg add --large f
196 199 $ hg ci -qm "large-ancestor"
197 200 $ hg tag -l "large-ancestor"
198 201 $ touch f2
199 202 $ hg ci -Aqm "large-id"
200 203 $ hg tag -l "large-id"
201 204 $ echo large2 > f
202 205 $ hg ci -m "large2"
203 206 $ hg tag -l "large2"
207 $ echo large > f
208 $ hg ci -Aqm "large-same"
209 $ hg tag -l "large-same"
204 210 $ hg up -qr "large-ancestor"
205 211 $ hg rm f
206 212 $ echo normal > f
207 213 $ hg ci -qAm "normal"
208 214 $ hg tag -l "normal"
209 215
210 216 $ hg log -GT '{tags}'
211 217 @ normal tip
212 218 |
219 | o large-same
220 | |
213 221 | o large2
214 222 | |
215 223 | o large-id
216 224 |/
217 225 o large-ancestor
218 226
219 227 o large
220 228 |
229 | o normal-same
230 | |
221 231 | o normal2
222 232 | |
223 233 | o normal-id
224 234 |/
225 235 o normal-ancestor
226 236
227 237
228 238
229 239 Ancestor: normal Parent: normal-id Parent: large result: large
230 240
231 241 $ hg up -Cqr normal-id
232 242 $ hg merge -r large
233 243 getting changed largefiles
234 244 1 largefiles updated, 0 removed
235 245 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
236 246 (branch merge, don't forget to commit)
237 247 $ cat f
238 248 large
239 249
240 250 swap
241 251
242 252 $ hg up -Cqr large
243 253 $ hg merge -r normal-id
244 254 getting changed largefiles
245 255 0 largefiles updated, 0 removed
246 256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 257 (branch merge, don't forget to commit)
248 258 $ cat f
249 259 large
250 260
261 Ancestor: normal Parent: normal-same Parent: large result: large
262
263 $ hg up -Cqr normal-same
264 $ hg merge -r large
265 local changed f which remote deleted
266 use (c)hanged version or (d)elete? c
267 remote turned local normal file f into a largefile
268 use (l)argefile or keep (n)ormal file? l
269 getting changed largefiles
270 1 largefiles updated, 0 removed
271 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
272 (branch merge, don't forget to commit)
273 $ cat f
274 large
275
276 swap
277
278 $ hg up -Cqr large
279 $ hg merge -r normal-same
280 remote changed f which local deleted
281 use (c)hanged version or leave (d)eleted? c
282 remote turned local largefile f into a normal file
283 keep (l)argefile or use (n)ormal file? l
284 getting changed largefiles
285 1 largefiles updated, 0 removed
286 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
287 (branch merge, don't forget to commit)
288 $ cat f
289 large
290
251 291 Ancestor: normal Parent: normal2 Parent: large result: ?
252 292 (annoying extra prompt ... but it do not do any serious harm)
253 293
254 294 $ hg up -Cqr normal2
255 295 $ hg merge -r large
256 296 local changed f which remote deleted
257 297 use (c)hanged version or (d)elete? c
258 298 remote turned local normal file f into a largefile
259 299 use (l)argefile or keep (n)ormal file? l
260 300 getting changed largefiles
261 301 1 largefiles updated, 0 removed
262 302 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
263 303 (branch merge, don't forget to commit)
264 304 $ cat f
265 305 large
266 306
267 307 $ hg up -Cqr normal2
268 308 $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes
269 309 local changed f which remote deleted
270 310 use (c)hanged version or (d)elete? c
271 311 remote turned local normal file f into a largefile
272 312 use (l)argefile or keep (n)ormal file? n
273 313 getting changed largefiles
274 314 0 largefiles updated, 0 removed
275 315 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
276 316 (branch merge, don't forget to commit)
277 317 $ cat f
278 318 normal2
279 319
280 320 $ hg up -Cqr normal2
281 321 $ echo d | hg merge -r large --config ui.interactive=Yes
282 322 local changed f which remote deleted
283 323 use (c)hanged version or (d)elete? d
284 324 getting changed largefiles
285 325 1 largefiles updated, 0 removed
286 326 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
287 327 (branch merge, don't forget to commit)
288 328 $ cat f
289 329 large
290 330
291 331 swap
292 332
293 333 $ hg up -Cqr large
294 334 $ hg merge -r normal2
295 335 remote changed f which local deleted
296 336 use (c)hanged version or leave (d)eleted? c
297 337 remote turned local largefile f into a normal file
298 338 keep (l)argefile or use (n)ormal file? l
299 339 getting changed largefiles
300 340 1 largefiles updated, 0 removed
301 341 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
302 342 (branch merge, don't forget to commit)
303 343 $ cat f
304 344 large
305 345
306 346 $ hg up -Cqr large
307 347 $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes
308 348 remote changed f which local deleted
309 349 use (c)hanged version or leave (d)eleted? c
310 350 remote turned local largefile f into a normal file
311 351 keep (l)argefile or use (n)ormal file? n
312 352 getting changed largefiles
313 353 0 largefiles updated, 0 removed
314 354 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
315 355 (branch merge, don't forget to commit)
316 356 $ cat f
317 357 normal2
318 358
319 359 $ hg up -Cqr large
320 360 $ echo d | hg merge -r normal2 --config ui.interactive=Yes
321 361 remote changed f which local deleted
322 362 use (c)hanged version or leave (d)eleted? d
323 363 getting changed largefiles
324 364 0 largefiles updated, 0 removed
325 365 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 366 (branch merge, don't forget to commit)
327 367 $ cat f
328 368 large
329 369
330 370 Ancestor: large Parent: large-id Parent: normal result: normal
331 371
332 372 $ hg up -Cqr large-id
333 373 $ hg merge -r normal
334 374 getting changed largefiles
335 375 0 largefiles updated, 0 removed
336 376 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
337 377 (branch merge, don't forget to commit)
338 378 $ cat f
339 379 normal
340 380
341 381 swap
342 382
343 383 $ hg up -Cqr normal
344 384 $ hg merge -r large-id
345 385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 386 (branch merge, don't forget to commit)
347 387 $ cat f
348 388 normal
349 389
390 Ancestor: large Parent: large-same Parent: normal result: normal
391
392 $ hg up -Cqr large-same
393 $ hg merge -r normal
394 local changed .hglf/f which remote deleted
395 use (c)hanged version or (d)elete? c
396 remote turned local largefile f into a normal file
397 keep (l)argefile or use (n)ormal file? l
398 getting changed largefiles
399 1 largefiles updated, 0 removed
400 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
401 (branch merge, don't forget to commit)
402 $ cat f
403 large
404
405 swap
406
407 $ hg up -Cqr normal
408 $ hg merge -r large-same
409 remote changed .hglf/f which local deleted
410 use (c)hanged version or leave (d)eleted? c
411 remote turned local normal file f into a largefile
412 use (l)argefile or keep (n)ormal file? l
413 getting changed largefiles
414 1 largefiles updated, 0 removed
415 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
416 (branch merge, don't forget to commit)
417 $ cat f
418 large
419
350 420 Ancestor: large Parent: large2 Parent: normal result: ?
351 421 (annoying extra prompt ... but it do not do any serious harm)
352 422
353 423 $ hg up -Cqr large2
354 424 $ hg merge -r normal
355 425 local changed .hglf/f which remote deleted
356 426 use (c)hanged version or (d)elete? c
357 427 remote turned local largefile f into a normal file
358 428 keep (l)argefile or use (n)ormal file? l
359 429 getting changed largefiles
360 430 1 largefiles updated, 0 removed
361 431 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
362 432 (branch merge, don't forget to commit)
363 433 $ cat f
364 434 large2
365 435
366 436 $ hg up -Cqr large2
367 437 $ echo d | hg merge -r normal --config ui.interactive=Yes
368 438 local changed .hglf/f which remote deleted
369 439 use (c)hanged version or (d)elete? d
370 440 getting changed largefiles
371 441 0 largefiles updated, 0 removed
372 442 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
373 443 (branch merge, don't forget to commit)
374 444 $ cat f
375 445 normal
376 446
377 447 swap
378 448
379 449 $ hg up -Cqr normal
380 450 $ hg merge -r large2
381 451 remote changed .hglf/f which local deleted
382 452 use (c)hanged version or leave (d)eleted? c
383 453 remote turned local normal file f into a largefile
384 454 use (l)argefile or keep (n)ormal file? l
385 455 getting changed largefiles
386 456 1 largefiles updated, 0 removed
387 457 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
388 458 (branch merge, don't forget to commit)
389 459 $ cat f
390 460 large2
391 461
392 462 $ hg up -Cqr normal
393 463 $ echo d | hg merge -r large2 --config ui.interactive=Yes
394 464 remote changed .hglf/f which local deleted
395 465 use (c)hanged version or leave (d)eleted? d
396 466 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 467 (branch merge, don't forget to commit)
398 468 $ cat f
399 469 normal
400 470
401 471 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now