comparison tests/test-import-git.t @ 16112:d7829b2ecf32 stable

import: handle git renames and --similarity (issue3187) There is no reason to discard copy sources from the set of files considered by addremove(). It was done to handle the case where a first patch would create 'a' and a second one would move 'a' to 'b'. If these patches were applied with --no-commit, 'a' would first be marked as added, then unlinked and dropped from the dirstate but still passed to addremove(). A better fix is thus to exclude removed files which ends being dropped from the dirstate instead of removed. Reported by Jason Harris <jason@jasonfharris.com>
author Patrick Mezard <patrick@mezard.eu>
date Thu, 16 Feb 2012 13:03:42 +0100
parents e0348815e806
children fc4e0fecf403
comparison
equal deleted inserted replaced
16111:131d1a09108a 16112:d7829b2ecf32
400 applying patch from stdin 400 applying patch from stdin
401 $ hg st --copies 401 $ hg st --copies
402 A b 402 A b
403 a 403 a
404 R a 404 R a
405
406 Renames, similarity and git diff
407
408 $ hg revert -aC
409 undeleting a
410 forgetting b
411 $ rm b
412 $ hg import --similarity 90 --no-commit - <<EOF
413 > diff --git a/a b/b
414 > rename from a
415 > rename to b
416 > EOF
417 applying patch from stdin
418 $ hg st --copies
419 A b
420 a
421 R a
405 $ cd .. 422 $ cd ..
406 423
407 Pure copy with existing destination 424 Pure copy with existing destination
408 425
409 $ hg init copytoexisting 426 $ hg init copytoexisting