Mercurial > hg-stable
changeset 28473:61d1a3cc6e1c
streamclone: specify unit for ui.progress when handling data
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 11 Mar 2016 22:28:27 +0800 |
parents | 70d3dc05e118 |
children | 00e6e0d0bfeb |
files | mercurial/streamclone.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/streamclone.py Fri Mar 11 22:30:29 2016 +0800 +++ b/mercurial/streamclone.py Fri Mar 11 22:28:27 2016 +0800 @@ -270,11 +270,12 @@ assert compression == 'UN' seen = 0 - repo.ui.progress(_('bundle'), 0, total=bytecount) + repo.ui.progress(_('bundle'), 0, total=bytecount, unit=_('bytes')) for chunk in it: seen += len(chunk) - repo.ui.progress(_('bundle'), seen, total=bytecount) + repo.ui.progress(_('bundle'), seen, total=bytecount, + unit=_('bytes')) yield chunk repo.ui.progress(_('bundle'), None) @@ -294,7 +295,7 @@ repo.ui.status(_('%d files to transfer, %s of data\n') % (filecount, util.bytecount(bytecount))) handled_bytes = 0 - repo.ui.progress(_('clone'), 0, total=bytecount) + repo.ui.progress(_('clone'), 0, total=bytecount, unit=_('bytes')) start = time.time() with repo.transaction('clone'): @@ -317,7 +318,7 @@ for chunk in util.filechunkiter(fp, limit=size): handled_bytes += len(chunk) repo.ui.progress(_('clone'), handled_bytes, - total=bytecount) + total=bytecount, unit=_('bytes')) ofp.write(chunk) # Writing straight to files circumvented the inmemory caches