Mercurial > hg
changeset 28439:b6e71f8af5b8
largefiles: use iterbatch instead of batch
This actually makes the code a little cleaner to read.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 02 Mar 2016 13:13:05 -0500 |
parents | 48fd02dac1d4 |
children | 855d9b2eea67 |
files | hgext/largefiles/wirestore.py |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/wirestore.py Tue Mar 01 18:41:43 2016 -0500 +++ b/hgext/largefiles/wirestore.py Wed Mar 02 13:13:05 2016 -0500 @@ -29,12 +29,8 @@ '''For each hash, return 0 if it is available, other values if not. It is usually 2 if the largefile is missing, but might be 1 the server has a corrupted copy.''' - batch = self.remote.batch() - futures = {} + batch = self.remote.iterbatch() for hash in hashes: - futures[hash] = batch.statlfile(hash) + batch.statlfile(hash) batch.submit() - retval = {} - for hash in hashes: - retval[hash] = futures[hash].value - return retval + return dict(zip(hashes, batch.results()))