Show More
@@ -369,10 +369,6 b' def overrideupdate(orig, ui, repo, *pats' | |||||
369 | lfdirstate.write() |
|
369 | lfdirstate.write() | |
370 | if mod: |
|
370 | if mod: | |
371 | raise util.Abort(_('uncommitted changes')) |
|
371 | raise util.Abort(_('uncommitted changes')) | |
372 | # XXX handle removed differently |
|
|||
373 | if not opts['clean']: |
|
|||
374 | for lfile in unsure + modified + added: |
|
|||
375 | lfutil.updatestandin(repo, lfutil.standin(lfile)) |
|
|||
376 | return orig(ui, repo, *pats, **opts) |
|
372 | return orig(ui, repo, *pats, **opts) | |
377 | finally: |
|
373 | finally: | |
378 | wlock.release() |
|
374 | wlock.release() | |
@@ -727,6 +723,14 b' def hgupdaterepo(orig, repo, node, overw' | |||||
727 |
|
723 | |||
728 | def _hgupdaterepo(orig, repo, node, overwrite): |
|
724 | def _hgupdaterepo(orig, repo, node, overwrite): | |
729 | if not overwrite: |
|
725 | if not overwrite: | |
|
726 | # update standins for linear merge | |||
|
727 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |||
|
728 | s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), | |||
|
729 | [], False, False, False) | |||
|
730 | unsure, modified, added = s[:3] | |||
|
731 | for lfile in unsure + modified + added: | |||
|
732 | lfutil.updatestandin(repo, lfutil.standin(lfile)) | |||
|
733 | ||||
730 | # Only call updatelfiles on the standins that have changed to save time |
|
734 | # Only call updatelfiles on the standins that have changed to save time | |
731 | oldstandins = lfutil.getstandinsstate(repo) |
|
735 | oldstandins = lfutil.getstandinsstate(repo) | |
732 |
|
736 |
@@ -323,5 +323,136 b' Test a linear merge to a revision contai' | |||||
323 | A large3 |
|
323 | A large3 | |
324 | $ cat large3 |
|
324 | $ cat large3 | |
325 | large3 as large file for linear merge |
|
325 | large3 as large file for linear merge | |
|
326 | $ rm -f large3 .hglf/large3 | |||
|
327 | ||||
|
328 | Test that the internal linear merging works correctly | |||
|
329 | (both heads are stripped to keep pairing of revision number and commit log) | |||
|
330 | ||||
|
331 | $ hg update -q -C 2 | |||
|
332 | $ hg strip 3 4 | |||
|
333 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob) | |||
|
334 | $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP | |||
|
335 | ||||
|
336 | (internal linear merging at "hg pull --update") | |||
|
337 | ||||
|
338 | $ echo 'large1 for linear merge (conflict)' > large1 | |||
|
339 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 | |||
|
340 | $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg | |||
|
341 | pulling from $TESTTMP/9530e27857f7-backup.hg (glob) | |||
|
342 | searching for changes | |||
|
343 | adding changesets | |||
|
344 | adding manifests | |||
|
345 | adding file changes | |||
|
346 | added 3 changesets with 5 changes to 5 files | |||
|
347 | local changed .hglf/large2 which remote deleted | |||
|
348 | use (c)hanged version or (d)elete? c | |||
|
349 | remote turned local largefile large2 into a normal file | |||
|
350 | keep (l)argefile or use (n)ormal file? l | |||
|
351 | largefile large1 has a merge conflict | |||
|
352 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |||
|
353 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or | |||
|
354 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l | |||
|
355 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
356 | ||||
|
357 | $ hg status -A large1 | |||
|
358 | M large1 | |||
|
359 | $ cat large1 | |||
|
360 | large1 for linear merge (conflict) | |||
|
361 | $ cat .hglf/large1 | |||
|
362 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |||
|
363 | $ hg status -A large2 | |||
|
364 | A large2 | |||
|
365 | $ cat large2 | |||
|
366 | large2 for linear merge (conflict with normal file) | |||
|
367 | $ cat .hglf/large2 | |||
|
368 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |||
|
369 | ||||
|
370 | (internal linear merging at "hg unbundle --update") | |||
|
371 | ||||
|
372 | $ hg update -q -C 2 | |||
|
373 | $ hg rollback -q | |||
|
374 | ||||
|
375 | $ echo 'large1 for linear merge (conflict)' > large1 | |||
|
376 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 | |||
|
377 | $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg | |||
|
378 | adding changesets | |||
|
379 | adding manifests | |||
|
380 | adding file changes | |||
|
381 | added 3 changesets with 5 changes to 5 files | |||
|
382 | local changed .hglf/large2 which remote deleted | |||
|
383 | use (c)hanged version or (d)elete? c | |||
|
384 | remote turned local largefile large2 into a normal file | |||
|
385 | keep (l)argefile or use (n)ormal file? l | |||
|
386 | largefile large1 has a merge conflict | |||
|
387 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |||
|
388 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or | |||
|
389 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l | |||
|
390 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
391 | ||||
|
392 | $ hg status -A large1 | |||
|
393 | M large1 | |||
|
394 | $ cat large1 | |||
|
395 | large1 for linear merge (conflict) | |||
|
396 | $ cat .hglf/large1 | |||
|
397 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |||
|
398 | $ hg status -A large2 | |||
|
399 | A large2 | |||
|
400 | $ cat large2 | |||
|
401 | large2 for linear merge (conflict with normal file) | |||
|
402 | $ cat .hglf/large2 | |||
|
403 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |||
|
404 | ||||
|
405 | (internal linear merging in subrepo at "hg update") | |||
326 |
|
406 | |||
327 | $ cd .. |
|
407 | $ cd .. | |
|
408 | $ hg init subparent | |||
|
409 | $ cd subparent | |||
|
410 | ||||
|
411 | $ hg clone -q -u 2 ../repo sub | |||
|
412 | $ cat > .hgsub <<EOF | |||
|
413 | > sub = sub | |||
|
414 | > EOF | |||
|
415 | $ hg add .hgsub | |||
|
416 | $ hg commit -m '#0@parent' | |||
|
417 | $ cat .hgsubstate | |||
|
418 | f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub | |||
|
419 | $ hg -R sub update -q | |||
|
420 | $ hg commit -m '#1@parent' | |||
|
421 | $ cat .hgsubstate | |||
|
422 | d65e59e952a9638e2ce863b41a420ca723dd3e8d sub | |||
|
423 | $ hg update -q 0 | |||
|
424 | ||||
|
425 | $ echo 'large1 for linear merge (conflict)' > sub/large1 | |||
|
426 | $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2 | |||
|
427 | $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF | |||
|
428 | > m | |||
|
429 | > r | |||
|
430 | > c | |||
|
431 | > l | |||
|
432 | > l | |||
|
433 | > EOF | |||
|
434 | subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9) | |||
|
435 | (M)erge, keep (l)ocal or keep (r)emote? subrepository sources for sub differ (in checked out version) | |||
|
436 | use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? | |||
|
437 | local changed .hglf/large2 which remote deleted | |||
|
438 | use (c)hanged version or (d)elete? remote turned local largefile large2 into a normal file | |||
|
439 | keep (l)argefile or use (n)ormal file? largefile large1 has a merge conflict | |||
|
440 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |||
|
441 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or | |||
|
442 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
443 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
444 | ||||
|
445 | $ hg -R sub status -A sub/large1 | |||
|
446 | M sub/large1 | |||
|
447 | $ cat sub/large1 | |||
|
448 | large1 for linear merge (conflict) | |||
|
449 | $ cat sub/.hglf/large1 | |||
|
450 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |||
|
451 | $ hg -R sub status -A sub/large2 | |||
|
452 | A sub/large2 | |||
|
453 | $ cat sub/large2 | |||
|
454 | large2 for linear merge (conflict with normal file) | |||
|
455 | $ cat sub/.hglf/large2 | |||
|
456 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |||
|
457 | ||||
|
458 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now