# HG changeset patch # User Augie Fackler # Date 1337628346 18000 # Node ID b3435385f99f7d7a58a65783e1f7f5689cb8e3dd # Parent e406b9656da31ab19bee14c0248ce00b3942cbd8 clone: add progress calls to uncompressed code path diff -r e406b9656da3 -r b3435385f99f mercurial/localrepo.py --- 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)))