Mercurial > public > mercurial-scm > hg-stable
diff hgext/lfs/blobstore.py @ 35921:fa993c3c8462
lfs: emit a status message to indicate how many blobs were uploaded
Previously, there was a progress bar indicating the byte count, but then it
disappeared once the transfer was done. Having that value stay on the screen
seems useful. Downloads are done one at a time, so hold off on that until they
can be coalesced, to avoid a series of lines being printed. (I don't have any
great ideas on how to do that. It would be a shame to have to wrap a bunch of
read commands to be able to do this.)
I'm not sure if the 'lfs:' prefix is the right thing to do here. The others in
the test are verbose/debug messages, so in the normal case, this is the only
line that's prefixed.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 29 Jan 2018 22:09:48 -0500 |
parents | 069df0b952e8 |
children | 9b413478f261 |
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py Tue Jan 30 20:33:21 2018 -0500 +++ b/hgext/lfs/blobstore.py Mon Jan 29 22:09:48 2018 -0500 @@ -366,12 +366,23 @@ oids = transfer(sorted(objects, key=lambda o: o.get('oid'))) processed = 0 + blobs = 0 for _one, oid in oids: processed += sizes[oid] + blobs += 1 self.ui.progress(topic, processed, total=total) self.ui.note(_('lfs: processed: %s\n') % oid) self.ui.progress(topic, pos=None, total=total) + if blobs > 0: + if action == 'upload': + self.ui.status(_('lfs: uploaded %d files (%s)\n') + % (blobs, util.bytecount(processed))) + # TODO: coalesce the download requests, and comment this in + #elif action == 'download': + # self.ui.status(_('lfs: downloaded %d files (%s)\n') + # % (blobs, util.bytecount(processed))) + def __del__(self): # copied from mercurial/httppeer.py urlopener = getattr(self, 'urlopener', None)