bundle2: also capture reply capability on failure
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 06 Jun 2015 00:50:27 -0700
changeset 25492 219b8ab31220
parent 25491 8cd0159207df
child 25493 d8e7b0781ad7
bundle2: also capture reply capability on failure When unbundling over the wire is aborted, we have a mechanism to convey the error inside a bundle part. As we add support for more errors, we need to know if the client will support them. For this purpose, we duck punch the reply capabilities of the client on the raised extensions. This is similar to what is done to salvage the server output on error.
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Sat Jun 06 00:32:19 2015 -0700
+++ b/mercurial/bundle2.py	Sat Jun 06 00:50:27 2015 -0700
@@ -347,8 +347,11 @@
         # craziness in a future version.
         exc.duringunbundle2 = True
         salvaged = []
+        replycaps = None
         if op.reply is not None:
             salvaged = op.reply.salvageoutput()
+            replycaps = op.reply.capabilities
+        exc._replycaps = replycaps
         exc._bundle2salvagedoutput = salvaged
         raise
     finally: