# HG changeset patch # User Augie Fackler # Date 1456942385 18000 # Node ID b6e71f8af5b8710139b64706a375b3f16eb1241e # Parent 48fd02dac1d4a170b10e1d5216f4ef456e8909e8 largefiles: use iterbatch instead of batch This actually makes the code a little cleaner to read. diff -r 48fd02dac1d4 -r b6e71f8af5b8 hgext/largefiles/wirestore.py --- 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()))