--- a/hgext/largefiles/proto.py Tue Aug 24 17:27:16 2021 +0200
+++ b/hgext/largefiles/proto.py Tue Aug 24 17:27:16 2021 +0200
@@ -184,17 +184,18 @@
@wireprotov1peer.batchable
def statlfile(self, sha):
- f = wireprotov1peer.future()
+ def decode(d):
+ try:
+ return int(d)
+ except (ValueError, urlerr.httperror):
+ # If the server returns anything but an integer followed by a
+ # newline, newline, it's not speaking our language; if we get
+ # an HTTP error, we can't be sure the largefile is present;
+ # either way, consider it missing.
+ return 2
+
result = {b'sha': sha}
- yield result, f
- try:
- yield int(f.value)
- except (ValueError, urlerr.httperror):
- # If the server returns anything but an integer followed by a
- # newline, newline, it's not speaking our language; if we get
- # an HTTP error, we can't be sure the largefile is present;
- # either way, consider it missing.
- yield 2
+ return result, decode
repo.__class__ = lfileswirerepository