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