Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 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 | 6b4127c7d52a |
children | 431f3c1d3a37 |
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))