addremove: add progress support for similarity search
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 08 Mar 2010 00:00:03 +0100
changeset 10607 f3ac9d6105ee
parent 10606 5868dd69fb03
child 10608 87fce8c5e29d
addremove: add progress support for similarity search
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sun Mar 07 23:59:28 2010 +0100
+++ b/mercurial/cmdutil.py	Mon Mar 08 00:00:03 2010 +0100
@@ -289,7 +289,8 @@
     '''find renamed files -- yields (before, after, score) tuples'''
     copies = {}
     ctx = repo['.']
-    for r in removed:
+    for i, r in enumerate(removed):
+        repo.ui.progress(_('looking for similarities'), i, total=len(removed))
         if r not in ctx:
             continue
         fctx = ctx.filectx(r)
@@ -319,6 +320,7 @@
             myscore = score(repo.wread(a))
             if myscore >= bestscore:
                 copies[a] = (r, myscore)
+    repo.ui.progress(_('looking for similarities'), None, total=len(removed))
 
     for dest, v in copies.iteritems():
         source, score = v