diff mercurial/wireproto.py @ 21622:457492741007

bundle2: support transmission of params error over the wire We picked a null character to split each parameter during the transfer. This is fragile if the same character is used in parameter name. However other codes will already behave in a strange way in that case, so we are not introducing any regression. A better format may be picked for the final version of the protocol.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 28 May 2014 15:57:23 -0700
parents 6eaa71b2a3cc
children 3e8bcc90f07c
line wrap: on
line diff
--- a/mercurial/wireproto.py	Wed May 28 15:53:34 2014 -0700
+++ b/mercurial/wireproto.py	Wed May 28 15:57:23 2014 -0700
@@ -807,6 +807,8 @@
             bundler = bundle2.bundle20(repo.ui)
             errpart = bundler.newpart('B2X:ERROR:UNSUPPORTEDCONTENT')
             errpart.addparam('parttype', exc.parttype)
+            if exc.params:
+                errpart.addparam('params', '\0'.join(exc.params))
             return streamres(bundler.getchunks())
     except util.Abort, inst:
         # The old code we moved used sys.stderr directly.