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