156 seenmarkers |= direct |
156 seenmarkers |= direct |
157 pendingnodes -= seennodes |
157 pendingnodes -= seennodes |
158 seennodes |= pendingnodes |
158 seennodes |= pendingnodes |
159 return seenmarkers |
159 return seenmarkers |
160 |
160 |
|
161 # The wireproto.streamres API changed, handling chunking and compression |
|
162 # directly. Handle either case. |
|
163 if util.safehasattr(wireproto.abstractserverproto, 'groupchunks'): |
|
164 # We need to handle chunking and compression directly |
|
165 def streamres(d, proto): |
|
166 return wireproto.streamres(proto.groupchunks(d)) |
|
167 else: |
|
168 # Leave chunking and compression to streamres |
|
169 def streamres(d, proto): |
|
170 return wireproto.streamres(reader=d, v1compressible=True) |
|
171 |
161 # from evolve extension: cf35f38d6a10 |
172 # from evolve extension: cf35f38d6a10 |
162 def srv_pullobsmarkers(repo, proto, others): |
173 def srv_pullobsmarkers(repo, proto, others): |
163 """serves a binary stream of markers. |
174 """serves a binary stream of markers. |
164 |
175 |
165 Serves relevant to changeset between heads and common. The stream is prefix |
176 Serves relevant to changeset between heads and common. The stream is prefix |
173 finaldata = StringIO() |
184 finaldata = StringIO() |
174 obsdata = obsdata.getvalue() |
185 obsdata = obsdata.getvalue() |
175 finaldata.write('%20i' % len(obsdata)) |
186 finaldata.write('%20i' % len(obsdata)) |
176 finaldata.write(obsdata) |
187 finaldata.write(obsdata) |
177 finaldata.seek(0) |
188 finaldata.seek(0) |
178 return wireproto.streamres(proto.groupchunks(finaldata)) |
189 return streamres(finaldata, proto) |
179 |
190 |
180 |
191 |
181 # from evolve extension: 3249814dabd1 |
192 # from evolve extension: 3249814dabd1 |
182 def _obsrelsethashtreefm0(repo): |
193 def _obsrelsethashtreefm0(repo): |
183 return _obsrelsethashtree(repo, obsolete._fm0encodeonemarker) |
194 return _obsrelsethashtree(repo, obsolete._fm0encodeonemarker) |