# HG changeset patch # User Anton Shestakov # Date 1457706560 -28800 # Node ID 0d6b3630b9a386409a2b8f52d279a684492a7f06 # Parent bd37f0d53a49786f1f32637a3932b332dcfeede2 similar: specify unit for ui.progress when operating on files diff -r bd37f0d53a49 -r 0d6b3630b9a3 mercurial/similar.py --- a/mercurial/similar.py Fri Mar 11 20:18:41 2016 +0800 +++ b/mercurial/similar.py Fri Mar 11 22:29:20 2016 +0800 @@ -25,14 +25,15 @@ # Get hashes of removed files. hashes = {} for i, fctx in enumerate(removed): - repo.ui.progress(_('searching for exact renames'), i, total=numfiles) + repo.ui.progress(_('searching for exact renames'), i, total=numfiles, + unit=_('files')) h = util.sha1(fctx.data()).digest() hashes[h] = fctx # For each added file, see if it corresponds to a removed file. for i, fctx in enumerate(added): repo.ui.progress(_('searching for exact renames'), i + len(removed), - total=numfiles) + total=numfiles, unit=_('files')) h = util.sha1(fctx.data()).digest() if h in hashes: yield (hashes[h], fctx) @@ -49,7 +50,7 @@ copies = {} for i, r in enumerate(removed): repo.ui.progress(_('searching for similar files'), i, - total=len(removed)) + total=len(removed), unit=_('files')) # lazily load text @util.cachefunc