cmdutil.py: use contexts in findrenames
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Tue, 26 Dec 2006 03:12:51 +0100
changeset 3971 68a0fa81ad28
parent 3970 fff8a5345eb0
child 3972 356e20d46b34
cmdutil.py: use contexts in findrenames
mercurial/cmdutil.py
--- 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))