# HG changeset patch # User Benoit Boissinot # Date 1167099171 -3600 # Node ID 68a0fa81ad2863686fdc8e5a58dafb36eb05dcea # Parent fff8a5345eb09b2b41d2d5c518bb3674a70c98d4 cmdutil.py: use contexts in findrenames diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -146,13 +146,12 @@ def walk(repo, pats=[], opts={}, node=No 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))