def _findrenames(repo, matcher, added, removed, similarity):
    """Find renames from removed files to added ones."""
    renames = {}
    if similarity > 0:
        for old, new, score in similar.findrenames(repo, added, removed, similarity):
            if repo.ui.verbose or not matcher.exact(old) or not matcher.exact(new):
                repo.ui.status(
                    _("recording removal of %s as rename to %s " "(%d%% similar)\n")
                    % (matcher.rel(old), matcher.rel(new), score * 100)
                )
            renames[new] = old
    return renames