compat: drop compatibility for 'streamres' prior to 4.1
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 24 Oct 2017 14:30:48 +0200
changeset 3148 0ed75e700ad8
parent 3147 20a0792c1773
child 3149 79a926b557f1
compat: drop compatibility for 'streamres' prior to 4.1 We no longer support these version.
hgext3rd/evolve/obsexchange.py
--- a/hgext3rd/evolve/obsexchange.py	Tue Oct 24 14:24:29 2017 +0200
+++ b/hgext3rd/evolve/obsexchange.py	Tue Oct 24 14:30:48 2017 +0200
@@ -182,17 +182,6 @@
     obsdata.seek(0)
     return obsdata
 
-# The wireproto.streamres API changed, handling chunking and compression
-# directly. Handle either case.
-if util.safehasattr(wireproto.abstractserverproto, 'groupchunks'):
-    # We need to handle chunking and compression directly
-    def streamres(d, proto):
-        return wireproto.streamres(proto.groupchunks(d))
-else:
-    # Leave chunking and compression to streamres
-    def streamres(d, proto):
-        return wireproto.streamres(reader=d, v1compressible=True)
-
 def srv_pullobsmarkers(repo, proto, others):
     """serves a binary stream of markers.
 
@@ -209,7 +198,7 @@
     finaldata.write('%20i' % len(obsdata))
     finaldata.write(obsdata)
     finaldata.seek(0)
-    return streamres(finaldata, proto)
+    return wireproto.streamres(reader=finaldata, v1compressible=True)
 
 ###############################################
 ### Support for old legacy exchange methods ###