bundle2: include client capabilities in the pushed bundle
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 14:37:24 -0400
changeset 21142 15039ce3e4a3
parent 21141 d8dd19e09ed4
child 21143 5bb5d4ba14e5
bundle2: include client capabilities in the pushed bundle The necessary data is now included in the `replycaps` part.
mercurial/exchange.py
--- a/mercurial/exchange.py	Thu Apr 17 01:49:20 2014 -0400
+++ b/mercurial/exchange.py	Thu Apr 17 14:37:24 2014 -0400
@@ -210,7 +210,9 @@
     capsblob = urllib.unquote(pushop.remote.capable('bundle2'))
     caps = bundle2.decodecaps(capsblob)
     bundler = bundle2.bundle20(pushop.ui, caps)
-    bundler.addpart(bundle2.bundlepart('replycaps'))
+    # create reply capability
+    capsblob = bundle2.encodecaps(pushop.repo.bundle2caps)
+    bundler.addpart(bundle2.bundlepart('replycaps', data=capsblob))
     if not pushop.force:
         part = bundle2.bundlepart('CHECK:HEADS', data=iter(pushop.remoteheads))
         bundler.addpart(part)