##// END OF EJS Templates
import: handle git renames and --similarity (issue3187)...
Patrick Mezard -
r16112:d7829b2e stable
parent child Browse files
Show More
@@ -475,9 +475,15 b' class workingbackend(fsbackend):'
475 addremoved = set(self.changed)
475 addremoved = set(self.changed)
476 for src, dst in self.copied:
476 for src, dst in self.copied:
477 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
477 scmutil.dirstatecopy(self.ui, self.repo, wctx, src, dst)
478 addremoved.discard(src)
478 if self.removed:
479 if (not self.similarity) and self.removed:
480 wctx.forget(sorted(self.removed))
479 wctx.forget(sorted(self.removed))
480 for f in self.removed:
481 if f not in self.repo.dirstate:
482 # File was deleted and no longer belongs to the
483 # dirstate, it was probably marked added then
484 # deleted, and should not be considered by
485 # addremove().
486 addremoved.discard(f)
481 if addremoved:
487 if addremoved:
482 cwd = self.repo.getcwd()
488 cwd = self.repo.getcwd()
483 if cwd:
489 if cwd:
@@ -402,6 +402,23 b' Renames and strip'
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
@@ -663,7 +663,6 b' test import with similarity and git and '
663 applying ../rename.diff
663 applying ../rename.diff
664 patching file a
664 patching file a
665 patching file b
665 patching file b
666 removing a
667 adding b
666 adding b
668 recording removal of a as rename to b (88% similar)
667 recording removal of a as rename to b (88% similar)
669 applied to working directory
668 applied to working directory
@@ -679,7 +678,6 b' test import with similarity and git and '
679 applying ../rename.diff
678 applying ../rename.diff
680 patching file a
679 patching file a
681 patching file b
680 patching file b
682 removing a
683 adding b
681 adding b
684 applied to working directory
682 applied to working directory
685 $ hg st -C
683 $ hg st -C
General Comments 0
You need to be logged in to leave comments. Login now