Mercurial > hg-stable
changeset 16770:b3435385f99f
clone: add progress calls to uncompressed code path
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 21 May 2012 14:25:46 -0500 |
parents | e406b9656da3 |
children | d490edc71146 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon May 21 17:35:28 2012 -0500 +++ b/mercurial/localrepo.py Mon May 21 14:25:46 2012 -0500 @@ -2246,6 +2246,8 @@ _('Unexpected response from remote server:'), l) self.ui.status(_('%d files to transfer, %s of data\n') % (total_files, util.bytecount(total_bytes))) + handled_bytes = 0 + self.ui.progress(_('clone'), 0, total=total_bytes) start = time.time() for i in xrange(total_files): # XXX doesn't support '\n' or '\r' in filenames @@ -2262,11 +2264,15 @@ # for backwards compat, name was partially encoded ofp = self.sopener(store.decodedir(name), 'w') for chunk in util.filechunkiter(fp, limit=size): + handled_bytes += len(chunk) + self.ui.progress(_('clone'), handled_bytes, + total=total_bytes) ofp.write(chunk) ofp.close() elapsed = time.time() - start if elapsed <= 0: elapsed = 0.001 + self.ui.progress(_('clone'), None) self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') % (util.bytecount(total_bytes), elapsed, util.bytecount(total_bytes / elapsed)))