# HG changeset patch # User Benoit Boissinot # Date 1259083307 -3600 # Node ID 2ae4d086562930ecbd6d344eeddfb2c32280deda # Parent 4b044b81cb548d8bea2db1f998306efad8953389 findrenames: speedup exact match benchmarked on crew repo with: rm -rf * ; hg up -C ; for i in `find . -name "*.py"` ; do mv $i $i.new;done followed by: hg addremove -s 100 before: Time: real 28.890 secs (user 26.920+0.000 sys 1.450+0.000) after : Time: real 6.790 secs (user 5.310+0.000 sys 1.350+0.000) diff -r 4b044b81cb54 -r 2ae4d0865629 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Nov 24 17:39:42 2009 +0100 +++ b/mercurial/cmdutil.py Tue Nov 24 18:21:47 2009 +0100 @@ -276,11 +276,15 @@ if r not in ctx: continue fctx = ctx.filectx(r) - orig = fctx.data() def score(text): if not len(text): return 0.0 + if not fctx.cmp(text): + return 1.0 + if threshold == 1.0: + return 0.0 + orig = fctx.data() # bdiff.blocks() returns blocks of matching lines # count the number of bytes in each equal = 0