diff 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
line wrap: on
line diff
--- a/mercurial/bundle2.py	Fri Apr 11 08:24:59 2014 -0700
+++ b/mercurial/bundle2.py	Fri Apr 04 14:24:11 2014 -0700
@@ -254,6 +254,7 @@
         self.ui = repo.ui
         self.records = unbundlerecords()
         self.gettransaction = transactiongetter
+        self.reply = None
 
 class TransactionUnavailable(RuntimeError):
     pass
@@ -278,6 +279,9 @@
     """
     op = bundleoperation(repo, transactiongetter)
     # todo:
+    # - only create reply bundle if requested.
+    op.reply = bundle20(op.ui)
+    # todo:
     # - replace this is a init function soon.
     # - exception catching
     unbundler.params