Mercurial > evolve
comparison hgext/simple4server.py @ 877:cf35f38d6a10
exchange: fix changeset pulling over http
http compress its stream. The were building a bogus stream where the first 10
bytes where uncompressed. Confusing the client.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 10 Mar 2014 21:35:54 -0700 |
parents | 8c9601a6c4e0 |
children | 5cb2744a6d36 |
comparison
equal
deleted
inserted
replaced
876:8c9601a6c4e0 | 877:cf35f38d6a10 |
---|---|
143 opts = wireproto.options('', ['heads', 'common'], others) | 143 opts = wireproto.options('', ['heads', 'common'], others) |
144 for k, v in opts.iteritems(): | 144 for k, v in opts.iteritems(): |
145 if k in ('heads', 'common'): | 145 if k in ('heads', 'common'): |
146 opts[k] = wireproto.decodelist(v) | 146 opts[k] = wireproto.decodelist(v) |
147 obsdata = _getobsmarkersstream(repo, **opts) | 147 obsdata = _getobsmarkersstream(repo, **opts) |
148 length = '%20i' % len(obsdata.getvalue()) | 148 finaldata = StringIO() |
149 def data(): | 149 obsdata = obsdata.getvalue() |
150 yield length | 150 finaldata.write('%20i' % len(obsdata)) |
151 for c in proto.groupchunks(obsdata): | 151 finaldata.write(obsdata) |
152 yield c | 152 finaldata.seek(0) |
153 return wireproto.streamres(data()) | 153 return wireproto.streamres(proto.groupchunks(finaldata)) |
154 | 154 |
155 | 155 |
156 # from evolve extension: 1a23c7c52a43 | 156 # from evolve extension: 1a23c7c52a43 |
157 def _obsrelsethashtree(repo): | 157 def _obsrelsethashtree(repo): |
158 """Build an obshash for every node in a repo | 158 """Build an obshash for every node in a repo |