diff --git a/hgext/largefiles/wirestore.py b/hgext/largefiles/wirestore.py --- a/hgext/largefiles/wirestore.py +++ b/hgext/largefiles/wirestore.py @@ -32,8 +32,16 @@ '''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.iterbatch() - for hash in hashes: - batch.statlfile(hash) - batch.submit() - return dict(zip(hashes, batch.results())) + + with self.remote.commandexecutor() as e: + fs = [] + for hash in hashes: + fs.append((hash, e.callcommand('statlfile', { + 'sha': hash, + }))) + + # We need to trigger sending manually and resolve the futures + # inside the context manager or we buffer all responses. + e.sendcommands() + + return {hash: f.result() for hash, f in fs} diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t --- a/tests/test-largefiles-wireproto.t +++ b/tests/test-largefiles-wireproto.t @@ -312,7 +312,7 @@ getting changed largefiles using http://localhost:$HGPORT2/ sending capabilities command - sending batch command + sending statlfile command getting largefiles: 0/1 files (0.00%) getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 sending getlfile command @@ -400,7 +400,7 @@ searching 3 changesets for largefiles verified existence of 3 revisions of 3 largefiles $ tail -1 access.log - $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) + $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) $ killdaemons.py