##// END OF EJS Templates
test-largefiles-update: conditionalize output instead of tests
Matt Harbison -
r33344:1e872b08 default
parent child Browse files
Show More
@@ -1,788 +1,780 b''
1 1 This file focuses mainly on updating largefiles in the working
2 2 directory (and ".hg/largefiles/dirstate")
3 3
4 4 $ cat >> $HGRCPATH <<EOF
5 5 > [ui]
6 6 > merge = internal:fail
7 7 > [extensions]
8 8 > largefiles =
9 9 > [extdiff]
10 10 > # for portability:
11 11 > pdiff = sh "$RUNTESTDIR/pdiff"
12 12 > EOF
13 13
14 14 $ hg init repo
15 15 $ cd repo
16 16
17 17 $ echo large1 > large1
18 18 $ echo large2 > large2
19 19 $ hg add --large large1 large2
20 20 $ echo normal1 > normal1
21 21 $ hg add normal1
22 22 $ hg commit -m '#0'
23 23 $ echo 'large1 in #1' > large1
24 24 $ echo 'normal1 in #1' > normal1
25 25 $ hg commit -m '#1'
26 26 $ hg pdiff -r '.^' --config extensions.extdiff=
27 27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
28 28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
29 29 +++ repo/.hglf/large1 * (glob)
30 30 @@ -1* +1* @@ (glob)
31 31 -4669e532d5b2c093a78eca010077e708a071bb64
32 32 +58e24f733a964da346e2407a2bee99d9001184f5
33 33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
34 34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
35 35 +++ repo/normal1 * (glob)
36 36 @@ -1* +1* @@ (glob)
37 37 -normal1
38 38 +normal1 in #1
39 39 [1]
40 40 $ hg update -q -C 0
41 41 $ echo 'large2 in #2' > large2
42 42 $ hg commit -m '#2'
43 43 created new head
44 44
45 45 Test that update also updates the lfdirstate of 'unsure' largefiles after
46 46 hashing them:
47 47
48 48 The previous operations will usually have left us with largefiles with a mtime
49 49 within the same second as the dirstate was written.
50 50 The lfdirstate entries will thus have been written with an invalidated/unset
51 51 mtime to make sure further changes within the same second is detected.
52 52 We will however occasionally be "lucky" and get a tick between writing
53 53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
54 54 following verification is thus disabled but can be verified manually.
55 55
56 56 #if false
57 57 $ hg debugdirstate --large --nodate
58 58 n 644 7 unset large1
59 59 n 644 13 unset large2
60 60 #endif
61 61
62 62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
63 63
64 64 $ sleep 1
65 65
66 66 A linear merge will update standins before performing the actual merge. It will
67 67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
68 68 update the corresponding standins.
69 69 Verify that it actually marks the clean files as clean in lfdirstate so
70 70 we don't have to hash them again next time we update.
71 71
72 72 $ hg up
73 73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 74 updated to "f74e50bd9e55: #2"
75 75 1 other heads for branch "default"
76 76 $ hg debugdirstate --large --nodate
77 77 n 644 7 set large1
78 78 n 644 13 set large2
79 79
80 80 Test that lfdirstate keeps track of last modification of largefiles and
81 81 prevents unnecessary hashing of content - also after linear/noop update
82 82
83 83 $ sleep 1
84 84 $ hg st
85 85 $ hg debugdirstate --large --nodate
86 86 n 644 7 set large1
87 87 n 644 13 set large2
88 88 $ hg up
89 89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 90 updated to "f74e50bd9e55: #2"
91 91 1 other heads for branch "default"
92 92 $ hg debugdirstate --large --nodate
93 93 n 644 7 set large1
94 94 n 644 13 set large2
95 95
96 96 Test that "hg merge" updates largefiles from "other" correctly
97 97
98 98 (getting largefiles from "other" normally)
99 99
100 100 $ hg status -A large1
101 101 C large1
102 102 $ cat large1
103 103 large1
104 104 $ cat .hglf/large1
105 105 4669e532d5b2c093a78eca010077e708a071bb64
106 106 $ hg merge --config debug.dirstate.delaywrite=2
107 107 getting changed largefiles
108 108 1 largefiles updated, 0 removed
109 109 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 110 (branch merge, don't forget to commit)
111 111 $ hg status -A large1
112 112 M large1
113 113 $ cat large1
114 114 large1 in #1
115 115 $ cat .hglf/large1
116 116 58e24f733a964da346e2407a2bee99d9001184f5
117 117 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
118 118 -4669e532d5b2c093a78eca010077e708a071bb64
119 119 +58e24f733a964da346e2407a2bee99d9001184f5
120 120
121 121 (getting largefiles from "other" via conflict prompt)
122 122
123 123 $ hg update -q -C 2
124 124 $ echo 'large1 in #3' > large1
125 125 $ echo 'normal1 in #3' > normal1
126 126 $ hg commit -m '#3'
127 127 $ cat .hglf/large1
128 128 e5bb990443d6a92aaf7223813720f7566c9dd05b
129 129 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
130 130 > o
131 131 > EOF
132 132 largefile large1 has a merge conflict
133 133 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
134 134 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
135 135 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
136 136 merging normal1
137 137 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
138 138 getting changed largefiles
139 139 1 largefiles updated, 0 removed
140 140 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
141 141 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
142 142 [1]
143 143 $ hg status -A large1
144 144 M large1
145 145 $ cat large1
146 146 large1 in #1
147 147 $ cat .hglf/large1
148 148 58e24f733a964da346e2407a2bee99d9001184f5
149 149 $ rm normal1.orig
150 150
151 151 (merge non-existing largefiles from "other" via conflict prompt -
152 152 make sure the following commit doesn't abort in a confusing way when trying to
153 153 mark the non-existing file as normal in lfdirstate)
154 154
155 155 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
156 156 $ hg update -q -C 3
157 157 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
158 158 > o
159 159 > EOF
160 160 largefile large1 has a merge conflict
161 161 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
162 162 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
163 163 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
164 164 getting changed largefiles
165 165 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
166 166 0 largefiles updated, 0 removed
167 167 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
168 168 (branch merge, don't forget to commit)
169 169 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
170 170 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
171 171 $ hg up -C . --config largefiles.usercache=not
172 172 getting changed largefiles
173 173 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
174 174 0 largefiles updated, 0 removed
175 175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 176 $ hg st large1
177 177 ! large1
178 178 $ hg rollback -q
179 179 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
180 180
181 181 Test that "hg revert -r REV" updates largefiles from "REV" correctly
182 182
183 183 $ hg update -q -C 3
184 184 $ hg status -A large1
185 185 C large1
186 186 $ cat large1
187 187 large1 in #3
188 188 $ cat .hglf/large1
189 189 e5bb990443d6a92aaf7223813720f7566c9dd05b
190 190 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
191 191 -4669e532d5b2c093a78eca010077e708a071bb64
192 192 +58e24f733a964da346e2407a2bee99d9001184f5
193 193 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
194 194 $ hg status -A large1
195 195 M large1
196 196 $ cat large1
197 197 large1 in #1
198 198 $ cat .hglf/large1
199 199 58e24f733a964da346e2407a2bee99d9001184f5
200 200
201 201 Test that "hg rollback" restores status of largefiles correctly
202 202
203 203 $ hg update -C -q
204 204 $ hg remove large1
205 205 $ test -f .hglf/large1
206 206 [1]
207 207 $ hg forget large2
208 208 $ test -f .hglf/large2
209 209 [1]
210 210 $ echo largeX > largeX
211 211 $ hg add --large largeX
212 212 $ cat .hglf/largeX
213 213
214 214 $ hg commit -m 'will be rollback-ed soon'
215 215 $ echo largeY > largeY
216 216 $ hg add --large largeY
217 #if windows
217
218 218 $ hg status -A large1
219 large1: * (glob)
220 #else
221 $ hg status -A large1
222 large1: No such file or directory
223 #endif
219 large1: The system cannot find the file specified (windows !)
220 large1: No such file or directory (no-windows !)
221
224 222 $ hg status -A large2
225 223 ? large2
226 224 $ hg status -A largeX
227 225 C largeX
228 226 $ hg status -A largeY
229 227 A largeY
230 228 $ hg rollback
231 229 repository tip rolled back to revision 3 (undo commit)
232 230 working directory now based on revision 3
233 231 $ hg status -A large1
234 232 R large1
235 233 $ test -f .hglf/large1
236 234 [1]
237 235 $ hg status -A large2
238 236 R large2
239 237 $ test -f .hglf/large2
240 238 [1]
241 239 $ hg status -A largeX
242 240 A largeX
243 241 $ cat .hglf/largeX
244 242
245 243 $ hg status -A largeY
246 244 ? largeY
247 245 $ test -f .hglf/largeY
248 246 [1]
249 247 $ rm largeY
250 248
251 249 Test that "hg rollback" restores standins correctly
252 250
253 251 $ hg commit -m 'will be rollback-ed soon'
254 252 $ hg update -q -C 2
255 253 $ cat large1
256 254 large1
257 255 $ cat .hglf/large1
258 256 4669e532d5b2c093a78eca010077e708a071bb64
259 257 $ cat large2
260 258 large2 in #2
261 259 $ cat .hglf/large2
262 260 3cfce6277e7668985707b6887ce56f9f62f6ccd9
263 261
264 262 $ hg rollback -q -f
265 263 $ cat large1
266 264 large1
267 265 $ cat .hglf/large1
268 266 4669e532d5b2c093a78eca010077e708a071bb64
269 267 $ cat large2
270 268 large2 in #2
271 269 $ cat .hglf/large2
272 270 3cfce6277e7668985707b6887ce56f9f62f6ccd9
273 271
274 272 (rollback the parent of the working directory, when the parent of it
275 273 is not branch-tip)
276 274
277 275 $ hg update -q -C 1
278 276 $ cat .hglf/large1
279 277 58e24f733a964da346e2407a2bee99d9001184f5
280 278 $ cat .hglf/large2
281 279 1deebade43c8c498a3c8daddac0244dc55d1331d
282 280
283 281 $ echo normalX > normalX
284 282 $ hg add normalX
285 283 $ hg commit -m 'will be rollback-ed soon'
286 284 $ hg rollback -q
287 285
288 286 $ cat .hglf/large1
289 287 58e24f733a964da346e2407a2bee99d9001184f5
290 288 $ cat .hglf/large2
291 289 1deebade43c8c498a3c8daddac0244dc55d1331d
292 290 $ rm normalX
293 291
294 292 Test that "hg status" shows status of largefiles correctly just after
295 293 automated commit like rebase/transplant
296 294
297 295 $ cat >> .hg/hgrc <<EOF
298 296 > [extensions]
299 297 > rebase =
300 298 > strip =
301 299 > transplant =
302 300 > EOF
303 301 $ hg update -q -C 1
304 302 $ hg remove large1
305 303 $ echo largeX > largeX
306 304 $ hg add --large largeX
307 305 $ hg commit -m '#4'
308 306
309 307 $ hg rebase -s 1 -d 2 --keep
310 308 rebasing 1:72518492caa6 "#1"
311 309 rebasing 4:07d6153b5c04 "#4" (tip)
312 #if windows
310
313 311 $ hg status -A large1
314 large1: * (glob)
315 #else
316 $ hg status -A large1
317 large1: No such file or directory
318 #endif
312 large1: The system cannot find the file specified (windows !)
313 large1: No such file or directory (no-windows !)
314
319 315 $ hg status -A largeX
320 316 C largeX
321 317 $ hg strip -q 5
322 318
323 319 $ hg update -q -C 2
324 320 $ hg transplant -q 1 4
325 #if windows
321
326 322 $ hg status -A large1
327 large1: * (glob)
328 #else
329 $ hg status -A large1
330 large1: No such file or directory
331 #endif
323 large1: The system cannot find the file specified (windows !)
324 large1: No such file or directory (no-windows !)
325
332 326 $ hg status -A largeX
333 327 C largeX
334 328 $ hg strip -q 5
335 329
336 330 $ hg update -q -C 2
337 331 $ hg transplant -q --merge 1 --merge 4
338 #if windows
332
339 333 $ hg status -A large1
340 large1: * (glob)
341 #else
342 $ hg status -A large1
343 large1: No such file or directory
344 #endif
334 large1: The system cannot find the file specified (windows !)
335 large1: No such file or directory (no-windows !)
336
345 337 $ hg status -A largeX
346 338 C largeX
347 339 $ hg strip -q 5
348 340
349 341 Test that linear merge can detect modification (and conflict) correctly
350 342
351 343 (linear merge without conflict)
352 344
353 345 $ echo 'large2 for linear merge (no conflict)' > large2
354 346 $ hg update 3 --config debug.dirstate.delaywrite=2
355 347 getting changed largefiles
356 348 1 largefiles updated, 0 removed
357 349 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 350 $ hg status -A large2
359 351 M large2
360 352 $ cat large2
361 353 large2 for linear merge (no conflict)
362 354 $ cat .hglf/large2
363 355 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
364 356
365 357 (linear merge with conflict, choosing "other")
366 358
367 359 $ hg update -q -C 2
368 360 $ echo 'large1 for linear merge (conflict)' > large1
369 361 $ hg update 3 --config ui.interactive=True <<EOF
370 362 > o
371 363 > EOF
372 364 largefile large1 has a merge conflict
373 365 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
374 366 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
375 367 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
376 368 getting changed largefiles
377 369 1 largefiles updated, 0 removed
378 370 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
379 371 $ hg status -A large1
380 372 C large1
381 373 $ cat large1
382 374 large1 in #3
383 375 $ cat .hglf/large1
384 376 e5bb990443d6a92aaf7223813720f7566c9dd05b
385 377
386 378 (linear merge with conflict, choosing "local")
387 379
388 380 $ hg update -q -C 2
389 381 $ echo 'large1 for linear merge (conflict)' > large1
390 382 $ hg update 3 --config debug.dirstate.delaywrite=2
391 383 largefile large1 has a merge conflict
392 384 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
393 385 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
394 386 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
395 387 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
396 388 $ hg status -A large1
397 389 M large1
398 390 $ cat large1
399 391 large1 for linear merge (conflict)
400 392 $ cat .hglf/large1
401 393 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
402 394
403 395 Test a linear merge to a revision containing same-name normal file
404 396
405 397 $ hg update -q -C 3
406 398 $ hg remove large2
407 399 $ echo 'large2 as normal file' > large2
408 400 $ hg add large2
409 401 $ echo 'large3 as normal file' > large3
410 402 $ hg add large3
411 403 $ hg commit -m '#5'
412 404 $ hg manifest
413 405 .hglf/large1
414 406 large2
415 407 large3
416 408 normal1
417 409
418 410 (modified largefile is already switched to normal)
419 411
420 412 $ hg update -q -C 2
421 413 $ echo 'modified large2 for linear merge' > large2
422 414 $ hg update -q 5
423 415 remote turned local largefile large2 into a normal file
424 416 keep (l)argefile or use (n)ormal file? l
425 417 $ hg debugdirstate --nodates | grep large2
426 418 a 0 -1 unset .hglf/large2
427 419 r 0 0 set large2
428 420 $ hg status -A large2
429 421 A large2
430 422 $ cat large2
431 423 modified large2 for linear merge
432 424
433 425 (added largefile is already committed as normal)
434 426
435 427 $ hg update -q -C 2
436 428 $ echo 'large3 as large file for linear merge' > large3
437 429 $ hg add --large large3
438 430 $ hg update -q 5
439 431 remote turned local largefile large3 into a normal file
440 432 keep (l)argefile or use (n)ormal file? l
441 433 $ hg debugdirstate --nodates | grep large3
442 434 a 0 -1 unset .hglf/large3
443 435 r 0 0 set large3
444 436 $ hg status -A large3
445 437 A large3
446 438 $ cat large3
447 439 large3 as large file for linear merge
448 440 $ rm -f large3 .hglf/large3
449 441
450 442 Test that the internal linear merging works correctly
451 443 (both heads are stripped to keep pairing of revision number and commit log)
452 444
453 445 $ hg update -q -C 2
454 446 $ hg strip 3 4
455 447 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
456 448 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
457 449
458 450 (internal linear merging at "hg pull --update")
459 451
460 452 $ echo 'large1 for linear merge (conflict)' > large1
461 453 $ echo 'large2 for linear merge (conflict with normal file)' > large2
462 454 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
463 455 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
464 456 searching for changes
465 457 adding changesets
466 458 adding manifests
467 459 adding file changes
468 460 added 3 changesets with 5 changes to 5 files
469 461 remote turned local largefile large2 into a normal file
470 462 keep (l)argefile or use (n)ormal file? l
471 463 largefile large1 has a merge conflict
472 464 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
473 465 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
474 466 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
475 467 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
476 468 updated to "d65e59e952a9: #5"
477 469 1 other heads for branch "default"
478 470
479 471 $ hg status -A large1
480 472 M large1
481 473 $ cat large1
482 474 large1 for linear merge (conflict)
483 475 $ cat .hglf/large1
484 476 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
485 477 $ hg status -A large2
486 478 A large2
487 479 $ cat large2
488 480 large2 for linear merge (conflict with normal file)
489 481 $ cat .hglf/large2
490 482 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
491 483
492 484 (internal linear merging at "hg unbundle --update")
493 485
494 486 $ hg update -q -C 2
495 487 $ hg rollback -q
496 488
497 489 $ echo 'large1 for linear merge (conflict)' > large1
498 490 $ echo 'large2 for linear merge (conflict with normal file)' > large2
499 491 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
500 492 adding changesets
501 493 adding manifests
502 494 adding file changes
503 495 added 3 changesets with 5 changes to 5 files
504 496 remote turned local largefile large2 into a normal file
505 497 keep (l)argefile or use (n)ormal file? l
506 498 largefile large1 has a merge conflict
507 499 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
508 500 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
509 501 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
510 502 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
511 503 updated to "d65e59e952a9: #5"
512 504 1 other heads for branch "default"
513 505
514 506 $ hg status -A large1
515 507 M large1
516 508 $ cat large1
517 509 large1 for linear merge (conflict)
518 510 $ cat .hglf/large1
519 511 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
520 512 $ hg status -A large2
521 513 A large2
522 514 $ cat large2
523 515 large2 for linear merge (conflict with normal file)
524 516 $ cat .hglf/large2
525 517 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
526 518
527 519 (internal linear merging in subrepo at "hg update")
528 520
529 521 $ cd ..
530 522 $ hg init subparent
531 523 $ cd subparent
532 524
533 525 $ hg clone -q -u 2 ../repo sub
534 526 $ cat > .hgsub <<EOF
535 527 > sub = sub
536 528 > EOF
537 529 $ hg add .hgsub
538 530 $ hg commit -m '#0@parent'
539 531 $ cat .hgsubstate
540 532 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
541 533 $ hg -R sub update -q
542 534 $ hg commit -m '#1@parent'
543 535 $ cat .hgsubstate
544 536 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
545 537 $ hg update -q 0
546 538
547 539 $ echo 'large1 for linear merge (conflict)' > sub/large1
548 540 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
549 541 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
550 542 > m
551 543 > r
552 544 > l
553 545 > l
554 546 > EOF
555 547 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
556 548 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
557 549 subrepository sources for sub differ (in checked out version)
558 550 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
559 551 remote turned local largefile large2 into a normal file
560 552 keep (l)argefile or use (n)ormal file? l
561 553 largefile large1 has a merge conflict
562 554 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
563 555 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
564 556 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
565 557 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
566 558 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
567 559
568 560 $ hg -R sub status -A sub/large1
569 561 M sub/large1
570 562 $ cat sub/large1
571 563 large1 for linear merge (conflict)
572 564 $ cat sub/.hglf/large1
573 565 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
574 566 $ hg -R sub status -A sub/large2
575 567 A sub/large2
576 568 $ cat sub/large2
577 569 large2 for linear merge (conflict with normal file)
578 570 $ cat sub/.hglf/large2
579 571 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
580 572
581 573 $ cd ..
582 574 $ cd repo
583 575
584 576 Test that rebase updates largefiles in the working directory even if
585 577 it is aborted by conflict.
586 578
587 579 $ hg update -q -C 3
588 580 $ cat .hglf/large1
589 581 e5bb990443d6a92aaf7223813720f7566c9dd05b
590 582 $ cat large1
591 583 large1 in #3
592 584 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
593 585 > o
594 586 > EOF
595 587 rebasing 1:72518492caa6 "#1"
596 588 largefile large1 has a merge conflict
597 589 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
598 590 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
599 591 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
600 592 merging normal1
601 593 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
602 594 unresolved conflicts (see hg resolve, then hg rebase --continue)
603 595 [1]
604 596 $ cat .hglf/large1
605 597 58e24f733a964da346e2407a2bee99d9001184f5
606 598 $ cat large1
607 599 large1 in #1
608 600 $ rm normal1.orig
609 601
610 602 Test that rebase updates standins for manually modified largefiles at
611 603 the 1st commit of resuming.
612 604
613 605 $ echo "manually modified before 'hg rebase --continue'" > large1
614 606 $ hg resolve -m normal1
615 607 (no more unresolved files)
616 608 continue: hg rebase --continue
617 609 $ hg rebase --continue --config ui.interactive=True <<EOF
618 610 > c
619 611 > EOF
620 612 rebasing 1:72518492caa6 "#1"
621 613 rebasing 4:07d6153b5c04 "#4"
622 614 local [dest] changed .hglf/large1 which other [source] deleted
623 615 use (c)hanged version, (d)elete, or leave (u)nresolved? c
624 616
625 617 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
626 618 -e5bb990443d6a92aaf7223813720f7566c9dd05b
627 619 +8a4f783556e7dea21139ca0466eafce954c75c13
628 620 $ rm -f large1
629 621 $ hg update -q -C tip
630 622 $ cat large1
631 623 manually modified before 'hg rebase --continue'
632 624
633 625 Test that transplant updates largefiles, of which standins are safely
634 626 changed, even if it is aborted by conflict of other.
635 627
636 628 $ hg update -q -C 5
637 629 $ cat .hglf/large1
638 630 e5bb990443d6a92aaf7223813720f7566c9dd05b
639 631 $ cat large1
640 632 large1 in #3
641 633 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
642 634 +fa44618ea25181aff4f48b70428294790cec9f61
643 635 $ hg transplant 4
644 636 applying 07d6153b5c04
645 637 patching file .hglf/large1
646 638 Hunk #1 FAILED at 0
647 639 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
648 640 patch failed to apply
649 641 abort: fix up the working directory and run hg transplant --continue
650 642 [255]
651 643 $ hg status -A large1
652 644 C large1
653 645 $ cat .hglf/large1
654 646 e5bb990443d6a92aaf7223813720f7566c9dd05b
655 647 $ cat large1
656 648 large1 in #3
657 649 $ hg status -A largeX
658 650 A largeX
659 651 $ cat .hglf/largeX
660 652 fa44618ea25181aff4f48b70428294790cec9f61
661 653 $ cat largeX
662 654 largeX
663 655
664 656 Test that transplant updates standins for manually modified largefiles
665 657 at the 1st commit of resuming.
666 658
667 659 $ echo "manually modified before 'hg transplant --continue'" > large1
668 660 $ hg transplant --continue
669 661 07d6153b5c04 transplanted as f1bf30eb88cc
670 662 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
671 663 -e5bb990443d6a92aaf7223813720f7566c9dd05b
672 664 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
673 665 $ rm -f large1
674 666 $ hg update -q -C tip
675 667 $ cat large1
676 668 manually modified before 'hg transplant --continue'
677 669
678 670 Test that "hg status" doesn't show removal of largefiles not managed
679 671 in the target context.
680 672
681 673 $ hg update -q -C 4
682 674 $ hg remove largeX
683 675 $ hg status -A largeX
684 676 R largeX
685 677 $ hg status -A --rev '.^1' largeX
686 678
687 679 #if execbit
688 680
689 681 Test that "hg status" against revisions other than parent notices exec
690 682 bit changes of largefiles.
691 683
692 684 $ hg update -q -C 4
693 685
694 686 (the case that large2 doesn't have exec bit in the target context but
695 687 in the working context)
696 688
697 689 $ chmod +x large2
698 690 $ hg status -A --rev 0 large2
699 691 M large2
700 692 $ hg commit -m 'chmod +x large2'
701 693
702 694 (the case that large2 has exec bit in the target context but not in
703 695 the working context)
704 696
705 697 $ echo dummy > dummy
706 698 $ hg add dummy
707 699 $ hg commit -m 'revision for separation'
708 700 $ chmod -x large2
709 701 $ hg status -A --rev '.^1' large2
710 702 M large2
711 703
712 704 #else
713 705
714 706 Test that "hg status" against revisions other than parent ignores exec
715 707 bit correctly on the platform being unaware of it.
716 708
717 709 $ hg update -q -C 4
718 710
719 711 $ cat > ../exec-bit.patch <<EOF
720 712 > # HG changeset patch
721 713 > # User test
722 714 > # Date 0 0
723 715 > # Thu Jan 01 00:00:00 1970 +0000
724 716 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
725 717 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
726 718 > chmod +x large2
727 719 >
728 720 > diff --git a/.hglf/large2 b/.hglf/large2
729 721 > old mode 100644
730 722 > new mode 100755
731 723 > EOF
732 724 $ hg import --exact --bypass ../exec-bit.patch
733 725 applying ../exec-bit.patch
734 726 $ hg status -A --rev tip large2
735 727 C large2
736 728
737 729 #endif
738 730
739 731 Test a fatal error interrupting an update. Verify that status report dirty
740 732 files correctly after an interrupted update. Also verify that checking all
741 733 hashes reveals it isn't clean.
742 734
743 735 Start with clean dirstates:
744 736 $ hg up --quiet --clean --rev "8^"
745 737 $ sleep 1
746 738 $ hg st
747 739 Update standins without updating largefiles - large1 is modified and largeX is
748 740 added:
749 741 $ cat << EOF > ../crashupdatelfiles.py
750 742 > import hgext.largefiles.lfutil
751 743 > def getlfilestoupdate(oldstandins, newstandins):
752 744 > raise SystemExit(7)
753 745 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
754 746 > EOF
755 747 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
756 748 [7]
757 749 Check large1 content and status ... and that update will undo modifications:
758 750 $ cat large1
759 751 large1 in #3
760 752 $ hg st
761 753 M large1
762 754 ! largeX
763 755 $ hg up -Cr .
764 756 getting changed largefiles
765 757 2 largefiles updated, 0 removed
766 758 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
767 759 $ cat large1
768 760 manually modified before 'hg transplant --continue'
769 761 $ hg st
770 762 Force largefiles rehashing and check that all changes have been caught by
771 763 status and update:
772 764 $ rm .hg/largefiles/dirstate
773 765 $ hg st
774 766
775 767 $ cd ..
776 768
777 769 Test that "hg convert" avoids copying largefiles from the working
778 770 directory into store, because "hg convert" doesn't update largefiles
779 771 in the working directory (removing files under ".cache/largefiles"
780 772 forces "hg convert" to copy corresponding largefiles)
781 773
782 774 $ cat >> $HGRCPATH <<EOF
783 775 > [extensions]
784 776 > convert =
785 777 > EOF
786 778
787 779 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
788 780 $ hg convert -q repo repo.converted
General Comments 0
You need to be logged in to leave comments. Login now