Show More
@@ -703,15 +703,8 b' def addremove(repo, pats=[], opts={}, dr' | |||||
703 | status = _('removing %s\n') % ((pats and rel) or abs) |
|
703 | status = _('removing %s\n') % ((pats and rel) or abs) | |
704 | repo.ui.status(status) |
|
704 | repo.ui.status(status) | |
705 |
|
705 | |||
706 | renames = {} |
|
706 | renames = _findrenames(repo, m, added + unknown, removed + deleted, | |
707 | if similarity > 0: |
|
707 | similarity) | |
708 | for old, new, score in similar.findrenames(repo, |
|
|||
709 | added + unknown, removed + deleted, similarity): |
|
|||
710 | if repo.ui.verbose or not m.exact(old) or not m.exact(new): |
|
|||
711 | repo.ui.status(_('recording removal of %s as rename to %s ' |
|
|||
712 | '(%d%% similar)\n') % |
|
|||
713 | (m.rel(old), m.rel(new), score * 100)) |
|
|||
714 | renames[new] = old |
|
|||
715 |
|
708 | |||
716 | if not dry_run: |
|
709 | if not dry_run: | |
717 | wctx = repo[None] |
|
710 | wctx = repo[None] | |
@@ -755,6 +748,21 b' def _interestingfiles(repo, matcher):' | |||||
755 |
|
748 | |||
756 | return added, unknown, deleted, removed |
|
749 | return added, unknown, deleted, removed | |
757 |
|
750 | |||
|
751 | def _findrenames(repo, matcher, added, removed, similarity): | |||
|
752 | '''Find renames from removed files to added ones.''' | |||
|
753 | renames = {} | |||
|
754 | if similarity > 0: | |||
|
755 | for old, new, score in similar.findrenames(repo, added, removed, | |||
|
756 | similarity): | |||
|
757 | if (repo.ui.verbose or not matcher.exact(old) | |||
|
758 | or not matcher.exact(new)): | |||
|
759 | repo.ui.status(_('recording removal of %s as rename to %s ' | |||
|
760 | '(%d%% similar)\n') % | |||
|
761 | (matcher.rel(old), matcher.rel(new), | |||
|
762 | score * 100)) | |||
|
763 | renames[new] = old | |||
|
764 | return renames | |||
|
765 | ||||
758 | def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): |
|
766 | def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): | |
759 | """Update the dirstate to reflect the intent of copying src to dst. For |
|
767 | """Update the dirstate to reflect the intent of copying src to dst. For | |
760 | different reasons it might not end with dst being marked as copied from src. |
|
768 | different reasons it might not end with dst being marked as copied from src. |
General Comments 0
You need to be logged in to leave comments.
Login now