Mercurial > hg
changeset 3971:68a0fa81ad28
cmdutil.py: use contexts in findrenames
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 26 Dec 2006 03:12:51 +0100 |
parents | fff8a5345eb0 |
children | 356e20d46b34 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue Dec 26 03:12:23 2006 +0100 +++ b/mercurial/cmdutil.py Tue Dec 26 03:12:51 2006 +0100 @@ -146,13 +146,12 @@ def findrenames(repo, added=None, removed=None, threshold=0.5): if added is None or removed is None: added, removed = repo.status()[1:3] - changes = repo.changelog.read(repo.dirstate.parents()[0]) - mf = repo.manifest.read(changes[0]) + ctx = repo.changectx() for a in added: aa = repo.wread(a) bestscore, bestname = None, None for r in removed: - rr = repo.file(r).read(mf[r]) + rr = ctx.filectx(r).data() delta = mdiff.textdiff(aa, rr) if len(delta) < len(aa): myscore = 1.0 - (float(len(delta)) / len(aa))