Mercurial > hg-stable
changeset 41671:f89aad980025
automv: respect ui.relative-paths
Differential Revision: https://phab.mercurial-scm.org/D5910
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 08 Feb 2019 13:20:46 -0800 |
parents | ecf7f4ef52fb |
children | 05433ad59c52 |
files | hgext/automv.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/automv.py Fri Feb 08 13:27:54 2019 -0800 +++ b/hgext/automv.py Fri Feb 08 13:20:46 2019 -0800 @@ -64,7 +64,8 @@ if threshold > 0: match = scmutil.match(repo[None], pats, opts) added, removed = _interestingfiles(repo, match) - renames = _findrenames(repo, match, added, removed, + uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True) + renames = _findrenames(repo, uipathfn, added, removed, threshold / 100.0) with repo.wlock(): @@ -89,7 +90,7 @@ return added, removed -def _findrenames(repo, matcher, added, removed, similarity): +def _findrenames(repo, uipathfn, added, removed, similarity): """Find what files in added are really moved files. Any file named in removed that is at least similarity% similar to a file @@ -103,7 +104,7 @@ if repo.ui.verbose: repo.ui.status( _('detected move of %s as %s (%d%% similar)\n') % ( - matcher.rel(src), matcher.rel(dst), score * 100)) + uipathfn(src), uipathfn(dst), score * 100)) renames[dst] = src if renames: repo.ui.status(_('detected move of %d files\n') % len(renames))