Mercurial > hg
comparison mercurial/bundle2.py @ 20997:d7df4b7378ae
bundle2: produce a bundle2 reply
We do not know yet what kind of data future features and extensions will need to
exchange. To handle that, bundle2 allows to send arbitrary content to the
server. As a consequence, we need to be able to reply arbitrary content to the
client. And, we can use bundle2 to transmit those arbitrary data.
When a client will push a bundle2 to the server, the server will reply with a
bundle2 itself.
This changeset installs the first stone of this logic and test it.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 04 Apr 2014 14:24:11 -0700 |
parents | ed3c5e18a047 |
children | 93a3c5b58635 |
comparison
equal
deleted
inserted
replaced
20996:ed3c5e18a047 | 20997:d7df4b7378ae |
---|---|
252 def __init__(self, repo, transactiongetter): | 252 def __init__(self, repo, transactiongetter): |
253 self.repo = repo | 253 self.repo = repo |
254 self.ui = repo.ui | 254 self.ui = repo.ui |
255 self.records = unbundlerecords() | 255 self.records = unbundlerecords() |
256 self.gettransaction = transactiongetter | 256 self.gettransaction = transactiongetter |
257 self.reply = None | |
257 | 258 |
258 class TransactionUnavailable(RuntimeError): | 259 class TransactionUnavailable(RuntimeError): |
259 pass | 260 pass |
260 | 261 |
261 def _notransaction(): | 262 def _notransaction(): |
275 before final usage. | 276 before final usage. |
276 | 277 |
277 Unknown Mandatory part will abort the process. | 278 Unknown Mandatory part will abort the process. |
278 """ | 279 """ |
279 op = bundleoperation(repo, transactiongetter) | 280 op = bundleoperation(repo, transactiongetter) |
281 # todo: | |
282 # - only create reply bundle if requested. | |
283 op.reply = bundle20(op.ui) | |
280 # todo: | 284 # todo: |
281 # - replace this is a init function soon. | 285 # - replace this is a init function soon. |
282 # - exception catching | 286 # - exception catching |
283 unbundler.params | 287 unbundler.params |
284 iterparts = iter(unbundler) | 288 iterparts = iter(unbundler) |