3835 |
3835 |
3836 @eh.addattr(localrepo.localpeer, 'evoext_pullobsmarkers_0') |
3836 @eh.addattr(localrepo.localpeer, 'evoext_pullobsmarkers_0') |
3837 def local_pullobsmarkers(self, heads=None, common=None): |
3837 def local_pullobsmarkers(self, heads=None, common=None): |
3838 return _getobsmarkersstream(self._repo, heads=heads, common=common) |
3838 return _getobsmarkersstream(self._repo, heads=heads, common=common) |
3839 |
3839 |
|
3840 # The wireproto.streamres API changed, handling chunking and compression |
|
3841 # directly. Handle either case. |
|
3842 if util.safehasattr(wireproto.abstractserverproto, 'groupchunks'): |
|
3843 # We need to handle chunking and compression directly |
|
3844 def streamres(d, proto): |
|
3845 wireproto.streamres(proto.groupchunks(d)) |
|
3846 else: |
|
3847 # Leave chunking and compression to streamres |
|
3848 def streamres(d, proto): |
|
3849 wireproto.streamres(reader=d, v1compressible=True) |
|
3850 |
3840 def srv_pullobsmarkers(repo, proto, others): |
3851 def srv_pullobsmarkers(repo, proto, others): |
3841 opts = wireproto.options('', ['heads', 'common'], others) |
3852 opts = wireproto.options('', ['heads', 'common'], others) |
3842 for k, v in opts.iteritems(): |
3853 for k, v in opts.iteritems(): |
3843 if k in ('heads', 'common'): |
3854 if k in ('heads', 'common'): |
3844 opts[k] = wireproto.decodelist(v) |
3855 opts[k] = wireproto.decodelist(v) |
3846 finaldata = StringIO() |
3857 finaldata = StringIO() |
3847 obsdata = obsdata.getvalue() |
3858 obsdata = obsdata.getvalue() |
3848 finaldata.write('%20i' % len(obsdata)) |
3859 finaldata.write('%20i' % len(obsdata)) |
3849 finaldata.write(obsdata) |
3860 finaldata.write(obsdata) |
3850 finaldata.seek(0) |
3861 finaldata.seek(0) |
3851 return wireproto.streamres(proto.groupchunks(finaldata)) |
3862 return streamres(finaldata, proto) |
3852 |
3863 |
3853 def _obsrelsethashtreefm0(repo): |
3864 def _obsrelsethashtreefm0(repo): |
3854 return _obsrelsethashtree(repo, obsolete._fm0encodeonemarker) |
3865 return _obsrelsethashtree(repo, obsolete._fm0encodeonemarker) |
3855 |
3866 |
3856 def _obsrelsethashtreefm1(repo): |
3867 def _obsrelsethashtreefm1(repo): |